Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
warning
Excerpt

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

article is need of technical review – specifically, are the objects in the array positions of derricks that were pre-placed on the map (and have survived baseType setting) or positions of free oil resources on the map at the start of the game? Also, need to add the note about the array not being updated.

 

Overview

You can use this array to get locations of unclaimed oil resources at the start of the game.

Later in the game it's worth using enumStruct() to find enemy derricks and enumFeature() to find oil resources that have become available (had their derricks destroyed) since the start of the game.

The main use of the 'derrickPositions' array is to position the camera (using centreView() function) on them when giving mission briefings, etc., during campaign missions or challengesarray 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 the oil resources that were available at the start of the game.

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

Code Block
themeRDark
languagejavascript
titleOutput positions of each derrick to the console
linenumberstrue
derrickPositions.forEach(function(pos) {
  console("there's one at: "+pos.x+","+pos.y); // x,y
});
Div
classbox
Availability
Status
colourGreen
title3.1 b1+

Requires:

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

Jump to:

Table of Contents
maxLevel5

Div
classbox

See also

Related articles: