Versions Compared

Key

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

Overview

Excerpt

This event is triggered when you get a new droid

...

(info) It's also possible to gain droids by assimilation or transfer from another player - see eventObjectTransfer() for dealing with that scenario.

Availability

Warzone 3.1 Beta 1 and above.

as a result of buildDroid() or addDroid()...

 

Syntax

Code Block
theme

...

RDark
languagejavascript
linenumberstrue
function eventDroidBuilt(droid, structure) {
  // do stuff
}

Parameters

ParameterTypeMandatoryDescriptionGame version
droidDroid object(tick)An object representing the droid you just received.3.1 Beta 1
structure

Structure object

Undefined

(error)

If the droid was produced at a factory, for example you used buildDroid() function, this will be an object representing that

...

factory.

If the droid wasn't built at a factory, for example if you used the addDroid() function, this parameter will be undefined.

3.1 Beta 2

Return value

Warzone does not process the event handlers' return value.

Example

Code Block
theme

...

RDark
languagejavascript
titleExample event handler
linenumberstrue
function eventDroidBuilt(droid,structure) {
  // droid object will always be defined - you probably want to give it some orders
  if (structure) {
    // the droid was built at your factory, which is probably now idle
  }
}
Div

See also

...

classsuggest box

It's also possible to gain droids by assimilation or transfer from another player - see eventObjectTransfer() for dealing with that scenario.

Div
classbox
Availability
Status
colourGreen
title3.1 b1+

Requires:

  • Warzone 3.1 Beta 1 and above.
  • The 'structure' parameter was added in Warzone 3.1 Beta 2
Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Include Page
.jslinks-droids
.jslinks-droids