Jump to content
wesley32

Kills not registering properly

Recommended Posts

Hi guys,

I'm having an issue where kills aren't properly registered. Whenever I kill an enemy through headshot it works fine (a hint pops up), but when I shoot at the body armor of an enemy (take about 8-9 shots to make the kill) it doens't.

I added a killed EH to the unit and used the following code to determine the issue:

_killed = _this select 0;

_killer = _this select 1;

killerName = getText (configFile >> "cfgVehicles" >> typeOf _killer >> "displayname"); //Get the displayname of the killer

_killed addAction ["Show killer", "hint format ['Killed by: %1',killerName]"]; //Add action to body and show displayname of killer though a hint

When I headshot and the kill registers properly with killhint, I use the 'Show Killer' action on the body. It shows my own display name. This is supposed to happen.

When I shoot at body armor and no killhint shows up, I use the 'Show Killer' action on the body. It shows the killed soldiers' own displayname.

Anyone has any idea how this can be? It seems like when you kill by shooting at body armor, the killed suicides?

Hope someone can shed some light on this, seems like some black magic stuff going on if you ask me :mellow:

Cheers!

Share this post


Link to post
Share on other sites

Any chance we can see a little more of the script in context?

 

Not sure yet if I have any legitimate idea what the issue is but it would help to see a more complete picture

Share this post


Link to post
Share on other sites

Any update to this? did you find a way around the ace issue?

Share this post


Link to post
Share on other sites
On 7/7/2019 at 8:58 AM, PSYKO_nz said:

did you find a way around the ace issue?

Instead of _killer in the EH. use
_killed getVariable "ace_medical_lastDamageSource"
or
_killed getVariable "ace_medical_lastInstigator"

Share this post


Link to post
Share on other sites

If you are trying to write a script for ACE/Vanilla compatibility I would use something like this...

 

Check if ACE medical is running: Perhaps place this in your init.sqf

//ACE CHECK
if (!(isNil "ACE_Medical_enableFor") && {ACE_Medical_enableFor isEqualTo 1}) then {ACE_MEDICALACTIVE = false;} else {ACE_MEDICALACTIVE = true;};

 

Then you can run the killed EH with checks - 

 

 

if (ACE_MEDICALACTIVE) then
{
	//_killed getVariable "ace_medical_lastDamageSource"
	//_killed getVariable "ace_medical_lastInstigator"
}
else
{

};


 

I would use that to just define the necessary variables and not place entire code blocks in either section.

 

This is just off the top of my head.

Share this post


Link to post
Share on other sites

ok so this looks like the script that is handling the killed enemy (I think) but I can't find _killer anywhere, I also did a full search of the mission folder and couldn't find _killer anywhere in it

the script is called "Handleenemykilled.sqf"

here is the content

 

Spoiler

_player = _this select 1;
//hint getPlayerUID _player;
//[] call TFIDM_fnc_updateClientData;

{
    scopeName "loop";
    if (getPlayerUID _x == getPlayerUID _player) then {
        _alive = {alive _x && simulationEnabled _x} count playableUnits;
        _total = count playableUnits;
        [[1, _total, _alive, wave], "TFIDM_fnc_receiveServerData", owner _x, false] spawn BIS_fnc_MP;
        [["KillAdded",[]], "BIS_fnc_showNotification", owner _x, false] spawn BIS_fnc_MP;
        breakOut "loop";
    };
} forEach playableUnits;

sleep 5;
deleteVehicle (_this select 0);

 

here's the mission in trying to get to work with it
 


event handlers are way out of my depth and I'm trying to learn about them but I'm a bit slow haha thanks for your help guys 🙂

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

×