Versions Compared

Key

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

Overview

Excerpt

An array of Player objects

...

describing each human/AI player slot on the current map regardless of whether those slots have been assigned players for the current game.

 

Overview

By inspecting the player data stored in this array, you can determine some useful information about your opponents/allies.

The data is based on either the settings in a campaign file, or the game settings from a skirmish or multiplayer game:

Image Modified

The index of each element is the player's ID within the game (the value of me for that player). Note that this is not necessarily the same as the player's starting location - some starting positions might not have been assigned a player.

Properties

Each (numerically referenced) element in the array contains a Player object.

Examples

...

To follow

See also

Code Block
themeRDark
languagejavascript
titleIterate through playerData array
linenumberstrue
playerData.forEach(function(data, player) {
	// player = player id
    // data = Player object containing info about that player
});

Div
classbox

Availability

Available since:

  • Warzone 3.1 Beta 1
  • See Player object for details of subsequent updates.
Div
classbox

See also

Related API features:

You might also like:

...

  • how to add

...

  • additional properties to Player objects
  • Victory Conditions – how to determine if a player is dead or alive