• 📚 A new project from the admin: Check out PictureBooks.io, an AI storyteller that lets you create personalized picture books for kids in seconds. Give it a try and let me know what you think!

combat calculation... how?

sabrewolf

Demidemigod
Joined
Jan 11, 2004
Messages
142
Location
turicum, helvetistan
hi all
my modding experience so far has been limited to some XML changes and a few lines of code in the SDK... nothing with python at all. so my question may be a bit basic, sorry!

anyhow, i want to modify certain things displayed for the battle calculation (so when holding the right mouse button over an enemy unit).
these things include:
- display odds at peace time
- more info on battles like collateral damage being dealt out by suicide catapults
- more info on battles like odds change if cultural defence is gone, etc.

so my question is where i should even start looking. i think i have found the odds-calculation in CvUnit::updateCombat() [is this correct?], but have no clue where to find the mouse-over part in python, or how i could change the string/object returned.

i'm grateful for any help!

thanks and cheers
sabre
 
ok, so i've found the python part in CvEventManager.onCombatLogCalc and CvUtil.combatMessageBuilder
but i still don't quite understand where the pre-calculation works. the function in C++ CvUnit::updateCombat() is the real deal... the battle, not just the estimate.
 
Back
Top Bottom