Versions Compared

Key

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

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

 

Code

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

Example

Code Block
themeRDark
languagejavascript
linenumberstrue
// when attacked, tell all droids in a "retalliationGroup" to attack the attacker
eventAttacked = function(victim,attacker) {
  orderGroupObj(retalliationGroup, DORDER_ATTACK, attacker);
}
Div
classbox
Availability
Status
colourGreen
title3.1 b1+

Requires:

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

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