Other great resources: Official JS API docs, Scripting Forum
addFeature()
- Aubergine
Owned by Aubergine
Add a feature object (tree, log cabin, etc.) to the map...
Syntax
addFeature(name, x, y);
Parameters
Parameter | Type | Mandatory | Notes | Game Version |
---|---|---|---|---|
name | String | The id of the feature to add (most likely from features.txt?) | 3.2 | |
x | Number | The x co-ordinate of the feature | 3.2 | |
y | Number | The y co-ordinate of the feature | 3.2 |
Return values
Value | Type | Notes | Game Version |
---|---|---|---|
<featureObj> | Feature object | If the feature was successfully added, an object describing the feature will be returned. | 3.2 |
null | Null | If the feature did not get added, null is returned. | 3.2 |
<error> | Error | An error will be thrown if some other error occurs, eg. missing or invalid parameters. | 3.2 |
Examples
None at present.
Will cause desync if used in multiplayer games.
Availability 3.2+
Requires:
- Warzone 3.2 or above
Contents
Jump to:
See also
Related articles:
- addDroid() – add a droid to the map
- addStructure() – add a structure to the map
- enumFeature() – get a list of all feature objects
- Features – quick reference to JS API feature-related stuff