hi myke,
You simply store the empty groups in an array for each side.
first u init these arrays:
EmptyGroupsWest = []
EmptyGroupsEast = []
Then you examine each group for the number of alive units. If all units are dead, you store the empty group in the appropriate array:
for example:
if(({alive _x} count units _group) == 0) then
{
EmptyGroupsWest = EmptyGroupsWest + [_group];
};
If you create now a new group, you examine first the array whether there empty groups are.
If not, you must create a new group. If an empty group is however at least in the array,
you take the first empty group from this array, in order to create new units there. Example:
_newgroup = group player;
if(count EmptyGroupsWest > 0) then
{
_newgroup = (EmptyGroupsWest select 0);
EmptyGroupsWest = EmptyGroupsWest - [_newgroup];
}
else
{
_newgroup = creategroup west;
};
Now u can create the first unit for the group (the leader):
_leader = _newgroup createUnit ["SquadLeaderW",position respawnLogic,[], 0, "NONE"];
[_leader] join _newgroup;
thats all :-)
I use the same method in the new DAC version, and it functions perfectly ;-)
bye
silola