Other great resources: Official JS API docs, Scripting Forum
getMissionTime()
- Aubergine
Owned by Aubergine
Get the current value of the mission timer...
Syntax
var time = getMissionTime();
Parameters
No parameters.
Return value
Value | Type | Notes | Game Version |
---|---|---|---|
<time> | Number | The amount of mission time remaining, in seconds. | 3.2 |
-1 | Number | The timer is not active. | 3.2 |
<error> | Error | Invalid parameters. | 3.2 |
Notes
When the mission timer reaches 0, eventMissionTimeout() is triggered and the game will continue unless instructed otherwise within the 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
var timeRemaining = getMissionTime(); if (timeRemaining == -1) { // timer is not active } else if (timeRemaining == 0) { // mission timed out, eventMissionTimeout() will have been triggered } else { // there is timeRemaining seconds left on the timer }
Availability 3.2+
Requires:
- Warzone 3.2 or above
Contents
Jump to:
See also
Related articles:
- eventMissionTimeout() – triggered if the mission timer reaches 00:00:00
- setMissionTime() – set or clear the mission time
- extraPowerTime() – give the player a power bonus if they finish a mission early
Audio files for countdowns: