Overview
An array of objects that describe each player on the map.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:
The index of each element in the array relates to the player ID. So the data for player 0 will be in playerData[0] and so on.
Properties
Each (numerically referenced) element in the array contains an object with the following properties:
Property | Type | Description | Game version |
---|---|---|---|
difficulty | Constant | The player's difficulty level (only applicable for AI players). | 3.1 |
colour | String | The colour associated with the player on the map. You can use _() to translate the colour names in to the human player's locale. | 3.1 |
position | Integer | The map position to which the player is assigned. You can find it's x,y co-ordinates by cross-referencing against the startPositions array. | 3.1 |
team | String | The team to which the player is assigned, if fixed alliances are set (see Alliance types). | 3.1 |
isHuman | Boolean | Is the player a human being? | 3.2 |
isAI | Boolean | Is the player an AI script? | 3.2 |
name | String | Player's name | 3.2 |
Examples
To follow
See also
- Object.uAddProperty() – contains an example that shows how to add .isAlly, .isEnemy, .isMe and .primaryTarget properties to player data objects