Game Maker's Garage Forum

Game Creation => GameMaker => Topic started by: Zoo on May 24, 2011, 07:33:53 PM

Title: Is there a maximum timer?
Post by: Zoo on May 24, 2011, 07:33:53 PM
Is there a maximum to how long a timer can be? I want to make a 7.5 million year long timer, for the fun of it.
Title: Re: Is there a maximum timer?
Post by: Gan on May 25, 2011, 12:52:18 AM
I don't know, why don't ya code one and tell us when it ticks?
Title: Re: Is there a maximum timer?
Post by: Al Staffieri on May 25, 2011, 08:30:48 AM
Quote
Is there a maximum to how long a timer can be?
I don't know, but my guess would be 32767. Since 100 = 1 second, that would be 327.67 seconds or 5.4 minutes.


Title: Re: Is there a maximum timer?
Post by: Al Staffieri on May 25, 2011, 08:44:20 AM
Well I just tried 33000 and it worked, so maybe I'll try 360000 and come back in an hour and see what happens.
Title: Re: Is there a maximum timer?
Post by: Al Staffieri on May 25, 2011, 09:08:30 AM
OK. With 360000 it still only waits a little more than 5 minutes, so while there's no error, it looks like the most seconds a timer can be is 32767 even if you use a higher number.
Title: Re: Is there a maximum timer?
Post by: Silverwind on May 25, 2011, 05:40:12 PM
What happens if you nest an ON KEYDOWN structure within a TIMER event incorporating a negative trigger value? Now this I gotta see...
Title: Re: Is there a maximum timer?
Post by: Gan on May 25, 2011, 06:42:51 PM
Inverted blackhole... :o
Title: Re: Is there a maximum timer?
Post by: Zoo on May 26, 2011, 04:02:53 PM
Turns out there's a maximum for a variable too, so my other idea didn't work either...
Title: Re: Is there a maximum timer?
Post by: Gan on May 26, 2011, 05:52:20 PM
Keep your number as a string. Strings can be up to 255 characters. That's a long number...
"1254689756321159876453159845623789512365942158963215789563215125468975632115987645315984562378951236594215896321578956321512546897563211598764531598456237895123659421589632157895632151254689756321159876453159845623789512365942158963215789563215845623197658431"
Title: Re: Is there a maximum timer?
Post by: GMG Mike on May 26, 2011, 06:27:35 PM
Quote
Keep your number as a string. Strings can be up to 255 characters. That's a long number...
"1254689756321159876453159845623789512365942158963215789563215125468975632115987645315984562378951236594215896321578956321512546897563211598764531598456237895123659421589632157895632151254689756321159876453159845623789512365942158963215789563215845623197658431"

Fail.
Title: Re: Is there a maximum timer?
Post by: Zoo on May 26, 2011, 07:53:42 PM
But if you do a string$ = string$ - 1 wont it take away the character of one?
Title: Re: Is there a maximum timer?
Post by: Gan on May 26, 2011, 10:22:03 PM
You'd have to do some advanced string manipulation to get it to calculate right.

Fail? Seemed more like a clever win to me. ;)