• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Help with timers

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2010
Messages
950
I have a timer to allow a set amount of time for something to happen. If it happens i pause the timer. Once its all done i need to destroy the timer and have it not continue but there is nothing i see to do that.

i used "Custom script: call DestroyTimer(udg_Variable)"

but that kills the variable and can no longer start a 1 shot timer again..

But i need to use it again so if i just leave it paused for a long time will that matter? If i started another 1 shot timer with that same Variable is that fine or what..
(if i dont destroy or pause it after the thing is done then it continues to run after the mission is complete and bugs it when the timer expires..even if i destroy the timer window)

I guess perma pausing it works fine enough...
 
Last edited by a moderator:
Level 17
Joined
Apr 27, 2008
Messages
2,455
I guess, you're a GUI user.

All events are registred by value, not by reference.
It means, when you register the event with the variable, it takes its value, but later if you change the variable value, the event won't be affected, worse you will lose the possibility to handle the assiocated "handle", since you have no more reference to it (short story).

That's why you can't destroy the timer, pause it is ok.
However there is a bug with timers, if you pause a periodic timer, when you will resume it, it will continue from where it was, but it won't be periodic anymore.
However, you can just restart it.
 
Status
Not open for further replies.
Top