(info) Other great resources: Official JS API docs, Scripting Forum

derrickPositions[]

An array of oil resources on the map, filtered to those that don't have derricks built on them at the start of the game.

 

Overview

This array lists map-placed oil resources, which you can build a derrick on if there isn't already one there.

Depending on baseType setting and map design, some of the listed oil resources will have map-placed derricks already built on them when the game starts.

It is generally better to locate free oil resources using enumFeature() and existing derricks using enumStruct() than to use the derricksPositions[] array. In fact, I can't think of any reliable use for derrickPositions[] array...

Values

The 'derrickPostiions' array contains a numerically-referenced list of Position objects that define the co-ordinates of oil resources.

PropertyTypeDescriptionGame Version
xNumberThe x co-ordinate of the item3.1 Beta 1
yNumberThe y co-ordinate of the item3.1 Beta 1
typeConstantPOSITION3.1 Beta 11

Note: You can't order a droid to build derricks on position objects, you have to use enumFeature() or eventObjectSeen() to find the oil resource Feature objects.

Examples

Output positions of each derrick to the console
derrickPositions.forEach(function(pos) {
  console("there's one at: "+pos.x+","+pos.y); // x,y
});
Availability 3.1 B1+

Requires:

  • Warzone 3.1 Beta 1 or above
  • The return value was updated in Warzone 3.1 Beta 11
Contents

Jump to:

See also

Related articles: