AuxTimerStart

From GECK
Jump to: navigation, search


A function added by the ShowOff NVSE Plugin version 1.55.

Description

Creates and starts Auxiliary Timer on an owning form to start counting down from timeToCountdown with the specified flags. If the timer exists already, will instead restart it, and it will be unpaused if it was paused.

If no owner form for the AuxTimer is specified, PlayerRef will be used.

Once the timer for an AuxTimer runs out, it will will trigger the OnAuxTimerStop event. Aftewards, the AuxTimer will be deleted automatically unless the Auto Restarts flag is on. In that case, the timer will restart, triggering the OnAuxTimerStart event.

AuxTimer Flags:

Bit# 	 Value 	 Description
0 	 1 	 Run In MenuMode
1 	 2 	 Run In GameMode
2 	 4 	 Count In Seconds (if off, counts down in frames)
3 	 8 	 Auto-Remove On Load And MainMenu (has no effect on permanent AuxTimers, only temporary ones)
4 	 16 	 Auto Restarts
5 	 32 	 Is Paused
6 	 64 	 Not Affected By TimeMult In MenuMode (only used for seconds-based timers)
7 	 128 	 Don't Run When Paused (won't run in main menu, pause menu, console menu)
8 	 256 	 Run OnTimerUpdate Event (see SetOnAuxTimerUpdateHandler) - v1.65

The default-enabled flags are Run In MenuMode, Run In GameMode, and Count In Seconds.

If the AuxTimer's owner form becomes invalid at any time while it is counting down, the AuxTimer will be deleted. This will NOT fire the OnAuxTimerStop event.

Syntax

[help]
(success:bool) ownerRefr.AuxTimerStart timerName:string timeToCountdown:float{-1.0} flags:int{1+2+4} owner:baseForm

Example

RaulRef.AuxTimerStart "someTimerName" 5

Will create a private-permanent AuxTimer belonging to RaulRef that will count down for 5 seconds before stopping. It will count down in both GameMode and MenuMode.

AuxTimerStart "*_someTimerName" 3 2  ; 2 means only the "Run In GameMode" flag is on.

Will create a temporary-public AuxTimer belonging (implicitly) to PlayerRef that will count down for 3 frames before stopping. It will count down only in GameMode.

See Also