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

DORDER_ATTACK

Overview

Instruct a droid to attack something.

Availability

Warzone 3.1 Beta 1 and above.

Example

// tell myDroid to attack enemyObject
orderDroidObj(myDroid,DORDER_ATTACK,enemyObject);

Notes

The droid's current order can be determined from it's .order property. For more information see Droid object.

As of Warzone 3.2, you can work out what a droid can attack from it's .canHitAir and .canHitGround properties. For more information see Droid object.

Droids can also attack features that have a .destroyable == true property. For more information see Feature object.

If you're ordering a sensor droid to DORDER_ATTACK then only it's assigned units will attack the target. If you want base defences to attack the target as well, tell the sensor to DORDER_OBSERVE the target.

Bug #3359 indicates there might be a problem ordering scavenger units that are pre-placed on the map (at design time) to attack.

See also

  • Droids – quick reference of API features relating to droids
  • orderDroidObj() – tell a droid to do something to something