Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
An event that's triggered when a droid first enters a labelled Area object... |
Syntax
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
// see important notes about event name and usage below! function eventArea<LABEL>eventArea<Label>(droid) { // do stuff } |
Parameters & References
Parameter/ Reference | Type | Mandatory | Description | Game version |
---|---|---|---|---|
<LABEL><Label> | String | The name of the label , which is always in uppercase, is appended to associated with the Area object is part of the event name. For clarification, there is no "eventArea()" event, only variations of that event name that include a label. For example, if there is an Area object with label "FOOFoo", the event when a droid first enters that area will be called "eventAreaFOOeventAreaFoo()". | 3.2 | |
droid | The droid that entered the area. | 3.2 |
Return value
Warzone does not process the event handler's return value.
Notes
Note: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
.Return value
Warzone does not process the event handler's return value.
Notes
You can define areas inside maps via the labels.ini file(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
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
// assuming we've labelled an area FOOFoo function eventAreaFOOeventAreaFoo(droid) { // let's reset the area so it triggers again in future resetArea("FOOFoo"); // event will get fired next time a droid enters } |
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
Availability
Requires:
See forum topic for more information. |
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
| ||||
Div | ||||
|
Include Page | ||||
---|---|---|---|---|
|