[MODCOMP] Unit Statistics

That's ok - it's disabled by default :)

Look for the file UnitStatisticsDefines.py, you will find all the config options in lines 37-141. What you want to enable is g_bTrackMovement.

Then, you'll also have to edit PythonCallbackDefines.xml (which is in the main XML folder). In this file, set USE_ON_UNIT_SET_XY_CALLBACK to 1.


Having to change two settings for movement tracking to work is not an ideal solution, but it saves performance.
 
Can you make [MODCOMP] Unit Statistics Compatible with Revolution 1.61 I try but I get errors in Python. Please can you do this? If so I thankyou
 
Merging two mods can be very easy or very difficult, depending on the amount of overlap/conflict between them (if they both modify the same file(s), you'll have to find the differences manually and decide what to do about them). I can't do the actual merging for you, but if you're having problems with a specific file that exists in both mods, I could perhaps point you in the right direction.
 
I'm trying to merge this mod with, well, lots of stuff... based on the newest version of ROM. Without much programming experience, now I'm totally defeated trying to make unit statistics to work... Please help!

I believe all the SDK changes, XML changes and Python changes are merged in the right manner. However, when I start BTS with my merged mod, in the init python period, lots of python exception emerges. Basically it tells that the new EventTypes such as Combathit are not properly incorporated. It throws a Lookup error according to the customeEventManager's SetEventHandler function. Any idea what's the cause of the problem?

I don't know which python file to attach since I don't have a clue which file is messed up by me. Waiting for the answers!
 
Oh, no. I've found a slight difference between your CustomeEventManager and TechConquest Mod's CustomEventManager: yours doesn't have the throw lookup error statement in SetEventHandler function...

I should've used your version in the merged mod. I changed the CustomEventManager to your version, and the mod now works perfect...
 
Hello,

I'm interested into WoC capabilities, and they have a pack with your mod inside..
I started to traduce it for French and Spanish...

would you mind into having a copy of my traduction???

in case you would update it, and that update would be added again into a woc module...

so no need to retraduce... or rework the file...
!!??
let me know!!
xau
 
If you send me your translations, I will include them in my next release. Can you fill in the translations in the "FfH Editor" file (in the mod folder)? It's easier to manage several translations this way.
 
Found a little bug; the selected button isn't highlighted correctly.

 

Attachments

  • Civ4ScreenShot0004.JPG
    Civ4ScreenShot0004.JPG
    41 KB · Views: 240
Yeah, I don't know what's causing this bug. I have no control over the highlight's placement - the function (setState) simply takes the button widget and true/false as its arguments. Either it's a bug in the underlying graphics interface or I'm combining screen elements I'm not supposed to.
 
"FfH Editor"????
What is it??

In fact, the unit statistics of WoC module isn't the last one...
i took care of this seeing italian wasn't fixed in that one...

so, i took their version of unit statistic, corrected their French, Spanish, and fixed the German and Italian from your latest version (correcting some tihngs, because some new lines and values have been added...)

so, it's a bit problematic...
if i would have the knowledge, i would have update all the XML and PY of the WoC Version, but, i don't know standard of WoC modding...
i prefer stay in a traduce work actually...

it's just regretable they don't have the last version fo your unit statistic included...
i have no idea if they will fix it or not...
:confused:

i don't know their politic about the evolution of packs...
 
If you download the mod, you will find the file "Ffh Editor.ods" in the top folder. I don't know if you have a text editor capable of opening that format (I use OpenOffice myself), but you will soon see why this system is far better than editing the XML files - it's a real pain in the a** to merge the translations of several people in the XML files themselves; with a spreadsheet, it's just a copy paste job.
 
yep!! i think i understand yoru system...
should be done for any mod.. then...
:mischief:


by the way, people in WoC would then have to recompilate your module to use in their nice system!!!

i'm going to copy past to your open office file.. (i have it too on my computer :D)
 
Yeah, I don't know what's causing this bug. I have no control over the highlight's placement - the function (setState) simply takes the button widget and true/false as its arguments. Either it's a bug in the underlying graphics interface or I'm combining screen elements I'm not supposed to.

Actually the setState command is turning the highlight on, but the piece responsible for the highlight is (pretty sure on this) attachCheckBoxGFC.

To fix the highlight location, you want to instead be using addCheckBoxGFCAt, which allows you to provide an offset parameter to fix precisely this issue.


Your Checkbox:

screen.attachCheckBoxGFC( highscore, highscore + "_TopListButton", "Art/Interface/Buttons/Highscores/"+g_strAlternativeButtons+highscore+".dds", ArtFileMgr.getInterfaceArtInfo("BUTTON_HILITE_SQUARE").getPath(), 64, 64, WidgetTypes.WIDGET_GENERAL, -1, -1, ButtonStyles.BUTTON_STYLE_LABEL )


Sample of a CheckBoxAt:

screen.addCheckBoxGFCAt(szStringPanel, szString, ArtFileMgr.getInterfaceArtInfo("INTERFACE_BUTTONS_GOVERNOR").getPath(), ArtFileMgr.getInterfaceArtInfo("BUTTON_HILITE_SQUARE").getPath(), xOffset + 3, 3, 32, 32, WidgetTypes.WIDGET_PLOT_LIST, k, -1, ButtonStyles.BUTTON_STYLE_LABEL, True )

The new pieces are in green. First one is which other object you are attaching the Checkbox to. Second pair is the X and Y offsets from the location of the button you are attaching yourself onto. Last one I think is the initial state. Not sure on that one. (And if you are wondering why there is a k instead of a -1 near the end, that is because they are using a WidgetType which requires a return value).

In general you want a 3 pixel offset for any button. There was also one other case of you using a checkbox, but I didn't take the time to figure out precisely where it was and if it also needed a minor offset.
 
Your sample code does indeed fix the bug with the highlight, but it doesn't integrate neatly with other parts of the screen. I would have to adjust a whole bunch of other functions for a proper fix, which means that it will have to wait for later.
 
Teg...

When I try to compile the SDK files I get this error.

1>CvGlobals.cpp
1>CvGlobals.cpp(218) : error C2614: 'CvGlobals' : illegal member initialization: 'm_iUSE_UNIT_STATISTICS_CALLBACK' is not a base or member
1>CvGlobals.cpp(2659) : error C2065: 'm_iUSE_UNIT_STATISTICS_CALLBACK' : undeclared identifier
1>CvGlobals.cpp(3073) : error C3861: 'm_iUSE_UNIT_STATISTICS_CALLBACK': identifier not found, even with argument-dependent lookup
1>NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual C++ Toolkit 2003/bin/cl.exe"' : return code '0x

Any help would be appreciated
 
Which version of UnitStats are you using? Did you try to compile the "original" CvGlobals.cpp and CvGlobals.h files from the mod or did you manually merge them with another one?
 
I am using the version from the first post that links to the download in the database.
It is in fact merged but the merge does not effect CvGlobals.H or CvGlobals.CPP the merge is with RevolutionsDCM.

Version 1.5.2.
 
Yep, one line is missing from CvGlobals.h

search for:

Code:
	int m_iUSE_ON_UNIT_LOST_CALLBACK;

and add

Code:
    	int m_iUSE_UNIT_STATISTICS_CALLBACK;

on the next line. I'll update the files right now.
 
Top Bottom