Unit destroyed by

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
nogravity
Posts: 51
Joined: Fri Jun 15, 2012 12:02 am

Unit destroyed by

Post by nogravity »

Is it possible to find out the side that destroyed an unit in Lua functions? Currently, the Command trigger get fired when an unit is damaged or destroyed but I cannot find a way to tell which side destroy or damage the unit. Is there a way?
musurca
Posts: 168
Joined: Wed Jul 15, 2020 10:06 pm
Contact:

RE: Unit destroyed by

Post by musurca »

This was just recently discussed here: fb.asp?m=5101348

Short version: with many caveats, calling ScenEdit_UnitY() from a script after a damaged/destroyed trigger will USUALLY give you the weapon that destroyed it as a Unit. You can get the side from that Unit's wrapper.
Post Reply

Return to “Lua Legion”