Jump to content
Sign in to follow this  
1para{god-father}

How to Delete a Group

Recommended Posts

If I wanted to delete a Group I have spawned how do I delete the Group when i no longer need them ?

_upsgrp1 = [1,_positionToSpawnIn,1,["ambush1","spawned","showmarker","delete:",30,"respawn:",5]] execVM "SCRIPTS\UPSMON\MON_SPAWN.SQF";

I thought this would work but it does not :(

deletevehicle _upsgrp1;

Share this post


Link to post
Share on other sites
{deleteVehicle _x} forEach units _svGroup;  // If anyone in the group is alive, delete them
deleteGroup _svGroup;  // Free up the group slot.

Share this post


Link to post
Share on other sites

Thanks , but still getting an error this is frommy.rpt

  Error position: <units _upsgrp1;  
deleteGroup _upsgrp1; >
 Error units: Type Script, expected Object,Group

ANy idea why ? the group is 100% called _upsgrp1

Share this post


Link to post
Share on other sites

execVM returns a "script handle", not a group. If you were using the BIS_fnc_spawnGroup function then you'd get the group back, but running that UPS script as is doesn't give you the actual group it creates.

I'm fairly certain that script has it's own cleanup routines though so you don't need to worry about deleting the group as the script will do so for you. (the delete: 30 stuff).

Share this post


Link to post
Share on other sites

Hmmmmm

This is not to remove dead body's it was to remove the Patrol once i have left an area and no longer need that group , they will probably still be alive.

As a work around if i cannot delete them could i kill them all ? if so how ?

Share this post


Link to post
Share on other sites

You could have a trigger that just deletes all opfor in the area or something.

Share this post


Link to post
Share on other sites

_upsgrp1 = [1,_positionToSpawnIn,1,["ambush1","spawned","showmarker","delete:",30,"respawn:",5]] execVM "SCRIPTS\UPSMON\MON_SPAWN.SQF";

_upsgrp1 is not the name of the group but the scripthandle (internal name of the script) which comes to use with commands like scriptDone.

The error clearly states this:

Error position: <units _upsgrp1;

deleteGroup _upsgrp1; >

Error units: Type Script, expected Object,Group

The term "group" in the command deleteGroup isn't meant as "bunch of people" but like a container. You have to delete all units from that group first before you can delete the container.

To achieve this you would have to know how the script MON_SPAWN.sqf names the groups and catch this name for a later deletion.

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  

×