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

« Previous Version 3 Next »

Overview

Returns an array of feature objects (like trees and boulders), optionally filtered to a specific looking player.

Availability

Warzone 3.1 Beta 1 and above.

Syntax

var returnValue = enumFeature([viewer[, featureID]]);

Parameters

ParameterTypeMandatoryDescriptionGame version
viewerNumber(error)

List features that a specific player can see (eg. on their sensors), with the player specified by their player ID.

Defaults to me.

You can specify -1 which means "don't filter based on viewer" so you get a list of all features on the map.

3.1 Beta 1
featureIDString(error)

Optionally filter the list to features of a specific type as defined by their feature ID.

You can get a list of feature IDs from the first column in features.txt

Defaults to not filtering by feature type.

3.1 Beta 1

Return value

ValueTypeDescriptionGame version
<array>ArrayAn array of Feature objects3.1 Beta 1
[]ArrayIf no matching features are found, you get an empty array.3.1 Beta 1
<error>ErrorIf the viewer does not exist, or you specify an invalid feature ID, an error is thrown.3.1 Beta 1

Example

Get a list of all my droids
var visibleFeatures = enumFeature();

See also

  • Features – quick reference to all JS API stuff relating to features
  • Feature object – enumFeatures() returns a list of these objects
  • enumBlips() – get a list of radar detector blips on the map
  • enumDroid() – get a list of droids on the map
  • enumStruct() – get a list of structures on the map
  • No labels