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

DORDER_PATROL

Overview

Instruct a droid to patrol between it's current location and a specified location, attacking any enemies it detects along the way.

Availability

Warzone 3.1 Beta 1 and above.

Example

Move a droid to where I first started out on this map
// assuming we have a droid object "myDroid" and a location defined by it's x,y co-ordinates...
if (droidCanReach(myDroid,x,y)) {
  orderDroidLoc(myDroid,DORDER_PATROL,x,y);
}

Notes

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

Patrolling droids will endlessly "scout" (move but attack any targets they see) between their starting position (where they were when the DORDER_PATROL command was given) and their target position (defined by x,y co-ordinates).

If the droid can't reach the location you've specified due to terrain obstacles it won't move, so it's best to check it can get to the location before giving it an order.

See also

  • DORDER_MOVE – move a droid to a specific location, avoid attacking enemies along the way, stop when they get there
  • DORDER_SCOUT – similar to DORDER_PATROL, but the droids will stop once they reach the specified location
  • droidCanReach() – determine if a droid can reach a specific location
  • orderDroidLoc() – order a droid to move to, or do something at, a specific location
  • orderDroidObj() – order droid to move to, or do something with, a specific game object
  • .order – list of all order constants
  • startPositions[] – an array of player starting positions