HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Timer Bug?

03-25-2007, 10:57 PM#1
ixmike88
Whenever I create a timer, then use random pause/resumes as it counts down it would sometimes reset itself to a random number when nearing the end of the expiration. Is this a common bug or my map?
03-26-2007, 03:00 AM#2
Zyrixion
umm....can you either define "random pause/resumes" or post your code up here please? It would make it a world easier to help you fix your problem. =)
03-26-2007, 04:24 AM#3
ixmike88
It's a sports map and when the play ends the clock stops, and when the new play begins it is resumed. It's spread all over the map to be posted.
03-26-2007, 10:41 AM#4
blu_da_noob
You're being far too vague. 'It will randomly reset to random times after random pausing and restarting' tells us almost nothing.
03-26-2007, 12:20 PM#5
Toink
Just post the darn map so we can see what happens!
03-26-2007, 07:48 PM#6
ixmike88
It's not implemented in my map, I removed it because of the bugs.

It's a football map, and with specific events the timer will pause (out of bounds, etc), then resume on the hike of the new play. The timer is set to the desired quarter time, then when expired a new timer is started. At the end of the 4th quarter (last), when the timer should expire it will reset it's value to a random number instead of staying at zero.
03-27-2007, 03:10 AM#7
Zyrixion
Maybe you set it to a recurring timer instead of a one-time?

Anyways, I may have an answer for you. If you are doing this in GUI (which you must be, or you would have posted the code, most likely), then there is no real good resume timer function, only pause, which will cause issues.

What you need to do-
*Make an integer variable called TimeLeft (or something, it doesn't matter)
*Make a timer variable called Timer (again, doesn't matter)
*When you want to pause the timer, set the variable TimeLeft to the time
remaining in the timer Timer (the variable).
*Hide the timer window for variable Timer.
*When you want play to resume, start the timer Timer (the variable) set
for the integer value TimeLeft in seconds.

Assuming pausing it isn't working for you, this should be fine, so long as the hidden timer doesn't run out on you (so if it does matter for whatever, maybe disable the trigger that relies on the expiring timer after you save the time left in the variable and hide the timer window, then re-enable it after you start the new timer). Of course, this is just a giant GUI workaround for something that could probably be relatively easily solved in Jass. And if you ARE working in Jass, then this might apply anyways. [disclaimer]This is a concept that SHOULD work, being I could probably make a trigger for it to work, but this is something you'd have to build into your map. Thus, this working concept requires correct implementation on your part, and I do assume you can do this, so good luck to ya on your map, and you should learn Jass if you haven't already, it's a great tool.[/disclaimer]