Other great resources: Official JS API docs, Scripting Forum
Objects
The JS API has several object types that you'll encounter regularly when developing scripts...
JS API Objects
Each object has a number of properties that defines its specific attributes. For more information, see the links below:
Note: PLAYER_DATA & RESEARCH_DATA constants were added in Warzone 3.1 Beta 11.
Object documentation | .type property | Notes | Availability |
|---|---|---|---|
An object defining top-left and bottom-right co-ordinates for an area of the map. | 3.1 b1+ | ||
Describes a droid (unit) on the map or being produced in a factory. Inherits Game object fields. | 3.1 b1+ | ||
A map feature such as a tree, log cabin, oil barrel, artefact or oil derrick, etc. Inherits Game object fields. | 3.1 b1+ | ||
Information about a group defined in labels.ini. | 3.2+ | ||
A building or defence structure on the map that's owned by a human, AI or scavenger player. Inherits Game object fields. | 3.1 b1+ | ||
Contains information about a specific player. | 3.1 b1+ | ||
Contains the x,y co-ordinate of a specific location on the map. | 3.1 b1+ | ||
Contains information about a specific technology. | 3.1 b1+ | ||
| Contains information about a template (see Components & Templates) | 3.2+ | |
| Contains information about a weapon (see getWeaponInfo()) | 3.2+ |
Creating Custom Objects
Javascript makes it easy to create custom objects and arrays – here's some useful links if you're new to Javascript:
Working with objects – introduction to Javascript objects
Object Oriented Javascript – introduction to OOP in Javascript (see also Inheritance Model in Util API)
Arrays – introduction to Javascript arrays and they splendid features such as: forEach(), some() and filter()