OnUpdateGameTime - Form

From the CreationKit Wiki
Revision as of 15:26, 18 October 2011 by imported>Rhavlovick (1 revision: Clobber re-import by Henning)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Member of: ActiveMagicEffect Script, Alias Script, and Form Script

Event called periodically in game time if the active magic effect/alias/form is registered for update events. This event will not be sent if the game is in menu mode.

Syntax

Event OnUpdateGameTime()

Parameters

None

Example

Function SomeFunction()                       
  RegisterForUpdateGameTime(0.5) ; Before we can use onUpdateGameTime() we must register.
endFunction

Event OnUpdateGameTime() ; because of how we registered, this event occurs every 30 minutes of game time		
  if myQuest.getStage() == 10
    UnregisterForUpdateGameTime() ; when we're done with it, make sure to unregister
    Debug.Trace("Got what we needed, so stop polling!")
  endIf
endEvent

Notes

  • Aliases and quests will automatically unregister for this event when the quest stops. Active magic effects will automatically unregister when they are removed.
  • This event is not relayed to any aliases or magic effects attached to the form.
  • OnUpdateGameTime may come in much later then you expect if the player is sleeping, waiting, fast traveling, or serving jail time. The event will only be sent once, after the sleep/wait/travel/serve period is over, so you should be prepared to handle hours passing between updates.

See Also