Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Overview

Excerpt

Activates the special feature of a structure, such as firing laser satellite.

...

Availability

...

.

...

.

 

Syntax

Code Block
theme

...

RDark
languagejavascript
linenumberstrue
var returnValue = activateStructure(structure, [target

...

[, ability]]);

Parameters

ParameterTypeMandatoryDescriptionGame version
structureStructure object(tick)The structure that will perform the special action.3.1 Beta 2
target

Game object

{x:xPos, y:yPos}

(question)

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:

  • LASSAT – Laser Satellite Command Post
3.1 Beta 2
ability(question)(error)(question) (not yet documented)3.2

Return value

ValueTypeDescriptionGame version
trueBooleanThe structure was activated3.1 Beta 2
<error>ErrorSomething went wrong3.1 Beta 2

Example

Code Block
theme

...

RDark
languagejavascript
titleToast the most recent droid/building that attacked me
linenumberstrue
var lastAttacker;
 
function eventAttacked(victim,attacker) {
  lastAttacker = attacker;
}
 
function eventStructureReady(structure) {
  if (structure.stattype == LASSAT) activateStructure(structure, lastAttacker);
}
Div
classbox
Availability
Status
colourGreen
title3.1 b2+

Requires:

  • Warzone 3.1 Beta 2 and above.
Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div

...

classbox

See also

Related articles:

...

  • – determine if a

...

  • structure is

...

...

  • triggered when a structure is ready

...

  • to be activated