Other great resources: Official JS API docs, Scripting Forum
eventDroidBuilt()
- Aubergine
Owned by Aubergine
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 |
---|---|---|---|---|
droid | Droid object | An object representing the droid you just received. | 3.1 Beta 1 | |
structure | 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 | 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 } }
It's also possible to gain droids by assimilation or transfer from another player - see eventObjectTransfer() for dealing with that scenario.
Availability 3.1 B1+
Requires:
- Warzone 3.1 Beta 1 and above.
- The 'structure' parameter was added in Warzone 3.1 Beta 2
Contents
Jump to:
Scripting: Droids
Related objects:
Constants:
- .action – what action is the droid doing?
- .droidType – what category of droid is it?
- .order – what is the droids order?
Create them:
- makeTemplate() – check various things before building a droid
- componentAvailable() – is a component (propulsion, body or turret) available?
- addDroid() – instantly add a droid to the map
- buildDroid() – produce a droid at a factory
- getDroidProduction() – find out what droid a factory is currently producing
- setDroidExperience() – set experience of a droid
Organise them:
List or count them:
- hackGetObj() – get a single droid
- enumDroid() – list droids on the map
- enumArea() – list droids in specific area
- enumRange() – list droids near a location
- enumGroup() – list droids in a group
- enumSelected() – list droids that are selected
- countDroid() – count droids
Tell them what to do:
- orderDroid() – give a basic order
- droidCanReach() – can the droid reach it's destination?
- propulsionCanReach() – can a specific propulsion travel between two points?
- orderDroidBuild() – build a structure
- orderDroidLoc() – move to a location the map
- orderDroidObj() – do something to another object (attack, repair, etc)
How to's:
- Working with Commanders
- Working with Factories
- Working with Repairs & Rearming
- Working with Sensors
- Working with Transports
- Working with Construction
- Working with VTOLs
Transfer them between players:
- donateObject() – donate a droid to an ally
- eventObjectTransfer() – a droid was transferred or assimilated
Find out what's happening to droids:
- eventDroidBuilt() – droid built or added
- eventDroidIdle() – current orders completed
- eventSelectionChange() – human (de)selects droids
- eventArea<Label>() – droid enters a labelled area
- eventObjectSeen() – droid appears on your sensors
- eventAttacked() – cluster was attacked
- eventAttackedUnthrottled() – same as above, but unthrottled
- eventPickup() – picked up an artifact or oil drum
- eventDestroyed(), bind() – destroyed or recycled
Remove them:
- removeObject() – instantly remove a droid
- DORDER_DESTRUCT – an alternate method
- DORDER_RECYCLE – recycle a droid
- enableTemplate() – allow construction trucks to be built before HQ
- enableComponent() – make a droid component available to research
- makeComponentAvailable() – make a droid component available
- setDesign() – enable or disable design mode
- setDroidLimit() – limit the number of droids a player can make
- getDroidLimit() – determine the limits set for droids
- setExperienceModifier() – change rate at which droids gain experience