Jump to content
Sign in to follow this  
fawlty

Delete Blufor via trigger

Recommended Posts

I'm trying to delete all Blufor ground forces via the area inside a trigger zone.

I could do this in zeus but using a radio to activate in this situation works better.

I found this but it deletes opfor and civilians as well but it's on the right track. 

 

cleanUp = (allUnits + vehicles) inAreaArray Trig1;
{if ((_x isKindOf "man") || (getNumber (configFile >> "CfgVehicles" >> (typeOf _x) >> "side"))  == 0)then 
{deleteVehicle _x;};}forEach cleanUp;

 

Any suggestions

Share this post


Link to post
Share on other sites
51 minutes ago, fawlty said:

I'm trying to delete all Blufor ground forces via the area inside a trigger zone.

I could do this in zeus but using a radio to activate in this situation works better.

I found this but it deletes opfor and civilians as well but it's on the right track. 

 

cleanUp = (allUnits + vehicles) inAreaArray Trig1;
{if ((_x isKindOf "man") || (getNumber (configFile >> "CfgVehicles" >> (typeOf _x) >> "side"))  == 0)then 
{deleteVehicle _x;};}forEach cleanUp;

 

Any suggestions

Deletes blufor units and blufor vehicles inside of Trig1

_BluforInTrig = (AllUnits + Vehicles) InAreaArray Trig1;//gets all units and vehicles inside of Trig1

{
	if ((getNumber (configFile >> "CfgVehicles" >> (typeOf _x) >> "side")) == 1) then//gets side of _x(unit or vehicle)
    {
    	DeleteVehicle _x;//if the side is West(1 is equal to West/blufor in this case) then delete it
    };	
} ForEach _BluforInTrig;

heres the number equivalent for sides

https://community.bistudio.com/wiki/CfgVehicles_Config_Reference#side

  • Like 2

Share this post


Link to post
Share on other sites

GK, can I just cut and paste this right into the trigger activation as is?

Share this post


Link to post
Share on other sites
19 minutes ago, fawlty said:

GK, can I just cut and paste this right into the trigger activation as is?

should be able to, if your doing it in the trigger itself, consider using thislist instead of inareaarray

Share this post


Link to post
Share on other sites

No Go GK, I get a error message    missing ;

when pressing OK for the trigger in the editor

 

I do want to activate the trigger via Radio Bravo

Share this post


Link to post
Share on other sites
14 minutes ago, fawlty said:

No Go GK, I get a error message    missing ;

when pressing OK for the trigger in the editor

 

I do want to activate the trigger via Radio Bravo

did you remove the comments before pasting it into the trigger in the editor? you cant have //comments in the trigger

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Ok got it, had to lay it out in a text editor to get it and it works as required.

 

"InAreaArray" worked fine

 

Appreciate your patience, 

Thanks

 

 

 

  • Like 1

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  

×