Other great resources: Official JS API docs, Scripting Forum
groupAddDroid()
Add a droid to an existing group...
Syntax
groupAddDroid(group, droid);Parameters
Parameter | Type | Mandatory | Description | Game version |
|---|---|---|---|---|
group | Number | 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 | |
droid | Droid object | 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
Value | Type | Description | Game version |
|---|---|---|---|
| Undefined | The droid was added to the group (or was already in it) | 3.1 Beta 1 |
<error> | Error | Either 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));
}