Page 1 of 1
Unit destroyed by
Posted: Sat Dec 18, 2021 9:21 pm
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?
RE: Unit destroyed by
Posted: Mon Dec 20, 2021 2:35 am
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.