Versions Compared

Key

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

Overview

Image Added

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
themeEclipse
languagejavascript
linenumberstrue
var returnValue = safeDest(player,x,y);

Parameters

ParameterTypeMandatoryDescription
playerNumber(tick)The id of the player who's safety you care about (usually me)
xNumber(tick)The x co-ordinate of the position on the map to check
yNumber(tick)The y co-ordinate of the position on the map to check

...

ValueTypeDescription
trueBooleanThe position appears safe, according to your sensors.
falseBooleanThe position is not safe.
<error>ErrorThe player specified did not exist or the position specified was not on the map.

Example

Code Block
themeEclipse
languagejavascript
linenumberstrue
// assuming "oil" is a feature object representing an oil resource...
if (safeDest(me,oil.x,oil.y)) {
  // build oil derrick
}

...