Difference between revisions of "GetSecondsPassed"
See also
imported>Quetzilla |
imported>ZuTheSkunk (See also) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
(seconds:float) GetSecondsPassed | (seconds:float) GetSecondsPassed | ||
Returns the number of seconds passed since the last | Returns the number of seconds passed since the last frame in which the current script was processed (in float). Extremely useful for running a timer within a script. Each script has its own counter for GetSecondsPassed. All calls within the same frame and script will return the same value. | ||
Line 27: | Line 27: | ||
begin gamemode | begin gamemode | ||
set timer1 to getsecondspassed ;This returns the time passed since the last frame | set timer1 to getsecondspassed ;This returns the time passed since the last frame | ||
set timer2 to getsecondspassed ;This returns | set timer2 to getsecondspassed ;This returns the same value | ||
end | end | ||
Line 33: | Line 33: | ||
== Notes == | == Notes == | ||
* GetSecondsPassed is unreliable in a ScriptEffect during sleep/wait/fast travel. Use [[ScriptEffectElapsedSeconds]] instead. | * GetSecondsPassed is unreliable in a ScriptEffect during sleep/wait/fast travel. Use [[ScriptEffectElapsedSeconds]] instead. | ||
== See also == | |||
* [[Scripting Tutorial: Creating a Simple Timer]] | |||
[[Category: Functions]] | [[Category: Functions]] | ||
Line 39: | Line 43: | ||
[[Category: Time Functions]] | [[Category: Time Functions]] | ||
[[Category: Time Functions (CS 1.0)]] | [[Category: Time Functions (CS 1.0)]] | ||
<!-- Begin Search Terms | |||
Get | |||
Seconds | |||
Passed | |||
End Search Terms --> |