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

groupAddDroid()

Add a droid to an existing group...

 

Syntax

groupAddDroid(group, droid);

Parameters

ParameterTypeMandatoryDescriptionGame version
groupNumber(tick)

The unique ID of the group.

The ID is the return value of the newGroup() function called when creating the group.

3.1 Beta 1
droidDroid object(tick)A valid droid object. If it's already in a different group, it will be transferred in to this group.3.1 Beta 1

Return value

ValueTypeDescriptionGame version
undefinedUndefinedThe droid was added to the group (or was already in it)3.1 Beta 1
<error>ErrorEither the group doesn't exist, you don't own the group, or you don't own the droid.3.1 Beta 1

Notes

Read important notes about changes to groups in Warzone 3.2.

Example

Add a droid to a group
var myGroup = newGroup();
 
function eventDroidBuilt(droid, structure) {
  groupAddDroid(myGroup,droid); // add shiny new droid to myGroup
  console(groupSize(myGroup));
}
Availability 3.1 B1→3.2.X

Requires:

  • Warzone 3.1 Beta 1 → 3.2.x
  • Deprecated by groupAdd(), but still available, in Warzone 3.2
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

Â