CallWhilePerSeconds

From GECK
Jump to: navigation, search


A function added by the New Vegas Script Extender version 6.2.8.

Description

Calls UDF every couple of seconds, until the condition UDF returns false.

Every queued call is removed when loading the game (GetGameLoaded), so they may need to be reset during then.

  • NOTE: This means that callbacks created using this function are NOT savebaked, which could potentially cause bugs if a callback was expected to keep running after saving and reloading a save while the callback was running.

flags is a bitmask, whose bits toggle on/off the following features:

PassArgsToTheCalledFunction    = 1 (bit #0)
PassArgsToTheConditionFunction = 2 (bit #1)
DontRunInMenuMode              = 4 (bit #2)
DontRunInGameMode              = 8 (bit #3)      
DontRunWhilePaused             = 16 (bit #4) - xNVSE 6.3.0    

For example, if flags = 0, then none of these features are on. If flags = 0b11 (Binary Notation, or 3 in decimal), then the first two are on.
By default, all flags are off (flags = 0).

DontRunWhilePaused means that the callback will be delayed while main menu / pause menu / console menu MenuModes are open.

Arguments can be passed to the function, just like Call. If an arg is an array, then its lifetime will be extended until the callbacks have stopped.

If PassArgsToTheCalledFunction is on, then the Call-like args will be passed to the udf, and if PassArgsToTheConditionFunction is on, they'll be passed to the condition UDF. Both flags can be on at the same time.

Syntax

[help]
reference.CallWhilePerSeconds timeInterval:float udf:script condition:script flags:int{0} multi:arg(up to 15) 

See Also