Other great resources: Official JS API docs, Scripting Forum

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Overview

Returns an array of all enemy structures of a given type, optionally filtered to visibility of lookingPlayer.

Availability

Warzone 3.1 Beta 1 and above.

(warning) Requires getEnemyPlayerIDs()

Code

function enumEnemyStruct(structure,lookingPlayer) {
  var list = [];
  var enemies = getEnemyPlayerIDs();
  enemies.forEach(function(enemy) {
    if (!!lookingPlayer) {
      list = list.concat(enumStruct(enemy,structure,lookingPlayer));
    } else {
      list = list.concat(enumStruct(enemy,structure));
    }
  });
  return list;
}

Example

// get a list of enemy oil derricks
var enemyDerricks = enumEnemyStruct(RESOURCE_EXTRACTOR);

See also

  • No labels