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

orderGroupObj(group,dorder,obj)

Similar to orderDroidObj() but for a group of droids (smile)

 

Code

function orderGroupObj(group,dorder,obj) {
  enumGroup(group).forEach(function(droid) {
    if (droid.type==DROID) orderDroidObj(droid,dorder,obj);
  });
}

Example

// when attacked, tell all droids in a "retalliationGroup" to attack the attacker
eventAttacked = function(victim,attacker) {
  orderGroupObj(retalliationGroup, DORDER_ATTACK, attacker);
}
Availability 3.1 B1+

Requires:

  • Warzone 3.1 Beta 1 and above.
  • Compatible with Warzone 3.2 style groups

See also

Related articles:

  • .order – list of all available DORDER constants
  • Droids – quick reference for JS API features relating to droids
  • enumGroup() – get a list of all droids in a group
  • Groups – quick reference for JS API features relating to groups
  • orderDroidObj() – order a droid to perform a command on a specific object

Â