Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
Feature objects describe inanimate game objects such as oil barrels and resources, artefacts, log cabins and skyscrapers, trees, etc. |
Properties
Info |
---|
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. |
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.
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
Availability
Feature objects were introduced in:
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|
Div | ||
---|---|---|
| ||
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. |
Div | ||
---|---|---|
| ||
See alsoYou might also like:
|