Other great resources: Official JS API docs, Scripting Forum
eventArea<Label>()
- Aubergine
Syntax
// see important notes about event name and usage below! function eventArea<Label>(droid) { // do stuff }
Parameters & References
Parameter/ Reference | Type | Mandatory | Description | Game version |
---|---|---|---|---|
<Label> | String | The name of the label associated with the Area object is part of the event name. For example, if there is an Area object with label "Foo", the event will be called "eventAreaFoo()". | 3.2 | |
droid | The droid that entered the area. | 3.2 |
Return value
Warzone does not process the event handler's return value.
Notes
The event only triggers once when a droid first enters it. If you want the event to trigger again in the future, you'll need to reset the area trigger using the resetArea() function (see example below).
You can define labelled Area objects at runtime and use them to trigger this event. For more information and example code, see: addLabel().
Example
// assuming we've labelled an area Foo function eventAreaFoo(droid) { // let's reset the area so it triggers again in future resetArea("Foo"); }
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