Timer
Timer variables are essentially numbers that represent a high-resolution quantity of time. They can be set to count upward or downward, and the speed at which they count can be changed as well. They can have their current values set to any integer quantity of seconds by script. Timers don't have a networking priority.
If a timer variable is set to count down, then its rate will switch to stopped when it reaches zero. If a timer variable has a non-zero initial value and it is set to count up, then its rate will switch to stopped when it reaches that initial value. If a timer variable has a zero initial value and it is set to count up, then it will count up indefinitely.
Timer values are high-resolution. If two timers are compared to each other, then they will compare properly even if the differences in their values are less than one second.
There are eight global timer variables, numbered from 0 to 7, which can
be accessed as global.timer[n]
.
Member conditions
- is_zero
Checks whether the timer's value is zero.
Member actions
- reset
Reset a timer to its initial value.
- set_rate
Set the rate and direction in which the timer advances.