Jump to content
Sign in to follow this  
genesis92x

Deleting empty groups?

Recommended Posts

Hey guys, I'm sorry to bring up this topic again, I saw a few threads about this but none were close enough to what I need. I really need this fixed as well...

I have a mission that uses the Undead Mod so I use the Spawning Module to constantly spawn zombies...Except when a group of zombies die they are not removed from the group list, in turn the independent side reaches the 144 limit really quick and the zombies stop spawning.

So my question is, is there a way to remove all empty groups from one side? I don't care if it deletes all the units, I just want all the empty groups to be deleted! I have all the code for the Undead Mod Spawning Module so I will put what I think is useful up.

Just the spawning module code itself.

_module=_this select 0;

sleep 1;

waituntil {CHN_UNDEAD_INITIALIZED};

_module setvariable ["CHN_UNDEAD_SM_ACTIVE",true,true];

_zedtype="";

if (typeOf CHN_UNDEAD_MAINSCOPE=="CHN_UNDEAD_Logic") then {_zedtype="Infected"};

if (typeOf CHN_UNDEAD_MAINSCOPE=="CHN_UNDEAD_Logic2") then {_zedtype="Zombie"};

if (_zedtype=="") exitwith {};

_interval= _module getvariable "CHN_UNDEAD_SM_INTERVAL";

if (isnil "_interval") then {_interval=180};

_number= _module getvariable "CHN_UNDEAD_SM_NUMBER";

if (isnil "_number") then {_number=12};

_grptype= _module getvariable "CHN_UNDEAD_SM_GRPTYPE";

if (isnil "_grptype") then {_grptype="MIGRATING"};

_wppos= _module getvariable "CHN_UNDEAD_SM_WPPOS";

if ((_grptype=="MOVER") and (isnil "_wppos")) then {_grptype="STATIC"};

while {!isNull (_module)} do

{

if ((_module getvariable "CHN_UNDEAD_SM_ACTIVE") and (CHN_UNDEAD_ZEDCNT < CHN_UNDEAD_ZEDLIMIT)) then

{

switch (_grptype) do

{

case "STATIC" :

{

_grp=[position _module,_number] call CHN_UNDEAD_fn_CRSTATZEDGRP;

_module setvariable ["CHN_UNDEAD_SM_CURGRP",_grp,true];

};

case "NON-MIGRATING" :

{

_grp=[position _module,_number] call CHN_UNDEAD_fn_CRTZEDGRP;

_grp setvariable ["CHN_UNDEAD_NONMIGRP",true];

_module setvariable ["CHN_UNDEAD_SM_CURGRP",_grp,true];

};

case "MIGRATING" :

{

_grp=[position _module,_number] call CHN_UNDEAD_fn_CRTZEDGRP;

_module setvariable ["CHN_UNDEAD_SM_CURGRP",_grp,true];

};

case "MOVER" :

{

_grp=[position _module,_number,_wppos] call CHN_UNDEAD_fn_CRTZEDGRPMV2;

_module setvariable ["CHN_UNDEAD_SM_CURGRP",_grp,true];

};

};

sleep _interval;

};

sleep 0.1;

};

Thank you very much!

Dominic!

Share this post


Link to post
Share on other sites

I think I ran into this problem before. You have to re-use the group names....when a group is wiped out and respawns it has to respawn with the same group name.

Dont' have time right now to try to understand the code....but I think that might be the problem.

Share this post


Link to post
Share on other sites

My zombie missions do this:

#loop

{if (count units _x==0) then {deleteGroup _x}} forEach allGroups

~1

goto "loop"

Share this post


Link to post
Share on other sites
My zombie missions do this:

#loop

{if (count units _x==0) then {deleteGroup _x}} forEach allGroups

~1

goto "loop"

Hey guys, quick question, but is it possible to have the above script work for a whole side? Such as resistance? I've tried playin around with this but I can't seem to get it :\

Thank you,

Dominic

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×