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

groupAdd()

Add a game object to a group...

 

Syntax

groupAdd(group, gameObj);

Parameters

ParameterTypeMandatoryDescriptionGame version
groupNumber(tick)

The unique ID of the group you want to add to.

If the group ID doesn't exist, a group will be created automatically.

You can determine the next available group from groupSizes.length.

You can also use newGroup() to create a new group and get it's ID.

3.2
gameObjGame object(tick)

A valid droid, structure or feature. If it's already in a different group, it will be transferred in to this group.

3.2

Return value

ValueTypeDescriptionGame version
undefinedUndefinedThe object was added to the group (or was already in it)3.2
<error>ErrorInvalid parameters.3.2

Notes

Read important notes about changes to groups in Warzone 3.2.

Example

Add any attacker (regardless of object type) to an 'annoyances' group...
var annoyances = newGroup();
 
function eventAttacked(victim, attacker) {
	groupAdd(annoyances, attacker);
}
Availability 3.2+

Requires:

  • Warzone 3.2 or above

Earlier versions:

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

Â