Difference between revisions of "GetSecondsPassed"
Jump to navigation
Jump to search
Create using function template
imported>Haama (As per discussion, note removed) |
imported>SnakeChomp (Create using function template) |
||
Line 1: | Line 1: | ||
{{Function | |||
|origin = GECK1 | |||
|name = GetSecondsPassed | |||
|summary = Returns the number of real life seconds that have passed since this function was last called by the calling script. | |||
|returnVal = seconds | |||
|returnType = float | |||
|example = <pre>float timer | |||
begin gamemode | |||
if timer < 5 | |||
set timer to timer + GetSecondsPassed | |||
else | |||
;5 seconds have passed, do something special | |||
set timer to 0 | |||
endif | |||
end</pre> | |||
}} | |||
==Notes== | |||
*[[SetGlobalTimeMultiplier]] will affect the return value of this function in the same way it affects the speed of the game. | |||
*Each script has it's own independent tracking of when GetSecondsPassed was last called. | |||
*Calling this function multiple times in th same script in the same frame will return the same values for each call. | |||
*This function is unreliable in a ScriptEffect during sleep/wait/fast travel. Use [[ScriptEffectElapsedSeconds]] instead. | |||
[[Category:Functions]] | [[Category:Functions]] | ||
[[Category:Time Functions]] | [[Category:Time Functions]] |