Other great resources: Official JS API docs, Scripting Forum
Game objects
- Aubergine
Properties
Property | Type | Description | Game Version |
---|---|---|---|
type | Constant | DROID, STRUCTURE or FEATURE (as applicable) Additional properties are added depending on the type. | 3.1 |
id | Number | Unique internal ID for the object. You can get a game object from it's id using the objFromId() function. | 3.1 |
x | Number | The current x co-ordinate of the object on the map | 3.1 |
y | Number | The current y co-ordinate of the object on the map | 3.1 |
z | Number | The current z co-ordinate (elevation) of the object on the map | 3.1 |
player | Number | The player that the object belongs to. For more information see: Note also that "features" are attributed to several players depending on type of feature, for more information see Features. | 3.1 |
selected | Boolean | If the player who owns the object has selected it, this will be true otherwise it will be false . | 3.1 |
name | String | The name of the object. Note that objects built using the design tool can be given custom names. This is also true for droids built using the buildDroid() function. | 3.1 |
health | Number | The health of the object, as a percentage where 100 means full health. | 3.1 beta 2 |
armour | Number | The amount of kinetic weapon armour that the object has. | 3.1 beta 2 |
thermal | Number | The amount of thermal weapon armour that the object has. | 3.1 beta 2 |
born | Number | Indicates the gameTime that the object was first created. A value of 2 or less indicates objects that were pre-placed on the map (like starting trucks) by the map designer. | 3.2 |
Game object properties are read-only and their values are not automatically updated.
Updates to game objects (via Functions) do not take effect until they've been synchronised with all players. As such, game objects will not immediately reflect changes in game state.
Do not store objects as global variables, they will not be persisted in saved games.
Availability
The base object was introduced in:
- Warzone 3.1 early alphas
- There were several new properties added in Warzone 3.1 beta 2
- More properties are planned in Warzone 3.2
Where to get them?
You won't actually see "game" or "base" objects in your script; instead you'll see Droid objects, Structure objects or Feature objects which inherit the properties shown to the left and then add a number of additional properties of their own.
The .type property will be overridden as applicable to the type of game object.
If you know its ID, you can get any game object using the objFromId() function.
See also
Quick reference guides:
Modding guides: