Page 1 of 1

Who killed it?

Posted: Sat Jun 20, 2020 5:35 pm
by vettim89
So I have a scenario where there are three sides: player, allied, and enemy

I am trying to set up an event for points if an enemy unit is destroyed but only want the points to go to the player if he/she is the one doing the killing. I don't want kills by the allied side to count. How do I do this?

RE: Who killed it?

Posted: Sat Jun 20, 2020 7:09 pm
by michaelm75au
In the damaged/destroyed event, UnitY, if defined, is the weapon that caused the damage in the event. So you could check the side of that.

Note that if the damage is from something else (like fires, flood), the UnitY() would not be set. Also you have the issue of multiple weapons hitting the UnitX - there might be a mix of sides.