Overview
Excerpt |
---|
Determine if, based on the script player's current knowledge of the map, whether a specific map location is safe or not. |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
var returnValue = safeDest(player,x,y); |
Parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
player | Number | The id of the player who's safety you care about (usually me) | |
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 |
...
Value | Type | Description |
---|---|---|
true | Boolean | The position appears safe, according to your sensors. |
false | Boolean | The position is not safe. |
<error> | Error | The player specified did not exist or the position specified was not on the map. |
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
// assuming "oil" is a feature object representing an oil resource...
if (safeDest(me,oil.x,oil.y)) {
// build oil derrick
} |
...