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

Feature object

Feature objects describe inanimate game objects such as oil barrels and resources, artefacts, log cabins and skyscrapers, trees, etc.

 

Properties

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

Most features on the map are owned by player 99.

Oil resources, oil barrels and artefacts are owned by player 12.

3.1 Beta 1
damageableBoolean

Can this feature be destroyed?

  • true – yes, you can destroy it
  • false – it's indestructible
(question)
groupNumberThe group the feature is in, or null if no group.3.2
stattype

Constant

<not defined>

A .stattype property is added for certain special features:

  • ARTIFACT – an artefact that can be picked up
  • OIL_DRUM – an oil barrel that can be picked up
  • OIL_RESOURCE – an oil resource that you can build a derrick on

All other features don't have the stattype property.

3.2

Notes

When an oil derrick is built on an oil resource, the oil resource feature is removed from the map. If the derrick is later destroyed, a new oil resource feature will be added to the map. Positions of oil resources can be found in the derrickPositions[] array.

When artefacts and oil drums are picked up, their associated feature object is removed from the map. It's not currently possible for non-human players to pick up such items.

Most features can be destroyed (see "damageable" property). The only features that cannot be destroyed (by attacking them) are: Boulders, oil resources, artefacts, oil barrels – the last 3 can be removed from the map by building a derrick (on an oil resource) or collecting them (in case of artefacts and barrels). Oil resources will automatically re-appear, and burn for a short while, if the derrick is destroyed.

When collectible features are picked up, eventDestroyed() is often called.

Availability 3.1 B1+

Feature objects were introduced in:

  • Warzone 3.1 Beta 1 and above
  • Several updates to Base objects since then
  • New properties planned for 3.2
Contents

Jump to:

Where to get them?

Several API features return feature objects, including...

Functions: enumArea(), enumFeature(), enumRange(), label(), objFromId(),

Events: eventDestroyed(), eventPickup(), eventObjectSeen()

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

See also

You might also like:

  • Features – quick reference to associated API features