Versions Compared

Key

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

setMiniMap(bool)

Turns visible minimap on or off in the GUI.

 

...

Overview

Excerpt

Allows you to turn the human player's minimap (radar) display on or off.

Note that this is automatically handled by rules.js in challenges and multiplayer/skirmish games.

Availability

Warzone 3.1 Beta 1 and above.

Syntax

Code Block
themeEclipse
languagejavascript
linenumberstrue
setMiniMap(show);

Parameters

ParameterTypeMandatoryDescriptionGame version
showBoolean(error)

Should the minimap be shown?

  • true – yes
  • false – no
Defaults to false if not specified.

 

3.1 Beta 1

Return value

ValueTypeDescriptionGame version
undefinedUndefinedThe function always returns undefined3.1 Beta 1

Example

Code Block
themeEclipse
languagejavascript
titleShow or hide minimap based on presence of HQ
linenumberstrue
// don't do this in AI scripts because the setMiniMap() function only applies to the human players minimap
 
function eventStructureBuilt(structure) {
  if (structure.stattype == HQ) setMiniMap(true);
}
function eventDestroyed(gameObj) {
  if (gameObj.type==STRUCTURE && gameObj.stattype==HQ) setMiniMap(false);
}

See also

  • setDesign() – turn the design tool on or off
  • User Interface – quick reference of JS API features relating to user interface