Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

Set or clear the mission countdown timer...

 

Syntax

Code Block
themeRDark
languagejavascript
linenumberstrue
setMissionTime(time);

Parameters

ParameterTypeMandatoryNotesGame Version
timeNumber(tick)

Defines the amount of time the player has to complete the mission, causing a mission 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

ValueTypeNotesGame Version
undefinedUndefinedIf the timer is set, nothing is returned.3.1 Beta 1
<error>ErrorInvalid parameters.3.1 Beta 1

Notes

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

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

It's common 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

Code Block
themeRDark
languagejavascript
linenumberstrue
// setting timer of 20 minutes on Warzone 3.2.x
setMissionTime( 20 * 60 ); // 20 x 60 seconds
 
// setting timer of 10 minutes on Warzone 3.1.x
setMissionTime( 20 * 60 * 10 ); // 20 * 60 seconds * 10 1/10ths of a second
 
// clearing the timer on any version of Warzone
setMissionTime(-1);
Div
classnotice box ping

The units of time were changed from 1/10th of a second in Warzone 3.1 to seconds in Warzone 3.2.

Div
classbox
Availability
Status
colourYellow
title3.1 b1+

Requires:

  • Warzone 3.1 Beta 1 or above
  • Time units changed in Warzone 3.2
Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

See also

Related articles:

  • eventMissionTimeout() – triggered if the mission timer reaches 00:00:00
  • (get)missionTimegetMissionTime() – find out how long is left on the timer
  • extraPowerTime() – give the player a power bonus if they finish a mission early

Audio files for countdowns:

  • countdown – missile launch and detonation countdowns
  • missmesg – generic countdown
  • trnsppil – transporter landing countdown