Craig_Sutter
Deity
I need to derive the name of unit killed in combat. I have found possibilities in the following two functions:
GameEvents.CanSaveUnit
GameEvents.UnitKilledInCombat
Correct me if I am wrong, but it looks like UnitKilledinCombat only gives me the unit type (ie. UNIT_WARRIOR). However, it does not give me the identity of the particular unit killed.
On the other hand, from my reading, I think I can use CanSaveUnit. The problem is that I cannot seem to find the arguments for it... I could not find it as a GameEvent in the Wiki and do not know where to look to get the arguments. I think it does give the plot position of the killed unit... from which I can probably derive the identity of said unit.
So, what are the parameters of CanSaveUnit?
And how can I derive the identity of a particular unit from those parameters (not the type)? In my case, I need to get the particular unit's identity... derive its name from that ("Earl of Northumbria (Earl)")... check that the actual unit name matches that particular unit...delete a dummy building on that basis.
Assuming that all instances of unit destruction including death in combat cause the functions above to fire off... I am also going to have to use hex position to match it to the unit's capital city (since the may "die" there as it is also a spaceship part that disappears when used in the capital).
Thank-you for your assistance.
GameEvents.CanSaveUnit
GameEvents.UnitKilledInCombat
Correct me if I am wrong, but it looks like UnitKilledinCombat only gives me the unit type (ie. UNIT_WARRIOR). However, it does not give me the identity of the particular unit killed.
On the other hand, from my reading, I think I can use CanSaveUnit. The problem is that I cannot seem to find the arguments for it... I could not find it as a GameEvent in the Wiki and do not know where to look to get the arguments. I think it does give the plot position of the killed unit... from which I can probably derive the identity of said unit.
So, what are the parameters of CanSaveUnit?
And how can I derive the identity of a particular unit from those parameters (not the type)? In my case, I need to get the particular unit's identity... derive its name from that ("Earl of Northumbria (Earl)")... check that the actual unit name matches that particular unit...delete a dummy building on that basis.
Assuming that all instances of unit destruction including death in combat cause the functions above to fire off... I am also going to have to use hex position to match it to the unit's capital city (since the may "die" there as it is also a spaceship part that disappears when used in the capital).
Thank-you for your assistance.