Overview
Instruct a droid to guard a structure.Availability
Requires backport.dorder.js and backport.js.
This isn't a standard feature of the JS API at present (but likely to be added in the future), however it's a constant used by the game engine so it's recognised by Warzone from at least 3.1 Beta 1 onwards.
Example
if (myDroid.canHitGround || myDroid.canHitAir) { orderDroidObj(myDroid,DORDER_GUARD,structureObject); }
Notes
The droid's current order can be determined from it's .order
property. For more information see Droid object.
When you tell a droid to guard a structure, it will move to the structure and guard it. How it reacts to enemies depends on the droid's settings – something that can't currently be controlled via the API.
It's not known what will happen to sensor droids or command droids, and their assigned units, if they are told to guard a structure – if you know please post a comment on this page!
Guarding sensors might work in a similar way to how DORDER_FIRESUPPORT works but for structures? Again, unknown – post a comment if you know!
See also
- Droids – quick reference of API features relating to droids
- DORDER_FIRESUPPORT – assign attacker droids to a sensor droid
- DROID_SENSOR – sensor droids
- orderDroidObj() – tell a droid to do something to something
- Structures – quick reference of API features relating to structures