Counting up on a timer
Posted: Thu Apr 23, 2015 8:57 pm
Here's a neat little trick to get timers to count upwards from zero instead of down to zero:
SetTimerRate("timername", -1)
I don't know if you will be able to start it if the timer is currently set to exactly zero, but I can confirm it works if you start it at 1 second, and I presume it would work if you started it to some small nonzero fraction, like
SetTimerValue("timername", 0.01)
I don't know if this is news to people, but I haven't found any posts about it, and I imagine it can be useful for survival/wave game modes and race modes.
SetTimerRate("timername", -1)
I don't know if you will be able to start it if the timer is currently set to exactly zero, but I can confirm it works if you start it at 1 second, and I presume it would work if you started it to some small nonzero fraction, like
SetTimerValue("timername", 0.01)
I don't know if this is news to people, but I haven't found any posts about it, and I imagine it can be useful for survival/wave game modes and race modes.