Other great resources: Official JS API docs, Scripting Forum
Feature object
- Aubergine
Properties
Property | Type | Description | Game version |
---|---|---|---|
type | Constant | FEATURE | 3.1 Beta 1 |
player | Number | 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 |
damageable | Boolean | Can this feature be destroyed?
| |
group | Number | The 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:
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.