Timers

New Creator
13 Dec 2004, 01:14
Hello. I am currently using timers in a game and have run into a problem : it would be very useful that, at a certain command from the player, the timer be reset. The command timeroff seems to only stop the timer from ticking, not to reset it to zero, and the timer is deactivated and reactivated frequently, so it causes serious problems. If it is impossible to reset a timer, can you think of a way around this problem? Thanks.

I think Im Dead
13 Dec 2004, 07:26
Personally I would suggest perhaps using a status variable or object property to manipulate the timer.

Perhaps give a player a property Timer1=30 and a property Timer1Action=doPoison, now you can simply make a timer of 1-second that repeats itself, and everytime it runs, it checks every object in the game to see if has a property Timers(or whatever you want) is greater than 0, then for each timer subtract 1 from the Timer%number% property value. This is a way of implementing multiple Timers, but within the code, only running one continuous timer.

Code for something like that could easily be made from within QDK's menus if you just re-read what I typed and walk step by step in QDK.

007bond
21 Dec 2004, 20:59
Manipulating them with status variables is currently the only way to do it, but a reset timer command would be useful. Just another thing to go on the list of things to put into the next version of ASL.

paul_one
22 Dec 2004, 09:59
Just reset the numeric that you use in the timer....

IE - a timer DOESN'T hold a value - it only holds a time interval.
The value will be held in a seperate numeric variable.

... If you're infact talking about a timer for (let's say) 10 seconds, 5 seconds through you stop it, then start it again 3 seconds later - and there's still 5 seconds to go instead of 10 seconds... Then that sounds like a programming (and please forgive a misuse of words but this was the closest I could get to the meaning in my head) "quirk"... Where Alex has coded a simple 'pause' in the timer.
A reset would be a good idea if this is true (I don't know if it is or is't true).