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

gameOverMessage()

Overview

End the game in either victory or defeat.

(info) The game rules (rules.js) determine when a game is over and call this function accordingly.

Availability

Warzone 3.1 Beta 1 and above.

Syntax

var returnValue = gameOverMessage(won);

Parameters

ParameterTypeMandatoryDescriptionGame version
wonBoolean(tick)

Has the player won the game?

  • true – game won: "Mission Successful"
  • false – game lost: "Mission Failed"
3.1 Beta 1

Return values

ValueTypeDescriptionGame version
undefinedUndefinedThe function does not return a value.3.1 Beta 1

Example

See the checkEndConditions function in rules.js.

See also

  • end.ogg – the video played when gameOverMessage(false) is called
  • Missions / Campaign – quick reference to JS API functions relating to missions and campaigns.
  • victory.ogg – the video played when gameOverMessage(true) is called