whoward69
DLL Minion
... what would trigger it and what data would be required?
Firaxis use "kill" to mean when a unit is removed from play for any reason. This is not just combat, but also includes upgrades, special abilities (GP builds, religious actions, etc), founding a city, building a work boat, etc, etc, etc
Modders tend to use "kill" to mean "died in combat".
So if there was a "UnitDied" event for when a unit dies from direct or indirect combat a) under what situations does this need to trigger, and b) what parameters would be needed for such an event?
I think there are the following ways for a unit to die during combat
While attacking
While defending
3rd party
Ignoring the (not insignificant) problem that by the time the Lua event is trigger the unit has probably been removed from the game core, what parameters would need to be passed to such an event
iPlayer - the player owning the deceased unit
iUnit - the id of the deceased unit
iPlotX, iPlotY - the plot the unit died on
iOtherPlayer - the player doing the killing
iOtherUnit - the id of the killing unit (may be nil/-1)
iOtherCity - the id of the killing city (may be nil/-1)
iOtherPlotX, iOtherPlotY - the plot the killing unit/city was on
Thoughts?
Firaxis use "kill" to mean when a unit is removed from play for any reason. This is not just combat, but also includes upgrades, special abilities (GP builds, religious actions, etc), founding a city, building a work boat, etc, etc, etc
Modders tend to use "kill" to mean "died in combat".
So if there was a "UnitDied" event for when a unit dies from direct or indirect combat a) under what situations does this need to trigger, and b) what parameters would be needed for such an event?
I think there are the following ways for a unit to die during combat
While attacking
- another unit (melee, naval)
- air/missile strike
- a city
While defending
- a melee attack
- a ranged attack (bows, siege, naval, air, missile)
- a city bombardment
3rd party
- air interception
- attrition from terrain/features
- attrition from improvements (eg citadels)
- via Lua (specifically pUnit:ChangeDamage())
Ignoring the (not insignificant) problem that by the time the Lua event is trigger the unit has probably been removed from the game core, what parameters would need to be passed to such an event
iPlayer - the player owning the deceased unit
iUnit - the id of the deceased unit
iPlotX, iPlotY - the plot the unit died on
iOtherPlayer - the player doing the killing
iOtherUnit - the id of the killing unit (may be nil/-1)
iOtherCity - the id of the killing city (may be nil/-1)
iOtherPlotX, iOtherPlotY - the plot the killing unit/city was on
Thoughts?