Error with Death Messages

seaweeduk

OpenDayZ Rockstar!
I'm running reality with the death message package. The messages stopped working a while back presumably when I have added a mod. I've even gone as far as to rebuild reality before and add my mods again, still couldn't pin point which one was causing the issue. Hopefully someone on here can help me locate the issue.

My rpt logs show the following

Code:
14:07:55 "PDEATH: Player Died 72434822"
14:07:55 Error in expression <lect 3;
_playerName =    _this select 4;
 
_victim removeAllEventHandlers "MPHit";
>
14:07:55  Error position: <_victim removeAllEventHandlers "MPHit";
>
14:07:55  Error Undefined variable in expression: _victim
14:07:55 File z\addons\dayz_server\compile\server_playerDied.sqf, line 9
 
13:36:33 "PDEATH: Player Died 97947654"
13:36:33 Error in expression <lect 3;
_playerName =_this select 4;
 
_victim removeAllEventHandlers "MPHit";
>
13:36:33  Error position: <_victim removeAllEventHandlers "MPHit";
>
13:36:33  Error Undefined variable in expression: _victim
13:36:33 File z\addons\dayz_server\compile\server_playerDied.sqf, line 9

To me that reads like _victim the variable referenced on line 9 of server_playerDied.sqf is null ?

For reference all of my files relating to death messages are the same as the files shown in this tutorial - http://dayz.st/w/Kill_Messages#CODE_CHANGES

I noticed this line in fnc_plyrHit.sqf, I never see these messages in my debug logs either

Code:
diag_log format["PHIT: %1 (%5) was hit by %2 (%6) with %3 from %4m", _victim, _attacker, _weapon, _distance, _victimPlayerID, _attakerPlayerID];
I do however see messages like this in my rpt from mphit
Code:
13:33:43 "Adding MPHit EH for B 1-1-D:1 (Deathdude) REMOTE"
Any help you guys could give me in troubleshooting to find the source of this error would be greatly appreciated :)
 
The code they posted is crap ...

Code:
private["_characterID","_minutes","_newObject","_playerID","_key","_playerName","_playerID","_myGroup","_group","_victim", "_killer", "_weapon", "_message", "_distance","_loc_message","_victimName","_killerName","_killerPlayerID"];
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
_characterID =    _this select 0;
_minutes =        _this select 1;
_newObject =    _this select 2;
_playerID =    _this select 3;
_playerName =    _this select 4;
 
_victim removeAllEventHandlers "MPHit";
 
_victim = _this select 2;

you can see here that they try to remove the MPHit EHs from the victim BEFORE the script assigns the dead unit to the _victim object ...

change to:

Code:
private["_characterID","_minutes","_newObject","_playerID","_key","_playerName","_playerID","_myGroup","_group","_victim", "_killer", "_weapon", "_message", "_distance","_loc_message","_victimName","_killerName","_killerPlayerID"];
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
_characterID =    _this select 0;
_minutes =        _this select 1;
_newObject =    _this select 2;
_playerID =    _this select 3;
_playerName =    _this select 4;
_victim = _this select 2;
 
_victim removeAllEventHandlers "MPHit";

and you are set.

Sarge, shaking his head about people that actually earn money without knowing what they do ...
 
The code they posted is crap ...

Code:
private["_characterID","_minutes","_newObject","_playerID","_key","_playerName","_playerID","_myGroup","_group","_victim", "_killer", "_weapon", "_message", "_distance","_loc_message","_victimName","_killerName","_killerPlayerID"];
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
_characterID =    _this select 0;
_minutes =        _this select 1;
_newObject =    _this select 2;
_playerID =    _this select 3;
_playerName =    _this select 4;
 
_victim removeAllEventHandlers "MPHit";
 
_victim = _this select 2;

you can see here that they try to remove the MPHit EHs from the victim BEFORE the script assigns the dead unit to the _victim object ...

change to:

Code:
private["_characterID","_minutes","_newObject","_playerID","_key","_playerName","_playerID","_myGroup","_group","_victim", "_killer", "_weapon", "_message", "_distance","_loc_message","_victimName","_killerName","_killerPlayerID"];
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
_characterID =    _this select 0;
_minutes =        _this select 1;
_newObject =    _this select 2;
_playerID =    _this select 3;
_playerName =    _this select 4;
_victim = _this select 2;
 
_victim removeAllEventHandlers "MPHit";

and you are set.

Sarge, shaking his head about people that actually earn money without knowing what they do ...


Weird thing is I've never applied that code directly, just found that tutorial when debugging I just compared it with my own reality files

I'm gonna do another diff now on the two to check, and try your code :)

edit: yup my file was the same as that one, not any more though :D
 
Hmm gave it a quick test, we didn't have an rpt file errors now which makes me smile at least. No death message either but I remember they didn't work 100% of the time anyway originally. Will do some more testing. Also no PHIT messages in my logs yet.

Mostly I'm just glad to see the annoying errors gone from my rpt file, thanks for the help sarge looks like I was on the right track at least.

My next plan is for some code to log to new tables the kill information for more detailed stats :D
 
Judging by the code if _killerName must be null for whatever reason, I'll keep trying different things.

I wish I was better with github, all I want to do is view the changes between default reality and reality + death messages so I can compare with my files and check another mod hasn't changed something.

No rpt errors now just MPHit followed by PDEATH
 
You could attempt the one on the dayz.st wiki, cant guarentee it would work on other servers, but it was the only one i cud get working
 
worked fine for me when i put it on several servers, yet note i said - cant guarentee it wont work on his server as its not dayz.st
 
worked fine for me when i put it on several servers, yet note i said - cant guarentee it wont work on his server as its not dayz.st
Yeah thats the one I linked in the OP, tried it after the reality package wasn't working.

At a bit of a dead end at the moment and am probably going to try yet another reality default build + death messages, before adding my mods one at a time yet again :(
 
sorted it buddy :) had the same issue in a different context.

The messages only show IF the killer has a radio on him ... at least that fixed it for me here.

Sarge
 
sorted it buddy :) had the same issue in a different context.

The messages only show IF the killer has a radio on him ... at least that fixed it for me here.

Sarge


:confused: Serious?

I had them working by default and definitely didn't need a radio, seems like a strange issue being as it's not an item in dayzmod?

Your word is gospel in my eyes anyway Sarge so I'm going to try it later :)
 
it was weird here as well, i was really not getting why it shouldnt work.

And i was pretty sure it worked in the past, i used sidechat to transmit hit/kill messages for my AI ...

Still might have overlooked something, but it's at least worth giving it a try ...

just restested ... sidechat messages with radio work like a charm ... without radio no messages show up.

No clue what changed that, might have been one of the last Arma patches ?

Sarge
 
it was weird here as well, i was really not getting why it shouldnt work.

And i was pretty sure it worked in the past, i used sidechat to transmit hit/kill messages for my AI ...

Still might have overlooked something, but it's at least worth giving it a try ...

just restested ... sidechat messages with radio work like a charm ... without radio no messages show up.

No clue what changed that, might have been one of the last Arma patches ?

Sarge

I do remember seeing in that dayz.st tutorial you needed to comment out enableRadio false in your init.sqf, I don't have this line anyway but maybe I'll try setting it to true

Code:
//enableRadio false;

I was being derpy before, managed to find all the files reality changes to add the kill messages today, pretty sure mine all match up already though

https://github.com/thevisad/DayZ-Private-master/tree/master/pkgs/pkgnam/killmsgs

Thanks for the help anyway mate, wish I wasn't at work so I could try it now :)

edit: weird thing is the default reality code has the same code which caused my original error

https://github.com/thevisad/DayZ-Pr...pkgnam/killmsgs/compile/server_playerDied.sqf
 
Back
Top