[MODCOMP] Unit Statistics

XML isn't an issue here.

The problem is that both mods modify the source code of the game (CvGameCoreDLL). When Kael releases the source code of FfH (which he usually does when the team won't be releasing a new version of the mod anytime soon), I can make that version compatible with the Unit Statistics mod. Without the source code, this is not possible. I already prepared some FfH-specific features (tracking of summoned creatures and, for the next version, spell damage), but I can't use them for now.

Earlier versions of FfH included the Unitstats source code changes by default, which made merging a whole lot easier.
 
Can anybody help me get statistics to work with the BUG Unaltered Gameplay mod. I unzipped the files to their folders in the bug mod but there were a lot of files already there and i dont know what to do! Thanks
 
Does this mod work with Warlords 2.13?
I installed it to my Warlords/Mods folder and nothing happens when I click on a unit and hit U.
 
Did you install version 1.45 and successfully load the mod? There should be a small text on the top right corner of the start screen.
 
Great mod component but just posting a bug report. The mod seems to have trouble in a hotseat multi-player game (can't rename a city), might want to take a look because I would love to add this component back in if this is fixed.
 
I can't explain why this might happen to you. It works here (I just tried it myself), and since the mod doesn't modify the game code that deals with city renaming, I'm wondering whether something else might have caused this problem.
 
BTW, I just noticed that the current source code of Fall from Heaven has been released, which means that I could implement my changes again to make a new UnitStats for FfH.

So for anyone interested: UnitStats for FfH2030f. I'm playtesting it right now. :)

Installation instruction: just copy the contents of the UnitStats mod (UnitStats for FfH, not UnitStats for BTS) into the FfH main folder. Some files will be overwritten, which is ok (if you want to get rid of the mod, you can just disable it in the PythonCallbackDefines.xml. If you really want/need to get back to your original installation (for example for multiplayer matches), make backups of the files or be ready to reinstall). If no files get overwritten, you installed it in the wrong place.
 
Working fine (summoned units are treated as normal units again though).

I'd have liked to add damage tracking for spells, but it seems like too much work at the moment, considering that I'd have to redo it for every new version.
 
Can you make your [MODCOMP] Unit Statistics to work with this type of CvEventInterface and CvCustomEventManager? Thankyou if you can, I try but could not do it.
 
The partisan unitstats mods both use the same CustomEventManager made by Gillmer J. Derge.

Look at lines 24-26 and 71-72 in the partisan mod's CustomEventManager. That's the parts that 'activate' the partisan mod. In the unitstats mod's CustomEventManager it's lines 21-23 and 33-36. Just take one of the files as starting points and copy the relevant lines from the other file to the corresponding place.

It shouldn't matter which CvEventInterface you use.
 
I'm getting a Python error when merging this into my own mod, hoping someone can point me in the right decision. I can post the affected files if needed.

Thanks,
ripple01

Traceback (most recent call last):
File "<string>", line 1, in ?
File "<string>", line 52, in load_module
File "CvEventInterface", line 18, in ?
File "CvCustomEventManager", line 96, in __init__
File "CvUnitStatisticsEventManager", line 44, in __init__
File "CvCustomEventManager", line 153, in setEventHandler
LookupError
:
combatHit

Failed to load python module CvEventInterface.
 
Do you use the CvGameCoreDLL provided with the mod? It is necessary for it to work.
 
I cannot check from this PC, but that was my first thought, since I assumed that you didn't change any of the python files.

On second thought, I do not think that there is any kind of check in the python files whether an event actually exists in the SDK. Hence, the worst that would happen if you forgot to include an event would be that the statistics are not updated for this particular event.

Have you modified your CvCustomEventManager in any way? I can see that the line numbers do not match (the CvCustomEventManager file provided with this mod does not even have 153 lines). Try using the unmodified version and the problem should go away.
 
I am using the CvCustomEventManager from Revolutions, I believe, with some additional code. The affected part is as follows:

def setEventHandler(self, eventType, eventHandler):
"""Removes all previously installed event handlers for the given
event type and installs a new handler.

A list of supported event types can be found in the initialization
of EventHandlerMap in the CvEventManager class. This method is
primarily useful for overriding, rather than extending, the default
event handler functionality.

Throws LookupError if the eventType is not valid.

"""
if eventType not in self.EventHandlerMap:
raise LookupError(eventType)
self.EventHandlerMap[eventType] = [eventHandler]

The last 3 lines are added in my CvCustomEventManager; they are not in the Unit Statistics one. I will comment them out and see what happens.

I am starting to gain a very basic understanding of the SDK and Python and how they interact with each other. Is this error coming up because the combathit event is not defined in the SDK? I'm bringing this up in the case that it may be a possible bug, but I'm more likely just proving my newbness...

Cheers,
ripple01

P.S. Awesome mod, by the way. Top notch stuff. :)
 
Hello ,

WoW :cool:

okay this really ' made my day ' !!


Thanks to the makers and all the people who helped with input and advice !

Have a nice statistical day :)
 
The mod is now compatible with BtS 3.17. There are some minor changes in the background, mostly related to the Fall from Heaven version.
 
Back
Top Bottom