Other great resources: Official JS API docs, Scripting Forum

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 27 Current »

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:

(warning) Note: PLAYER_DATA & RESEARCH_DATA constants were added in Warzone 3.1 Beta 11.

Object documentation.type propertyNotesAvailability
Area objectAREAAn object defining top-left and bottom-right co-ordinates for an area of the map.3.1 B1+

Droid object

DROID

Describes a droid (unit) on the map or being produced in a factory. Inherits Game object fields.

3.1 B1+

Feature object

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 ObjectGROUPInformation about a group defined in labels.ini.3.2+

Structure object

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 objectPLAYER_DATA

Contains information about a specific player.

3.1 B1+
Position objectPOSITIONContains the x,y co-ordinate of a specific location on the map.3.1 B1+
Research objectRESEARCH_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:

 

  • No labels