addBeacon()

(info) Other great resources: Official JS API docs, Scripting Forum

addBeacon()

Send a beacon to a specific player or allies...

 

Syntax

addBeacon(x, y, to[, message]);

Parameters

Parameter

Type

Mandatory

Notes

Game Version

Parameter

Type

Mandatory

Notes

Game Version

x

Number

The x co-ordinate of the beacon.

3.2

y

Number

The y co-ordinate of the beacon.

3.2

to

Number

Constant

The player id who the beacon is for.

Alternatively you can send the beacon to all ALLIES.

3.2

message

String

An optional message to send with the beacon.

3.2

Return values

Value

Type

Notes

Game Version

Value

Type

Notes

Game Version

true

Boolean

Indicates the beacon was successfully added.

3.2

false

Boolean

Indicates the beacon did not get added. (why??)

3.2

<error>

Error

Invalid parameters.

3.2

Example

function eventObjectSeen(sensor, gameObject) { addBeacon(gameObject.x, gameObject.y, ALLIES, "I just spotted a "+gameObject.name); }