Jump to content
Dj Rolnik

Kill units inside a trigger

Recommended Posts

Hey everyone,

 

I would like to ask for help with a relatively simple concept that for some reason I cannot find a solution to.

I would like to create a scenario in which whatever human entity is within an area upon a press of a button, that entity (entities) are killed. 

 

The way I see it is to make an area trigger in which those entities would be placed or walk into (either blufor, opfor or civilian) and upon pressing an individual button (which would presumably set the trigger condition to true) the entities within that trigger area would receive fatal damage.

 

The problem I have is that it cannot be a predefined unit that I would name beforehand, because the players would have the option to choose the victim. This means it has to be some kind of criteria which checks for all alive human entities inside the trigger and apply damage to all of them. That's the part I am struggling to get to wrap my head around. 

 

Any suggestions will be super welcome. Thanks! 

Share this post


Link to post
Share on other sites

@Dj Rolnik, if you set that trigger can be activated by any, thisList array will contain entities that are inside trigger area. Then you can write in "On act." field something like this:

{
    if ((_x isKindOf "CAManBase") and { alive _x } and { (side (group _x)) == blufor }) then {
        _x setDamage 1;
    };
} forEach thisList;

 

  • Like 4
  • Thanks 2

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

×