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
themeEclipse
languagejavascript
linenumberstrue
// see important notes about event name and usage below!
function eventArea<LABEL>(droid) {
  // do stuff
}

Parameters & References

ParameterTypeMandatoryDescriptionGame version
<LABEL>

String

(tick)

The name of the label, which is always in uppercase, is appended to 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 "FOO", the event when a droid first enters that area will be called "eventAreaFOO()".

(question)
droid

Droid object

(tick)

The droid that entered the area.

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.

(question)

Return value

Warzone does not process the event handler's return value.

Notes

You can define areas inside maps via the labels.ini file.

Example

Code Block
themeRDark
languagejavascript
titleWork out who our main aggressors are
linenumberstrue
// assuming we've labelled an area FOO
function eventAreaFOO(droid) {
	// let's reset the area
	resetArea("FOO"); // event will get fired next time a droid enters
}
Div
classbox
Availability
Status
colour
Red
Yellow
title
Dev
3.2+

Requires:

  • Warzone (question)3.2

See forum topic for more information.

Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

See also

Related articles:

  • resetArea() – reset an area so it's associated event will be triggered the next time a droid enters it
  • Area object – objects associated with areas
  • addLabel() – add labels to objects
  • enumLabels() – get a list of labelled objects
  • label() – get an object associated with a specific label