Background for Starfield
Member of the ScriptObject script
eventOnTimer(intaiTimerID)

[DEV SERVER] Loading description...


Caveats

CK Wiki - 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.

  • The time will be affected by the global time modifier.

    • For example, if global time is slowed because the player is in VATS selection or on Jet, timer events will be slowed accordingly.
    • CAUTION: During VATS playback, parts of the game are slowed at different rates. Timer events do not accommodate this, and will run at the player's modified speed, even if other elements of the game (Mysterious Stranger, enemies, world animations) are moving at different modified speeds. This typically means that you will get the event sooner than you expected. It's not an issue for most scripts.
      • However, if you do need to detect and react to OnTimer events differently during VATS playback, you can use Game.IsVATSPlaybackActive() to detect this state.

Parameters

intaiTimerID

CK Wiki Description

The ID number of the timer which just expired.


Examples

int myCoolTimerID = 10 ; Give our timer an ID we can remember

Function SomeFunction()                
  StartTimer(5, myCoolTimerID) ; Create the timer with a 5 second duration
EndFunction
    
Event OnTimer(int aiTimerID)        
  If aiTimerID == myCoolTimerID ; The five second 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 StartTimer again...
  EndIf
EndEvent

Auto-Generated Example

Scriptname MyCoolScript extends ScriptObject

event OnTimer(int aiTimerID)
    Debug.trace("Event received - OnTimer: aiTimerID = " + aiTimerID)
endEvent

Related Pages


Additional References

View this event’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.