Difference between revisions of "OnUpdateGameTime - Form"
Jump to navigation
Jump to search
imported>Rhavlovick m (1 revision: Clobber re-import by Henning) |
imported>Catwheezle (Added "see also" section items.) |
||
Line 40: | Line 40: | ||
*[[RegisterForUpdateGameTime - Form]] | *[[RegisterForUpdateGameTime - Form]] | ||
*[[UnregisterForUpdateGameTime - Form]] | *[[UnregisterForUpdateGameTime - Form]] | ||
*[[Wait - Utility]] |
Revision as of 23:10, 14 February 2012
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.