Jump to content
Sign in to follow this  
PartyHead

I've got a strange "killed" eventHandler problem ???

Recommended Posts

I've got a strange "killed" eventHandler problem ??? I'm sure this wasn't always like this but when i place for example an EAST unit and an WEST unit on a map in the editor, and using a simple hint like the example below, in the init.sqf

// init.sqf

_sideE = side mane;
_sideW = side manw;

hint format ["Side of mane: %1.\nSide of manw: %2.", _sideE, _sideW];

I get the correct return like below.

Side of mane: EAST. (correct)

Side of manw: WEST. (correct)

But when I give the EAST unit an addEventHandler like the example below.

this addEventHandler ["killed",{hint format ["Side of killed: %1.\nSide of killer: %2.", (side (_this select 0)), (side (_this select 1))];}];

I get an incorrect return like below.

Side of killed: CIV. (incorrect)

Side of killer: WEST. (correct)

Its happening with all units and its always the same return, the killed units side is always returning CIV no matter what there side is and the killers side is always returning correct.

I've tried doing a reinstalling thinking that would fix it but it didn't.

Anyone one else having or have had this problem ?

I don't know how to fix it ?

Share this post


Link to post
Share on other sites

Dead units are civilian, you already know the side of the dead unit so it can be a fixed variable "EAST"

this addEventHandler ["killed",{hint format ["Side of killed: %1.\nSide of killer: %2.", "East", (side (_this select 1))];}];

if you really need to get the original side of the unit then this should help.

http://forums.bistudio.com/showthread.php?129533-Original-side-of-renegade-unit&p=2082557&viewfull=1#post2082557

Share this post


Link to post
Share on other sites

Dead bodies are side CIV - you will have to get the side of the group:

side (group (_this select 0));

If you have something running that deletes empty groups this may not work so you would have to go with the getNumber example in the link given above.

Edited by Mattar_Tharkari

Share this post


Link to post
Share on other sites
Dead units are civilian, you already know the side of the dead unit so it can be a fixed variable "EAST"

this addEventHandler ["killed",{hint format ["Side of killed: %1.\nSide of killer: %2.", "East", (side (_this select 1))];}];

if you really need to get the original side of the unit then this should help.

http://forums.bistudio.com/showthread.php?129533-Original-side-of-renegade-unit&p=2082557&viewfull=1#post2082557

Dead bodies are side CIV - you will have to get the side of the group:

side (group (_this select 0));

If you have something running that deletes empty groups this may not work so you would have to go with the getNumber example in the link given above.

Thanks for these replies guys you answered my question and helped me a lot.

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  

×