Other great resources: Official JS API docs, Scripting Forum
newGroup()
- Aubergine
Owned by Aubergine
Create a new droid group...
Syntax
var returnValue = newGroup();
Parameters
This function does not have any parameters.
Return value
Value | Type | Notes | Game version |
---|---|---|---|
<groupID> | Number | The unique ID for the newly created group. | 3.1 Beta 1 |
Example
Create a new group
var myGroup = newGroup(); // create a new group, storing it's ID in "myGroup" function eventDroidBuilt(droid, structure) { groupAddDroid(myGroup, droid); console(groupSize(myGroup)); }
Availability 3.1 B1+
Requires:
- Warzone 3.1 Beta 1 or above
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:
- groupAdd() – add any Game object
- groupAddDroid() – add a Droid object
- groupAddArea() – add Game objects within an area of the map
Remove things from them:
- Put them in some other group
Count objects in them:
- groupSize() – get number of items in a group
- groupSizes[] – iterate group sizes
List them:
- groupSizes[] – elements are group ids
- getObject() – retrieve a group by its label
Retrieve their objects:
- enumGroup() – retrieve objects in a group
Monitor them:
- eventGroupLoss() – triggers when an object is removed from a group
Remove them:
- not currently possible