davidoss 552 Posted January 4, 2016 This is next attempt to trying understand why "killed" eventhandler is not working right for me. //executed on server {{[_x] call INS_fnc_ckcivEH} foreach (units _x)} foreach _civ_groups; INS_fnc_ckcivEH server side //executed on server params ["_unit", "_ehkilledIdx"]; _ehkilledIdx = _unit addEventHandler ["killed", { params ["_cvictim", "_ckiller"]; ["Unnecessary civilian casualties detected!", "systemChat"] call BIS_fnc_MP; [[_cvictim, _ckiller], "INS_fnc_ckMP", WEST, false, false] call BIS_fnc_MP; }]; INS_fnc_ckMP global //executed on player params ["_cvictim", "_ckiller"]; [str _cvictim + "is the victim", "systemChat"] call BIS_fnc_MP; [str _ckiller + "is the killer", "systemChat"] call BIS_fnc_MP; diag_log format ["%1 -is the victim ### %2 -is the killer", _cvictim, _ckiller]; And after i kill some civilians this is returning: 22:22:31 "C Alpha 1-3:2 -is the victim ### C Alpha 1-3:2 -is the killer" 22:22:40 "C Alpha 1-3:4 -is the victim ### C Alpha 1-3:4 -is the killer" 22:22:59 "C Alpha 1-3:3 -is the victim ### C Alpha 1-3:3 -is the killer" 22:23:04 "C Alpha 2-3:2 -is the victim ### C Alpha 2-3:2 -is the killer" 22:23:10 "C Alpha 2-1:1 -is the victim ### C Alpha 2-1:1 -is the killer" Why? Share this post Link to post Share on other sites
donelsarjo 60 Posted January 4, 2016 Where do you get the parameter "_ehkilledIdx" from in your "params" array? I take a look at it when I am sober :P Share this post Link to post Share on other sites
davidoss 552 Posted January 4, 2016 Well, apparently. No errors are given Share this post Link to post Share on other sites
Nathan423 10 Posted January 4, 2016 What are you asking? if you want to display the name of the units, use name (veriable) to show the display name of the unit. Share this post Link to post Share on other sites
wesley32 4 Posted January 4, 2016 Are you using ACE3? If so, that's prob the issue. I have the same problem: https://forums.bistudio.com/topic/187040-kills-not-registering-properly/ Found out that the new ACE update messes up kills, the game thinks casualties suicided for some odd reason. Share this post Link to post Share on other sites
davidoss 552 Posted January 4, 2016 What are you asking? if you want to display the name of the units, use name (veriable) to show the display name of the unit. 22:22:31 "C Alpha 1-3:2 -is the victim ### C Alpha 1-3:2 -is the killer"it should be returned 22:22:31 "C Alpha 1-3:2 -is the victim ### B Alpha 1-1:1 (DaVidoSS) -is the killer" Share this post Link to post Share on other sites
davidoss 552 Posted January 4, 2016 Are you using ACE3? If so, that's prob the issue. I have the same problem: https://forums.bistudio.com/topic/187040-kills-not-registering-properly/ Found out that the new ACE update messes up kills, the game thinks casualties suicided for some odd reason. Yes i am using it. Lets try without, thanks wesley32 Share this post Link to post Share on other sites
davidoss 552 Posted January 4, 2016 You have damn right! ACE 3 is causing this madness "C Alpha 2-3:3 -is the victim ### B Alpha 1-1:1 (DaVidoSS) -is the killer" Share this post Link to post Share on other sites
davidoss 552 Posted January 4, 2016 Where do you get the parameter "_ehkilledIdx" from in your "params" array? I take a look at it when I am sober :P This is just private variable. Private variables can be joined into params array in right order (passed first). params ["_passedparam0", "_passedparam1", "_private", "_private1"]; _private = 0; _private1 = 1; Look this at bottom KK says. Man i have spend more than 20 hours trying to figure out why the event handler not fire. It was the ACE 3 causing this. Ehh Share this post Link to post Share on other sites
wesley32 4 Posted January 5, 2016 Took me a while to figure it out too, thought my code was broken at first. EH just fires for wrong unit. If you will, please post your issue on: https://github.com/acemod/ACE3/issues Hopefully this will get resolved quickly. :) Share this post Link to post Share on other sites
davidoss 552 Posted January 5, 2016 Just checked the MPKilled eventhandler. The same result as well. Share this post Link to post Share on other sites
barbolani 198 Posted January 5, 2016 Hi, Maybe you have an error here: {{[_x] call INS_fnc_ckcivEH} foreach (units _x)} foreach _civ_groups; Try to change it by: {_group = _x; {[_x] call INS_fnc_ckcivEH} forEach units _group; } orEach _civ_groups; And see what happens... Share this post Link to post Share on other sites
davidoss 552 Posted January 5, 2016 No need. No errors are given. Without ace works perfect Share this post Link to post Share on other sites
barbolani 198 Posted January 5, 2016 Damm mods modifying our variables ;) Share this post Link to post Share on other sites