Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
themeEclipse
languagejavascript
titleAttack an enemy object
linenumberstrue
orderDroidObj// this will always work (assuming the droid can get to the location):
orderDroidLoc(myDroid,DORDER_RETREAT,enemyObject);,startPositions[me].x,startPositions[me].y);
// if it can't get to the location it will stop moving.
 
// this will work only if a special retreat point has been defined (no idea how to do that):
orderDroid(myDroid,DORDER_RETREAT);
// if no retreat point is defined, it will try moving to 0,0 (or possibly just stop moving).

Notes

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

This order likely won't do what you expect it to do. As Per explained, DORDER_RETREAT will make your droid go to a seems to be mainly used in campaign missions that define a specific retreat point.

Specifically, if you don't specify a location when issuing the DORDER_RETREAT order, Warzone will look to see if there's a pre-defined retreat point - something that seems to be specific to campaign missions. I currently have no idea how that point is defined, perhaps through map labels? . If it finds one, the droid will move towards it. If it doesn't find one, it will try moving to 0,0 or maybe just stop moving. If you try this order, or know how to define retreat pointspositions, please post a comment on the page below to let us know what happens!What you probably want to use is 

In addition, DORDER_RETREAT is treated as a "morale failure" state – in this state droids become unresponsive to human interaction via the user interface.

I suggest you use DORDER_RTB (return to base), DORDER_RTR (return to repair) or DORDER_REARM (return to rearming pad - VTOLs only) instead of DORDER_RETREAT. You could even use DORDER_MOVE in conjunction with your start position.

...