Other great resources: Official JS API docs, Scripting Forum
Droid object
- Aubergine
Properties
Property | Type | Description | Game version |
---|---|---|---|
type | Constant | DROID | 3.1 |
order | Constant | The current order (task) that the droid is doing:
... Constants were added over time so check each constant's doc page for version info. | 3.1 ... |
action | Constant | This is the action that the droid is taking to carry out it's current order, as defined in action.cpp. The constants are not currently exposed to JS API, however you can see a full list here: .action. | 3.1 |
droidType | Constant | Defines what sort of droid it is:
| 3.1 |
group | Number Null <not defined> | Defines what group the droid is in, or returns If the droid isn't in a group then the group property will return Warzone 3.1 and earlier: If the droid isn't in a group then the group property won't exist! | 3.1 |
experience | Number | A number representing the droid's experience. This number can optionally be set using the setDroidExperience() function. | 3.1 |
armed | Number Null | Defines the weapon capability remaining, as a percentage, for VTOLs. Warzone 3.2.0: If the droid isn't a VTOL, the property returns So, 100 = fully armed, 0 = no shots left (the VTOL needs to go to a reaming pad before it can make more attacks). Warzone 3.1 and earlier:
| 3.1→3.2.0 |
isVTOL | Boolean | Tells you if the droid is a VTOL or not:
You can also use the isVTOL() function to find out if a droid object is a VTOL. | 3.2 |
cost | Number | The amount of power it cost to create the droid. | 3.2 |
isRadarDetector | Boolean | Does the droid have a radar detector turret?
| 3.2 |
range | Number Null | The maximum range of the droids weapon, or null if not applicable. It's not clear whether range will be present for sensors. | 3.2 |
isCB | Boolean | Does the droid have a counter battery (CB) turret?
| 3.2 |
isSensor | Boolean | Does the droid have a sensor turret?
| 3.2 |
canHitAir | Boolean | Can the droid attack aircraft (VTOLS / transports)?
| 3.2 |
canHitGround | Boolean | Can the droid attack stuff on the ground (tanks, structures, features, etc)?
| 3.2 |
hasIndirect | Boolean | Does this droid have indirect fire capability (eg. artillery)?
| 3.2 |
body | String | The ID of the body that the droid is using. Some of the more common bodies are listed below:
For a full list, including cyborgs and scavenger bodies, see: body.ini | 3.2 |
propulsion | String | The ID of the propulsion that the droid is using. For a list of propulsion types, see: propulsion.txt | 3.2 |
cargoSize | Number | The amount of cargoCapacity the droid will consume if loaded in to a transport. In campaign mode:
In other game modes, the cargo size is based on bodySize:
| 3.2 |
cargoCapacity | Number <not defied> | For transports only, this defines the total capacity of the cargo hold. For non-transport droids, the property will be undefined, so you should either check the property exists or that the droid is a transport before attempting to read the value. | 3.2 |
cargoSpace | Number <not defined> | For transports only, the amount of cargo space remaining. For non-transport droids, the property will be undefined, so you should either check the property exists or that the droid is a transport before attempting to read the value. | 3.2 |
cargoCount | Number <not defined> | For transports only, this defines the number of droids in the cargo hold. For non-transport droids, the property will be undefined, so you should either check the property exists or that the droid is a transport before attempting to read the value. | 3.2 |
bodySize | Number | The size of the droid's body, which can be used to determine the number of factory modules required before you can build it:
For more information, see: Working with Factories. | 3.2 |
weapons[] | Array of Weapon Status | An array containing basic information about the weapons attached to the droid. Each object in the array contains two properties:
| 3.2 |
There's an undocumented feature in the official Warzone Guide that lets you inspect stats for any droid configuration.
Availability 3.1 B1+
Droid objects were introduced in:
- Warzone 3.1 Beta 1 and above
- Several updates to Base objects since then
- Lots of new features planned for Warzone 3.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