Jump to content
BlackbirdSD

Get notification when friendly AI killed?

Recommended Posts

Id like to get a radio or written message when my friendly AI units get killed that are not in my group.

 

Thanks

Share this post


Link to post
Share on other sites

Create file on mission root named -> initPlayerLocal.sqf

Paste this in:

Quote

{
    if (side _x == side player) then{
        _x addEventHandler ["Killed",
            {
                params ["_unit", "_killer", "_instigator", "_useEffects"];

                //Report man down
                [_unit] spawn{
                    params ["_unit"];
                    sleep (2 + (random 8));
                    if (leader (group _unit) != _unit) then{
                        if (alive leader (group _unit)) then{
                            leader (group _unit) sideChat "Man down!";
                        };
                    }else{
                        if (count units group _unit > 1) then{
                            (units group _unit) select 1 sideChat "Man down! Lead is down!";
                        };
                    };
                };
            }
        ];
    };
}forEach allunits;

  • Like 1

Share this post


Link to post
Share on other sites

Will that announce the name of the ai or just that a team mate is killed?   I pasted it in but saw no effect when I killed my own ai to test.

Share this post


Link to post
Share on other sites
13 hours ago, BlackbirdSD said:

Will that announce the name of the ai or just that a team mate is killed?   I pasted it in but saw no effect when I killed my own ai to test.

 

You get the group name/callsign on the chat text, and then just the phrase "Man down!".

You need someone alive to report man down or you'll get no message.

 

VaKtkMt.jpg

Edited by RCA3

Share this post


Link to post
Share on other sites

All I get is cease fire while shooting at them.  I had another ai standing right beside and no announcement that I killed the guy.  I didn't edit your script at all just copy and pasted it in.

Share this post


Link to post
Share on other sites
On 12/12/2019 at 11:11 PM, BlackbirdSD said:

that are not in my group. 

 

Are they on your group?

Share this post


Link to post
Share on other sites

Hello here Guys !

 

Here is something simple :

addMissionEventHandler ["EntityKilled",
{
	params ["_killed", "_killer", "_instigator"];
	if(isNull _instigator)then{_instigator = UAVControl vehicle _killer select 0}; // UAV/UGV player operated road kill
	if(isNull _instigator)then{_instigator = _killer}; // player driven vehicle road kill

	diag_log format ["________________	Killed	: %1	Killer : %2	________________",_killed,_killer];
	
	if!((side group _killed) isEqualto playerside)exitwith{systemChat "!playerside";};

	_systemChat_notification		= true;			//	Show systemChat notification
	_sideChat_notification			= true;			//	Show sideChat notification
	_side_of_sideChat				= playerside;	//	https://community.bistudio.com/wiki/Side	or	ex: west
	_identity_of_sideChat			= "HQ";			//	https://community.bistudio.com/wiki/sideChat


	if (_systemChat_notification) then {
		[format["%1    K  .  I  .  A  .", _killed]] remoteExec ["systemChat", 0, true]; 
	};

	if (_sideChat_notification) then {
		[[_side_of_sideChat,_identity_of_sideChat],format["%1    K  .  I  .  A  .", _killed]]remoteExec ["sideChat", 0, true]; 
	};
}];

there is more stuff to check in the :

 

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, BlackbirdSD said:

No

As i said, you need someone alive (on dead guy's group) to report man down or you'll get no message. It works for me.

Try George's option too.

  • 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

×