Versions Compared

Key

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

Add a game object to a group...

 

Syntax

Code Block
themeRDark
languagejavascript
linenumberstrue
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

Code Block
themeRDark
languagejavascript
titleAdd any attacker (regardless of object type) to an 'annoyances' group...
linenumberstrue
var annoyances = newGroup();
 
function eventAttacked(victim, attacker) {
	groupAdd(annoyances, attacker);
}
Div
classbox
Availability
Status
colourYellow
title3.2+

Requires:

  • Warzone 3.2 or above

Earlier versions:

See Also

Related articles:

  • groupAddDroid() – add droids to a group (WZ 3.1+)
  • groupAddArea() – add all droids within a specific map area to a group
  • Groups – quick reference for groups
  • groupSizes[] – list of group sizes (WZ 3.2+)
  • groupSize() – count the number of objects in a group (WZ 3.1+)
  • newGroup() – create a new group
    Div
    classbox
    Contents

    Jump to:

    Table of Contents
    maxLevel5

    Div
    classbox

    Include Page
    .jslinks-groups
    .jslinks-groups