Description
Wiki Description
Registers this form/alias/magic effect for a single Form.OnUpdate(). Which also means you don't need to call Form.UnregisterForUpdate() unless you want to cancel the update early. Only the specific form, alias, or magic effect that registered will get the event - it will not be relayed to attached aliases or magic effects.
Documentation Comment
Register for a single OnUpdate event, in afInterval seconds. All scripts attached to this form will get the update events
Of course, this means you don't need to call UnregisterForUpdate()
If you find yourself doing this:
Event OnUpdate()
UnregisterForUpdate()
{Do some stuff}
endEvent
Then you should use RegisterForSingleUpdate instead
Caveats
CK Wiki - Notes
- Aliases and quests will automatically unregister for this event when the quest stops. Active magic effects will automatically unregister when they are removed.
- You should call Form.UnregisterForUpdate() before calling this function a second time prior to the timer elapsing or before calling Form.RegisterForUpdate(...), or strange behavior may result. Testing suggests that calling
RegisterForUpdateafterRegisterForSingleUpdatewill replace the single update's timer interval with the one provided in the call toRegisterForUpdateand will not start a periodic timer. It also suggests that subsequent calls toRegisterForSingleUpdatewithout an interveningUnregisterForUpdatedo not behave as expected, if the timer hasn't elapsed.
Parameters
floatafInterval
CK Wiki Description
Examples
; Register for a single update in 30.0 seconds - does not count menu-mode time.
RegisterForSingleUpdate(30.0)Auto-Generated Example
float myFloat__afInterval
myForm__toCallFunctionOn.RegisterForSingleUpdate(myFloat__afInterval)