Get a list of game objects within a specific area of the map...
Syntax
The function has 3 different syntax options...
// syntax #1: specify co-ordinates of area
var results = enumArea( x1, y1, x2, y2[, filter[, seen]] );
// syntax #2: reference an AREA object by it's label
var results = enumArea( label[, filter[, seen]] );
// syntax #3: pass in an actual AREA object
var results = enumArea( areaObj[, filter[, seen]] );
Parameters
Syntax
Parameter(s)
Type
Mandatory
Notes
Game Version
#1
x1, y1, x2, y2
Numbers
The co-ordinates of the top left corner (x1, y1) and bottom right corner (x2, y2) of the area to search.
3.2
#2
label
String
The name of a label associated with an AREA object.
// Get a list of visible enemies within specified co-ordinates
var results = enumArea( 2, 3, 57, 42, ENEMIES );
// get a list of anything visible in a AREA labelled as "BASE_PERIMETER"
var results = enumArea( "BASE_PERIMETER" );
// get a list of all enemies within an area defined by an area object
var results = enumArea( {x:2, y:3, x2:57, y2:42, type:AREA}, ENEMIES, false );
Availability 3.2+
Requires:
Warzone 3.2 or above
Contents
Jump to:
See also
Related articles:
eventArea<Label>() – an event triggered when droids enter a labelled area
enumRange() – get a list of objects within a specific range of a map position
enumDroid() – get a list of droids anywhere on the map
enumStruct() – get a list of structures anywhere on the map
enumStructOffWorld() – get a list of offworld structures in a campaign away-mission