(info) Other great resources: Official JS API docs, Scripting Forum

Game objects

The common properties for all objects that appear on the map such as droids, features and structures.

 

Properties

PropertyTypeDescriptionGame Version
typeConstant

DROID, STRUCTURE or FEATURE (as applicable)

Additional properties are added depending on the type.
See Droid object, Structure object and Feature object for more information.

3.1
idNumberUnique internal ID for the object. You can get a game object from it's id using the objFromId() function.3.1
xNumberThe current x co-ordinate of the object on the map3.1
yNumberThe current y co-ordinate of the object on the map3.1
zNumberThe current z co-ordinate (elevation) of the object on the map3.1
playerNumber

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
selectedBooleanIf the player who owns the object has selected it, this will be true otherwise it will be false.3.1
nameString

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
healthNumberThe health of the object, as a percentage where 100 means full health.3.1 beta 2
armourNumberThe amount of kinetic weapon armour that the object has.3.1 beta 2
thermalNumberThe amount of thermal weapon armour that the object has.3.1 beta 2
bornNumber

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
The official JS API calls this a "Base Object" but I've renamed it to "Game Object" to disambiguate it from base structures.

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:

Â