[MODCOMP] Unit Statistics

I'd suggest to wait a few days before testing/downloading my mod.
I'm redoing a few things and there will be an update soon :)
 
I wonder if the originator of this mod would possibly consider combining in the Better AI code? As it is I am sorely TORN between this mod and the AI one... would LVOE to use them both. But the .DLL is required for both. :cry:
I may be adding BetterAI to my DLL later (along with Dale's Ranged Bombard if practical), but I'm waiting for a really good, stable, balanced version first; BetterAI is a fantastic project but they're still ironing things out, and there are significant bugs in the current versions.

I mention this b/c I have a different version of the Stats mod bundled with my full mod that might be of some interest; I like it better than Teg's but that's a matter of opinion and I haven't actually looked at his since 5 months ago anyway (plus I don't want to hijack his thread too much ;)). My mod hasn't been updated for 2.08 yet either, though I'm working on that at the moment... Oh well just a thought.

*apologizes to Teg for the hijacking, promises never to do it again*
 
K, so I didn't see this answered anywhere in the thread, but could've missed it.
How would I make this part of the standard game? So that I wouldn't have to load the mod to use it. So that it would be in every game I play, even if it is a mod.
 
Simply place the files in the CustomAssets folder (search for it if you don't know where it is) instead of a separate mod folder (called Unit Statistics Mod for Civ4 by default).

Try to leave the file structure of the zip intact, so that Assets and the .ini files are on the top level (an example file path would be: ...\documents and settings\my games\Civilization 4\CustomAssets\Assets\Python\Screens\CvMainInterface.py).

Edit: You can't just play unit stats together with other mods though, as there might be conflicting files. Combining mods isn't as convenient in Civ4 as in some other games, that is why there are so many modpacks out there. Perhaps you find one that includes all the mods you want.
 
I would recommend against ever putting files in the CustomAssets folder. As Teg mentioned it will break most mods and leave users confused as to why mods and scenarios dont work for them.
 
Yep, personally I prefer to create a shortcut similar to what is included with FfH so that I don't have to restart the game to load a specific mod. It is just as fast as having the files in the CustomAssets folder, without causing the same amount of problems.

The CustomAssets folder has its uses though: continuing an already started, unmodified game with the Unit Statistics Mod is only possible if you place the mod in the CustomAssets folder, as you can't freely choose what mod you want to load a savegame with. Since the mod can't retrieve statistics retroactively, it won't give you any info about what happened before you started using the mod though. Also, directly loading save games is quicker if you either have the mod in your CustomAssets folder or set it as default in your config file (I would suggest the latter).

However, all these solutions are only useful if one does not want to play any other mods and/or scenarios. See my edit of the last post.


Change of topic: Kael, I'm finishing a larger project I've been working on over the last two months this week. After that, I might start fiddling with Civ4 again. I've seen that you created a speed mod that eliminates unnecessary python calls. how would an XML layer as it exist in theCCCP affect performance? I'm not suggesting that you modify your speed mod accordingly, but I see it as a way of re-implementing the mod's python calls into the FfH source code so that they are optional and do not affect performance when turned off.
 
Change of topic: Kael, I'm finishing a larger project I've been working on over the last two months this week. After that, I might start fiddling with Civ4 again. I've seen that you created a speed mod that eliminates unnecessary python calls. how would an XML layer as it exist in theCCCP affect performance? I'm not suggesting that you modify your speed mod accordingly, but I see it as a way of re-implementing the mod's python calls into the FfH source code so that they are optional and do not affect performance when turned off.

XML switches are fine. In fact when I go to integrate Speed Mod into FfH I'll put a XML block on each function so that those that want to mod FfH can turn python functions they want to use back on.
 
Ya, what you suggested didn't work, as I'd tried that before I posted.
However, I found Amra's mod, and it contains yours.
Now if I could just ruff's mod, to work with that one, I think I'd be set.
 
I just took the current source code of FfH 2 (version 022d) and merged it with Unit Statistics. Here you go: link.

There was no long-time playtesting, but tracking combats works fine. The only issue is that only the attacking strength is displayed in the combat log and on the Unit Statistics page (4 values would just be too much), but damage tracking works fine.

Edit: Did some playtesting and encountered no problems.
 
The mod has been upgraded to work with Beyond the Sword. Had an early loss in my first game, now I'm off to play some more... :)
 
Hey, downloaded this mod but where do i install to? Where is can i find civ_install_folders? is this the same as _civ4custommods?

Im on BTS btw. Thanks
 
Normally, your installation folder is "C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\"

The mod path should either be "C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\Unit Statistics Mod for BtS", or alternatively, "My Documents\My Games\Beyond the Sword\MODS\Unit Statistics Mod for BtS"
 
I read the "Combining this mod with other mods" section but I've never done this before so would appreciate some help.

I'd like to use this mod with Ethnic Artstyles v1.0 and ActualQuotes v4.0 (although ActualQuotes isn't actually loaded as a mod), but don't know exactly how to do the merge.
 
There are no file conflicts between these three mods. You can just combine them by moving the files of all three mods into one mod folder. The only thing you have to be careful about is the file structure. ActualQuotes' "Text" and "GameInfo" folders are subfolders of "XML", as is explained in the readme of the mod.
 
After some turns I have a python error every turn in UnitStatisticsUtils.py on line 266 saying
"TypeError: object does not support item assignment"

I have no idea why this error occurs. The code seems ok for me.

Edit:
There is another error. If I open the statistics screen and click on the top 10 sometimes the following error occurs:
UnitStatisticsTools.py line 194
TypeError: unscriptable object.

Matze
 
Both errors look like there is a unit that doesn't have any unitstats data (UnitStatisticsDefines.py lines 254-276), which should always be created for new units. I haven't had this problem in the last few games I played, but I can imagine several causes for this off the top of my head:

- USE_ON_UNIT_CREATED_CALLBACK is set to 0. Unlikely, since the problem only occurs sporadically.

- Another mod creates a unit using its own code, without a onUnitCreated callback occurring (or some other incompatibility with other mods).

- You've loaded a game that was started without Unit Statistics running, or you enabled/disabled it during the game.

- You're playing with different unitstats settings than I am, which causes a bug I didn't notice.

Can you either send me a savegame or add a line like "print objUnit.getName()" just before the lines that crash, so that you can see if it's a specific unit that causes problems?
 
USE_ON_UNIT_CREATED_CALLBACK is set to 0. Unlikely, since the problem only occurs sporadically.

Yes, it's set to 0.
I forgot to merge PythonCallbackDefines.xml with my files.
Once corrected, the errors disappeared. Sorry for bothering, it was my fault.

Matze
 
A version compatible with 3.13 is up.

I decided to get rid of some obsolete code and rewrote the combat tracking - it is now more flexible, tracks flanking attacks (and kills) and can easily be extended to track other types of damage (I'm thinking of FfH spell damage).
 
What exactly would need to be done to get this mod to work alongside the Fall From Heaven 2 mod? Consider me an XML Dummy.
 
Back
Top Bottom