OnTimerGameTime - ScriptObject

From Creation Kit
Jump to: navigation, search

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.

Syntax

Event OnTimerGameTime(int aiTimerID)

Parameters

  • aiTimerID: The ID number of the timer which just expired.

Example

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

Notes

  • 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.

See Also