Hi there.
I ran into problems with a big script that spawns groups and let them fight against each other. After about 1 hour of great fights, the spawns stop.
By adding a debug mode i have targeted the problem: no more soldiers can be spawned into a group, but since i run it within a loop, it never ends:
_teamscale = 10
#spawn_groupleader
(patrolunits_west select _leader) createUnit [getPos _mybase, westdummygroup,"this exec {patroldead.sqs}"]
;assign to other group
_member = (units westdummygroup) select 1
[_member] join grpNull
_grp = group _member
#spawn_patrolrest
~(random 1)
(patrolunits_west select 1+(random (count patrolunits_west - 1))) createUnit [getPos _mybase, _grp,"this exec {patroldead.sqs}"]
?(count units _grp >= _teamscale):goto "patrolteamfull"
goto "spawn_patrolrest"
#patrolteamfull
I register each spawned group in my Allgroups array:
; register new group in groupsarray
;if _grp is already registered, make a new one
?(_grp in _patrolteams):hint "WARNING";"deletevehicle _x" forEach units _grp;goto "spawn_groupleader";
?(count _patrolteams == 0):_patrolteams = [_grp]
?(!(_grp in _patrolteams)):_patrolteams = _patrolteams + [_grp]
After my groupleader joins grpNull, OpF inits a new group named automaticly (Alpha,Bravo,Charlie,etc). Now i believe once in a while it all starts at Alpha again and because Alpha does exist already i can't spawn new units into it. Maybe there are still infos of dead units in it ?
I could imagine that by 'destroying' a group name, could be a solution. Is it ? How can it be done ? How do other scripts handle group spawns ?
HELP !