Detecting combat results

lilgamefreek

Warlord
Joined
Oct 30, 2014
Messages
229
I need help finding a way to get combat information. In particular, the information I need is, in order of priority:

1.) The UnitType of the attacking unit.
2.) Whether the attack was a kill.
3.) The owner of the defending unit.
4.) Whether the attack resulted in a capture (Germany vs. barbarian style, not civilian worker's only).

Current leads I've pursued have been:
1.) CanSaveUnit and UnitKilledInCombat don't give me enough information on the attacker, though I may not have thought of something.
2.) EndCombatSim is not triggering, possibly because I have quick combat enabled. I need something not based in UI.
3.) I don't want to try monitoring the alert messages and parsing each one that comes through. This would also only work for the active player and not AI.

I've been racking my brain for a while on this and have been playing with alternatives as well. I figured I'd try and reach out for help before I completely give up however.
 
You're probably out of luck ... this is one of the most requested "events" in CivV.

EndCombatSim is intended to update the 3D map, so doesn't fire with quick combat (as you've discovered) and also doesn't contain enough details (as it's only meant to update graphics)

The alert messages (if you mean those that appear at the top of the screen) don't generate events so you can't trap them anyway

CanSaveUnit et al only have info about the defender, not the attacker ... and this is also true for most of the common work-arounds (using post combat promotions to detect an attack)

The only fool-proof way to get the combat info is via custom events in a modded DLL - which requires the source code, which we don't have for CivBE
 
Back
Top Bottom