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

Structure object

Describes a structure (something a truck can build) on the map.

 

Properties

Inherits all the properties of a Game objects (id, x, y, z, player, selected, name, health, armour, thermal, born, etc.) then adds/overrides the properties listed below.
PropertyTypeDescriptionGame version
typeConstantSTRUCTURE3.1
statusConstant

Describes construction status of the structure:

3.1
stattypeConstant

What sort of structure is it?

3.1
modules

Number,
Null 

The number of modules built on the structure, or null if not applicable.

Warzone 3.1 Beta 2 and earlier:

The property would not exist for structures that couldn't have modules.

3.1 beta 2

Improved in 3.1 beta 3

groupNumberThe group that the structure is in, or null if it's not in a group.3.2
costNumberWhat did the structure cost to build?3.2
rangeNumber,
Null 

The maximum range of the structures' weapon, or null if not applicable.

(question) It's not clear whether range will be present for sensors.

3.2
isSensorBoolean

Does this structure have a sensor on it?

  • true - yes
  • false - no
3.2
isCBBoolean

Does this structure have a counter battery (CB) turret on it?

  • true - yes
  • false - no
3.2
isRadarDetectorBoolean

Does this structure have a radar detector on it?

  • true - yes
  • false - no
3.2
canHitAirBoolean

Can this structure attack aircraft (VTOLs / transports)?

  • true - yes
  • false - no
3.2
canHitGroundBoolean

Can this structure attack ground units and other structures?

  • true - yes
  • false - no
3.2
hasIndirectBoolean

Does this structure have an indirect fire weapon (such as artillery or archangel missiles)?

  • true - yes
  • false - no
3.2
weaponsArray of Weapon Status

An array containing basic information about the weapons attached to the droid. Each object in the array contains two properties:

3.2
Availability 3.1 B1+

Introduced in:

  • Warzone 3.1 Beta 1 and above
  • Several updates to Base objects since then
  • Lots of new stuff planned for 3.2
Contents

Jump to:

Where to get them?

Lots of API features return structure objects, including...

Functions: enumArea(), enumRange(), enumStruct(), enumStructOffWorld(), label(), objFromId()

Events: eventAttacked(), eventAttackedUnthrottled(), eventDestroyed(), eventDroidBuilt(), eventObjectSeen(), eventObjectTransfer(), eventResearched(), eventStructureBuilt(), eventStructureReady()

Other: If specified when using queue() or setTimer(), the resultant function calls will be passed a structure object. If you bind() to a structure object, the function called when it is destroyed will be passed the structure object.

Working with Structures

Create them:

Remove them:

List them:

Tell them what to do:

Find out what's happening to them:

Player Initialisation:

See also

Related articles: