Other great resources: Official JS API docs, Scripting Forum
eventGroupLoss()
- Aubergine
Syntax
eventGroupLoss(gameObject, groupID, groupSize)
Parameters
Parameter | Type | Notes | Game Version |
---|---|---|---|
gameObject | Game object | The object that left the group. Note that in WZ 3.2+, any type of game object can be added to a group. | 3.2 |
groupID | Number | The ID of the group | 3.2 |
groupSize | Number | The size of the group after the object was removed from the group. | 3.2 |
Notes
An object can be removed from a group in four ways:
- The object is moved to another group
- The object gets destroyed
- The object is transferred to an ally (eg. donateObject())
- The object is assimilated by Nexus Link
The sequence of events is as shown below:
When an object is transferred or assimilated, the .player property of the object sent to eventGroupLoss() will be the original player, whereas the .player property of the object sent to eventObjectTransfer() will be the new owner.
When droids are assimilated via Nexus Link, eventDestroyed() is also triggered, however this is considered to be a bug as the object hasn't actually been destroyed.
Availability 3.2+
Requires:
- Warzone 3.2 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