OnTimerGameTime - ScriptObject
Member of: ScriptObject Script
Event called once a game-time timer started on a script expires. This event will not be sent if the game is in menu mode.
SyntaxEdit
Event OnTimerGameTime(int aiTimerID)
ParametersEdit
- aiTimerID: The ID number of the timer which just expired.
ExampleEdit
int myCoolTimerID = 10 ; Give our timer an ID we can remember
Function SomeFunction()
StartTimerGameTime(0.5, myCoolTimerID) ; Create the timer with a 30 minute game-time duration
EndFunction
Event OnTimerGameTime(int aiTimerID)
If aiTimerID == myCoolTimerID ; The 30 minute timer we started just expired
Debug.Trace("Timer ended! Do some cool stuff now...")
; If we wanted to have the timer start over, we could now do StartTimerGameTime again...
EndIf
EndEvent
NotesEdit
- Aliases and quests will automatically cancel all timers when the quest stops. Active magic effects will automatically cancel all timers when they are removed.
- This event is not relayed to any other script on the same form, or aliases or magic effects on that form.
- OnTimerGameTime may come in much later then you expect if the player is sleeping, waiting, fast traveling, or serving jail time. The event will be sent after the sleep/wait/travel/serve period is over, so you should be prepared to handle a much longer game-time tick then you might expect.