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 |
|---|---|---|---|---|
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 |
|---|---|---|---|
| Boolean | Indicates the beacon was successfully added. | 3.2 |
| 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);
}