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.
Property | Type | Description | Game Version |
---|
x | Number | The x co-ordinate of the item | 3.1 Beta 1 |
y | Number | The y co-ordinate of the item | 3.1 Beta 1 |
type | Constant | POSITION | 3.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 |
---|
theme | RDark |
---|
language | javascript |
---|
title | Output positions of each derrick to the console |
---|
linenumbers | true |
---|
|
derrickPositions.forEach(function(pos) {
console("there's one at: "+pos.x+","+pos.y); // x,y
}); |