Overview
Determine if, based on the script player's current knowledge of the map, whether a specific map location is safe or not.Because this function is based on knowledge of the map, any enemy droids/structures that are in the fog of war (or otherwise not visible to your sensors - eg. ECM in effect) will not be checked, so use this with care. In other words, what looks like a safe place to your sensors might be a very dangerous place.
Syntax
var returnValue = safeDest(x,y);
Parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
x | Number | The x co-ordinate of the position on the map to check | |
y | Number | The y co-ordinate of the position on the map to check |
Return value
Value | Type | Description |
---|---|---|
true | Boolean | The position appears safe, according to your sensors. |
false | Boolean | The position is not safe. |
Example
// assuming "oil" is a feature object representing an oil resource... if (safeDest(oil.x,oil.y)) { // build oil derrick }
See also
- droidCanReach() – work out if a droid can get to a location
- distBetweenTwoPoints() – work out distance between two points on the map