Other great resources: Official JS API docs, Scripting Forum
Objects
- Aubergine
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 |
---|---|---|---|
Area object | AREA | An object defining top-left and bottom-right co-ordinates for an area of the map. | 3.1 B1+ |
DROID | Describes a droid (unit) on the map or being produced in a factory. Inherits Game object fields. | 3.1 B1+ | |
FEATURE | A map feature such as a tree, log cabin, oil barrel, artefact or oil derrick, etc. Inherits Game object fields. | 3.1 B1+ | |
Group Object | GROUP | Information about a group defined in labels.ini. | 3.2+ |
STRUCTURE | 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+ | |
Player object | PLAYER_DATA | Contains information about a specific player. | 3.1 B1+ |
Position object | POSITION | Contains the x,y co-ordinate of a specific location on the map. | 3.1 B1+ |
Research object | RESEARCH_DATA | Contains information about a specific technology. | 3.1 B1+ |
Template Object | Contains information about a template (see Components & Templates) | 3.2+ | |
Weapon Object | 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()
Quick Links
Game objects (a.k.a "base objects"):
Data objects:
- Group Object (GROUP)
- Player object (PLAYER_DATA)
- Research object (RESEARCH_DATA)
- Template Object ( ? )
- Weapon Object ( ? )
Location objects: