Specifies useful static information about a specific player in the game. |
Property | Type | Description | Game version |
---|---|---|---|
difficulty | Constant | The player's difficulty level, which can be set for AI players on the game set-up screen: Human players currently default to MEDIUM difficulty. | 3.1 |
colour | Integer | The numeric Colour ID of the colour that's used on the player's units and buildings. They are also shown as this colour on the mini map. Refer to "Colour ID" in the Colour Palette to determine what the actual colour is. | 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. Note: This is not the same as the player ID. You can determine the player ID associated with your script using the "me" global. | 3.1 |
team | Integer | The team to which the player is assigned, represented as a number (0 = A, 1 = B, etc). The team is always specified, regardless of alliancesType mode:
Note: Maps can specify defaults for teams, see <mapname>.ini for details. | 3.1 |
type | Constant | PLAYER_DATA | 3.1 Beta 11 |
isHuman | Boolean | Is the player a human being?
| 3.2 |
isAI | Boolean | Is the player an AI bot?
| 3.2 |
name | String | Player's name | 3.2 |
The Scavenger Faction does not have an associated player object.
If they did, it would look something like this:
The scavenger player ID is defined by scavengerPlayer. You can determine if scavengers are enabled via the scavengers global – note that this doesn't guarantee that the map maker added Scavengers to their map; if they didn't then regardless of scavengers being enabled there won't be any scavengers.
The player objects are based on the players in the current game. Depending on the type of the game, the source of the information is different:
The playerData[] array and the player objects it contains are static during a game – the information is created prior to eventGameInit() being triggered. In campaign games, it is assumed (but not verified) that the information will be updated during eventStartLevel() as there could be different factions in a level.
Empty player slots are still given Player objects, so don't assume a player object denotes a filled player slot. |
AvailabilityThis object is available for:
|
Where to get them?Player data objects are only found in one place:
|
See alsoRelated documentation:
You might also like:
|