The comparetimer command is used to directly compare two values, but acts as if the second value is a time (in frames).
"if(comparetimer,first value, method of comparison, time)"
Argument |
Function |
first value |
The value that is being compared to the second value. |
method of comparison |
The method in which the two values are being compared (>, <, =, >=, <=). |
time |
The time being compared against. (30 = 1 second) |
And example of the comparetimer command used in a script is as follows...
The following script checks if the timer variable is above 300 frames (10 seconds), and if so, resets the variable and shakes the screen.
if(compare,var(timer),>,300)
{
then(screenshake,8)
then(changevar,timer,=,0)
}
if(always)
{
then(changevar,timer,+,1)
}
|
|