Jump to content
Sign in to follow this  
Heaney

Continuously Delete Civillians In A Trigger But Not Empty Blufor & Opfor Vehicles?

Recommended Posts

Hello.

I want to have a trigger that continuously deletes:

  • Civillians
  • Civillian Vehicles
  • Animals

In the triggers area of effect.

However, I do NOT want to delete empty Blufor vehicles, but the problem is that empty vehicles are assigned civillian.

So basically I tried a continuous trigger with the condition civillian present and the on act being

{deleteVehicle _x} forEach thisList

But is there any way I can get this to exclude my empty vehicles that I have placed?

I think I need to stick something in the empty vehicles' init field to make them excluded, or maybe I can add something to the trigger to exclude them??

Bare in mind there are about 20 vehicles that need to be excluded.

Thanks in advance for any help!

Share this post


Link to post
Share on other sites

Edit 2:

tested in SinglePlayer

civilian present repeated trigger.

condition:

({(getNumber (configFile >> "CfgVehicles" >> (typeOf _x) >> "side")) == 3} count thisList) > 0

on act:

{
if (!isNull _x AND (getNumber (configFile >> "CfgVehicles" >> (typeOf _x) >> "side")) == 3) then {
	if (!(_x isKindOf "Man")) then {{_x setPos (getPos _x); deleteVehicle _x} foreach crew _x};
	_x setPos (getPos _x);
	deleteVehicle _x;
};
} foreach thisList;

Edit again, added _x setPos (getPos _x); to code outside iskindof check, reason: bus filled with civvis failed to delete all and caused massive FPS drop.

Now working without lag.

Edited by Demonized

Share this post


Link to post
Share on other sites

close Demonized ;)

{if ((getNumber (configFile >> "CfgVehicles" >> (typeOf _x) >> "side")) == 3) then {_x setPos (getPos _x); deleteVehicle _x}} foreach thisList;

3 = civilian

unless there is a typo in yours that I can't see.

Share this post


Link to post
Share on other sites

yeah, i just guessed first with getText civilian instead of number before i checked Six config browser :D

Edit: however there was required some additional code since vehicles seems to be taken first in thisList so passengers exited vehicle upon delete and trigger never reactivated, hence the iskindof and crew part of code.

And the condition part needed to be so or use a global variable to turn on / off trigger since empty bluefor vehicles registrers as civilian and they also stopped the trigger from reactivating.

Edited by Demonized

Share this post


Link to post
Share on other sites

It works! It works!

Thank you so much Demonized, and F2k Sel!

Share this post


Link to post
Share on other sites

Old thread, but I just came across this. Thanks!

EDIT: Actually, I'm running into some issues with this. It seemed to work the first time I ran it, but then it stopped working and the damn civis got into the area I want to keep them out of. I fiddled with some trigger settings, like setting the activation to Civilian Present, but that only deleted empty objects like furniture (folding tables and chairs, empty cars, etc.). Not sure if it's bc I'm using a custom-made island (shouldn't be an issue), but I had to delete the trigger for now.

Edited by h34dup

Share this post


Link to post
Share on other sites

Sorry for resurrecting this old thread, but after a lot of searching I found it is the only one that nails precisely on the issue I have.

This script works well on single player, but unfortunately does not work on a dedicated server and the base gets a lot of civilian vehicles crashing arround with everything. Is there any way to enable this trigger for dedicated servers?

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  

×