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

orderDroid()

Overview

Send a basic command, that does not require an object or location, to a droid.

Availability

Warzone 3.2 and above.

 Backport to earlier versions with backport.orderDroid.js and backport.dorder.js.

Syntax

var returnValue = orderDroid(droid, order);

Parameters

ParameterTypeMandatoryDescriptionGame version
droidDroid object(tick)The droid that will be given the order.3.2
orderConstant(tick)

The order to give the droid, which can only be one of the following simple orders:

  • Page:
    DORDER_DESTRUCT — Instruct a droid to self-destruct!
  • Page:
    DORDER_HOLD — Instruct the droid to hold its current position until instructed otherwise.
  • Page:
    DORDER_REARM — Instruct a VTOL to return to a rearming pad for repairs and rearming.
  • Page:
    DORDER_RECYCLE — Recycle a droid...
  • Page:
    DORDER_RTB — Instruct a droid to return to your base.
  • Page:
    DORDER_RTR — Instruct a land droid to go to a repair facility for repairs.
  • Page:
    DORDER_STOP — Instruct a droid to stop what it's doing.

(warning) If you try using any other order, you will get an error.

3.2

Return values

ValueTypeDescription
trueBooleanThe droid will perform the order.
<error>ErrorThe order was invalid or the droid doesn't exist.

Example

Stop a droid's current order
orderDroid(myDroid, DORDER_STOP); // tell my droid to stop whatever it's doing

See also

  • Droids – quick reference of all API features relating to droids
  • orderDroidBuild() – order a construction droid to build something
  • orderDroidLoc() – order a droid to do something at some location
  • orderDroidObj() – order a droid to do something to some object