eventDroidBuilt()

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

eventDroidBuilt()

This event is triggered when you get a new droid as a result of buildDroid() or addDroid()...

 

Syntax

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

Parameters

Parameter

Type

Mandatory

Description

Game version

Parameter

Type

Mandatory

Description

Game version

droid

Droid object

An object representing the droid you just received.

3.1 Beta 1

structure

Structure object

Undefined

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

Example event handler
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 } }