If structures matching the criteria are found, an array of structure objects will be returned.
3.1 Beta 1
[]
Array
If no matching structures are found, you get an empty array.
3.1 Beta 1
<error>
Error
If the player/viewer or structure type specified is incorrect, an error is thrown.
3.1 Beta 1
Example
Get a list of all my structures...
// get a list of all my structures
var myStructures = enumStruct();
Build a list of all enemy structures...
var enemyStructs = [];
playerData.forEach( function(player) {
if ( !allianceExistsBetween(me, player) ) { // enemy player
enemyStructs = enemyStructs.concat(enumStruct(player));
}
} );
In the early beta releases bug #3123 prevented scripts from getting lists of scavenger droids and structures. See scavengerPlayer for some ideas as to how to deal with that.
There have been numerous changes to Structure objects across various Warzone versions.
Availability 3.1 B1+
Requires:
Warzone 3.1 Beta 1 or above
Contents
Jump to:
See also
Related articles:
Structures – quick reference to all JS API stuff relating to structures
enumBlips() – get a list of radar detector blips on the map
enumStructOffWorld() – similar to enumStruct(), but gets a list of structures that aren't on the current map (used in campaigns when doing off-world missions)