Other great resources: Official JS API docs, Scripting Forum

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Overview

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

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

Show or hide minimap based on presence of HQ
// 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
  • No labels