Other great resources: Official JS API docs, Scripting Forum
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 19 Current »
Groups are collections of Game objects. There are several benefits to using groups instead of custom arrays:
Note: Groups in the scripting environment are not the same as groups that a human player can set, they do not have shortcut keys, etc.
Warzone 3.1
Droid object
Feature object
Structure object
Other player's objects
Warzone 3.2+
Other players objects
All versions
Droid objects have a .group property stating which group they are in
An object can only be in one of your groups at a time
There are no reachable limits on the number of groups or the number of items in a group
There are four ways to create groups:
If an object is destroyed or transferred to another player (either via Nexus Link or donateObject()) it will be removed from the group its in.
In both cases, eventGroupLoss() will be triggered.
In the case of a group object being destroyed, eventGroupLoss() will be triggered before eventDestroyed().
Groups created by your script are private and only your script can see them.
Groups defined by a map (in labels.ini) are available to all players, however:
This means that groups defined in labels.ini have negative indices in the groupSizes[] array – bear this in mind if you're iterating the array.
The groups and objects they contain will survive the save/load cycle.
When you start a new game, the original map-defined groups (in labels.ini) will be reinstated.
Requires:
In 3.1 RC3 and earlier, empty groups were automatically deleted (bug #3684).
Jump to:
Related Objects:
Create them:
Add things to them:
Remove things from them:
Count objects in them:
List them:
Retrieve their objects:
Monitor them:
Remove them: