setReinforcementTime()

(info) Other great resources: Official JS API docs, Scripting Forum

setReinforcementTime()

Set or clear reinforcement timer...

 

Syntax

setReinforcementTime(time);

Parameters

Parameter

Type

Mandatory

Notes

Game Version

time

Number

Defines the amount of time before reinforcements arrive, causing a reinforcement timer to be shown to the user.

In Warzone 3.1, the time was specified in 1/10ths of a second (so 1 = 100ms).

In Warzone 3.2 and above, the time is specified in seconds (so 1 = 1000ms).

Specify a value of -1 to disable the timer.

3.1 Beta 1

Updated in 3.2

Return value

Value

Type

Notes

Game Version

undefined

Undefined

If the timer is set, nothing is returned.

3.1 Beta 1

<error>

Error

Invalid parameters.

3.1 Beta 1

Notes

When the timer is activated, by providing a positive value for the time parameter, a reinforcement timer will be shown in the top-left corner of the screen.

When the reinforcement timer reaches 0, eventReinforcementsArrived() is triggered and the game will continue unless instructed otherwise within your event handler.

It may sometimes be desirable to play audio prompts (using playSound() function) to let the user know how long is left on the timer – a list of audio files can be found in the sidebar to the right... →

Examples

// setting timer of 20 minutes on Warzone 3.2.x setReinforcementTime( 20 * 60 ); // 20 x 60 seconds   // setting timer of 20 minutes on Warzone 3.1.x setReinforcementTime( 20 * 60 * 10 ); // 20 * 60 seconds * 10 1/10ths of a second   // clearing the timer on any version of Warzone setReinforcementTime(-1);