Who killed it?

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
User avatar
vettim89
Posts: 3743
Joined: Fri Jul 13, 2007 11:38 pm
Location: Toledo, Ohio

Who killed it?

Post 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?
"We have met the enemy and they are ours" - Commodore O.H. Perry
User avatar
michaelm75au
Posts: 12464
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Who killed it?

Post 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.
Michael
Post Reply

Return to “Lua Legion”