Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Overview
Excerpt |
---|
Activates the special feature of a structure, such as firing laser satellite. |
...
Availability
...
. |
...
. |
Syntax
Code Block | |
---|---|
|
...
| |||||
var returnValue = activateStructure(structure, target |
...
[, ability]); |
Parameters
Parameter | Type | Mandatory | Description | Game version |
---|---|---|---|---|
structure | Structure object | The structure that will perform the special action. | 3.1 Beta 2 | |
target | Game object {x:xPos, y:yPos} | The target location – usually a game object, but some structures might accept any object with x,y properties. The following structure types require a target:
| 3.1 Beta 2 | |
ability | (not yet documented) | 3.2 |
Return value
Value | Type | Description | Game version |
---|---|---|---|
true | Boolean | The structure was activated | 3.1 Beta 2 |
<error> | Error | Something went wrong | 3.1 Beta 2 |
Example
Code Block | |
---|---|
|
...
| |||||||
var lastAttacker; function eventAttacked(victim,attacker) { lastAttacker = attacker; } function eventStructureReady(structure) { if (structure.stattype == LASSAT) activateStructure(structure, lastAttacker); } |
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
Availability
Requires:
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|
Div | |
---|---|
|
...
| |
See alsoRelated articles: |
...
|
...
|
...
...
|
...
|