Jump to content
Sign in to follow this  
Chesty'sGhost

Civilian Death Notification

Recommended Posts

I am looking for ways to use a trigger to notify the players when civilians have been killed. Right now, I have groups of civilians huddled in different spaces that aren't tied to anything in particular. My vision is to make one trigger that notifies the player whenever any civilian from any of these groups has been killed. Is this possible without having to name every single civilian and making a trigger for each one? I'm not super familiar with tools outside of the actual Arma mission editor, but am certainly willing to learn more if it makes this process easier. Thanks to all who respond!

Share this post


Link to post
Share on other sites

Looked at that, still fairly unsure how that would be used to apply what my intent is. Again, not very experienced in the world of coding, just watched youtube mostly, so a barney-style break down would be helpful.

Share this post


Link to post
Share on other sites

https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Killed

 

So I guess the easiest way to use the event handler would be to put it in the init of each of the units (assuming you've placed them there in the editor, if they're being spawned in, it's a slightly different process). Just add some form of message to the EH and it should all work out:

this addEventHandler ["Killed", {
	systemChat "A civ has been killed.";
}];

There's more you could do, like different styles of message, say where the civy was or was near when they died, who killed them, etc, but it all depends on what you're doing.

  • Like 1

Share this post


Link to post
Share on other sites

Gotcha, I essentially did the following:

 

a1 addEventHandler ["killed",
{
    hint "A civilian has been killed! Be more careful Marines!";
}];

 

I built that for a1-48 (a bit painstaking) and it seems to have functioned. Thanks for the response! Any clue how to make the notification conditional upon adfor/blufor?

Share this post


Link to post
Share on other sites

serverside:

Quote

 

addMissionEventHandler ["EntityKilled", {

    params ["_unit"];

 

    if !(_unit isKindOf "CAManBase") exitWith {};

    private _side = side (group _unit);

 

    if (_side isEqualTo civilian) then {

      hint "A civilian has been killed! Be more careful Marines!";

    };

  }];

 

 

  • Like 2

Share this post


Link to post
Share on other sites

Is there a way to set a variable with counter of how many civs have been eliminated? For example when 5 civs are down, 5 new rebels spawn at houses and go seek out the players? When counter reaches f.e. 10 an armored vehicle enters the sector with new rebel squad.

Share this post


Link to post
Share on other sites
GVAR(confirmedKills) = 0;

addMissionEventHandler ["EntityKilled", {
    params ["_unit"];

    if !(_unit isKindOf "CAManBase") exitWith {};
    private _side = side (group _unit);

    if (_side isEqualTo civilian) then {
      GVAR(confirmedKills) = GVAR(confirmedKills) + 1;
    };
  }];

In my case GVAR(confirmedKills) expands to Krzyc_confirmedKills, so it's possible to use it somewhere else.

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  

×