I'm putting this into BULL now and had a quick question. Is getCombatOddsSpecific() a new function created for ACO? If so, I'm going to move it to its own file to avoid including a copy of CvGameCoreUtils.cpp. Yes, it requires adding the file to the build targets in the make file (a PITA to be sure), but it's cleaner IMHO, and I already had to add files to the makefile for BULL.
This doesn't change ACO or require anything on your end. I just wanted to make sure I hadn't missed something. BTW, if it is a new function, you don't need to export it in the DLL since the EXE won't use it.
getCombatOddsSpecific() is the new function I put in ACO, yes. Although the name of it mightn't suggest it, it's actually a more
general function than the similar function in the original game
getCombatOdds(). The difference is getCombatOddsSpecific() returns the probability of battle outcomes where the number of hits taken by the defender and attacker are specified. So rather than just returning the one value for the combat odds, it can return the several values for each combat outcome.
Do whatever you need to do with it. Perhaps you can make whatever changes you need to then mail it back to me and I'll make it v1.1. I might as well make the latest version be the same as the one you're putting into BULL.
Re it not being needed to be exported to the DLL: lol well I guess I'm a bit of a hack because I did it hoping it would work and it worked so I used it.
I'm not a programmer by profession, which you can probably tell by the structure/layout of my code!
Nice PoM. Too bad about the switcharoo thing, but I agree, if it's not displaying correctly, best to just disable it while you figure out how to squash the bug in it. I will point glider to this so that he knows that there is a new version for the next RevDCM build
You might be able to help me get the switcharoo going properly. At the moment, it seems to work alright when there are no combat modifiers from defensive terrain, but it goes stupid when there are. For example, when a sword attacks a sword on a forest, the normal way round works ok but holding ctrl (switcharoo) makes it spit out 0% for every attacker HP outcome (something's obviously going wrong) and still print out the +50% defense as being for the wrong unit (this time for the attacker but the attacker is not on a forest).
It's probably going to involve using some form of plot swapping like EF was talking about a few posts ago but I haven't managed to figure out how exactly to do it.
BTW, the header file name has a typo:
AdvancedCobmatOdds.h
lol well spotted. You can just remove the file altogether now though right?