Other great resources: Official JS API docs, Scripting Forum
removeLabel()
- Aubergine
Owned by Aubergine
Remove a label from the game...
Syntax
removeLabel(label);
Parameters
Parameter | Type | Mandatory | Notes | Warzone Version |
---|---|---|---|---|
label | String | The label to remove. | 3.2 |
Return value
Value | Type | Notes | Warzone Version |
---|---|---|---|
<number> | Number | The number of labels that were removed:
If <number> is greater than one, it means that somehow the same label was defined multiple times (most likely in labels.ini), and all <number> occurrences were removed. | 3.2 |
<error> | Error | An error occurred, most likely invalid parameters. | 3.2 |
Notes
When the label is removed, what happens to the object it was pointing to? It depends on the type of object:
- Game objects – the object will be retained
- Location objects – if the object doesn't have any other labels associated with it, it will be deleted
Remember that labels are shared by all scripts, so if you delete a label that deletes it for all other scripts as well.
Example
if ( removeLabel("foo") ) { // label(s) removed (+ve numbers are truthy) } else { // label not found (0 is falsey) }
Availability 3.2+
Requires:
- Warzone 3.2 or above
Contents
Jump to:
Scripting: Labels
Related Objects:
Create them:
- addLabel() – label an object
List them:
- getLabel() – get first label associated with a specific object
- enumLabels() – get a list of all labels
Retrieve their objects:
- getObject() – get object associated with a label
- label() – use this instead on WZ 3.1
Monitor them:
- eventArea<Label>() – triggered when a droid enters a labelled Area object
- resetArea() – reset or filter an area trigger
Remove them:
- removeLabel() – remove a label