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

enumGroup()

Retrieve a list of objects in a group...

 

Syntax

var list = enumGroup(group);

Parameters

ParameterTypeMandatoryNotesGame version
groupNumber(tick)The numeric ID of the group.3.1 Beta 1

Return values

ValueTypeNotesGame version
<list>Array of
Droid objects
In Warzone 3.1, groups could only contain droid objects belonging to you.3.1 branch
<list>Array of
Game objects 
In Warzone 3.2 and above, groups can contain any type of game object owned by any player.3.2
[ ]Empty ArrayIf there's nothing in the group, an empty array is returned.3.1 Beta 1
<error>ErrorMissing or invalid group parameter.3.1 Beta 1

Notes

If you just want to know how many items are in a group, it's much faster to use groupSize() or groupSizes[].

Example

Move everything in group 7 in to group 6...
if (typeof groupAdd == "undefined") { // WZ 3.1
	this.groupAdd = groupAddDroid;
}
 
enumGroup(7).forEach( function moveToGroup6(obj) {
	groupAdd(6, obj); // automatically removes it from group 7
} );
Availability 3.1 B1+

Requires:

  • Warzone 3.1 Beta 1 or above
  • Updated in Warzone 3.2 to handle any type of game object
Contents

Jump to:

Scripting: Groups

Related Objects:

 Create them:

  • newGroup() – create a new group
  • WZ 3.2+ – add to a group that doesn't exist yet
  • labels.ini – group map-placed objects

Add things to them:

Remove things from them:

  • Put them in some other group

Count objects in them:

List them:

Retrieve their objects:

Monitor them:

Remove them:

  • not currently possible