[MODCOMP] JTradeRoutes: An Improved Interface

The two python errors I get at the Europe screen are:

CvScreensInterface 539
CvEuropeScreen 403
CvEuropeScreen 219

CyUnit no attribute canSailEurope

AND

CvScreensInterface 109
CvEuropeScreen 142
CvEuropeScreen 219

CyUnit no attribute canSailEurope

The lines pointed to don't seem to have anything wrong with them. So I think the canSailEurope function may be screwed in the DLL. I haven't a clue on what to do about that though.

UPDATE: The problem does go away if I use the standard 1.01 DLL in place of the mod one though. However, that probably breaks the mod at some point. I think if someone merged the changed source (available in post #1) with the 1.01 source and compiled it, it might work. I don't know how to compile though, and the tutorial thread wasn't very helpful as it doesn't seem to work for many people. And the source available for the mod appears to be ver 1.000 and not 1.002.
 
I have created the DLL again. This time I just merged the mod source code to 1.01 code, and not taking the split codes (supposed to be needed for debuggable DLL).
I played with it for a little while and it looks fine so far. Europe screen is fine now.
Please get the DLL from post #68 along with the changed source code and python files.
Do let me know if it has any issues.
 
I've played about 100 turns with the new DLL so far and no problems yet. I'm not using the included python files though I am using the fix for no F1 advisor. I don't know if you actually changed anything in those included .py's or not.
 
There are 3 fixes in the included .py files.
I am using these .py files and not seen any issue so far.

1. COLOR_FONT_CREAM fix as mentioned in post#70. (Though not sure if it will break anything without it, as it gave error with debuggable DLL which is N/A in the new cpp files.) (courtesey: Aymerick)

2. Domestic Advisor fix as in post#79. (courtesey: Karstedt)

3. While 'diff'ing the .py files of the MOD with 1.01F code, I came across this change and applied it as well. (Don't know how it will affect the game) -

In files CvMainInterface.py and CvMainInterfaceX.py -
MOD / 1.00 code:
Code:
				screen.setButtonGFC("ImportButton", self.setFontSize(localText.getText("TXT_KEY_DEMO_SCREEN_IMPORTS_TEXT", ()), 1), "", CITIZEN_BAR_WIDTH + (MAP_EDGE_MARGIN_WIDTH * 2), CITY_TITLE_BAR_HEIGHT + CITY_VIEW_BOX_HEIGHT_AND_WIDTH, BUILD_AREA_WIDTH - MEDIUM_BUTTON_SIZE, 3 * STACK_BAR_HEIGHT / 2, WidgetTypes.WIDGET_YIELD_IMPORT_EXPORT, false, -1, ButtonStyles.BUTTON_STYLE_STANDARD)

1.01F code:
Code:
				screen.setButtonGFC("ImportButton", self.setFontSize(localText.getText("TXT_KEY_DEMO_SCREEN_IMPORTS_TEXT", ()), 1), "", CITIZEN_BAR_WIDTH + (MAP_EDGE_MARGIN_WIDTH * 2), CITY_TITLE_BAR_HEIGHT + CITY_VIEW_BOX_HEIGHT_AND_WIDTH, BUILD_AREA_WIDTH - MEDIUM_BUTTON_SIZE, 3 * STACK_BAR_HEIGHT / 2, WidgetTypes.WIDGET_YIELD_IMPORT_EXPORT, true, -1, ButtonStyles.BUTTON_STYLE_STANDARD)
 
There's another bug. There is no way to pick which direction to sail from (east west). It looks like the est button never sows up, and the east button is always used no matter what. And if both sides are available, the east button seem to pick somewhat randomly.
 
I'm guessing your DLL was built using alpaca's makefile (linked in the Colonization Modding Tutorials forum)?

Unfortunately, alpaca forgot a line of code in CyUnitInterface1.cpp/CyUnitInterface2.cpp that exposes the "canSailEurope(iEurope)" function to Python. You need to add it manually to one of those files. The code is this:

Code:
.def("canSailEurope", &CyUnit::canSailEurope, "bool (int iEurope)")

I had this problem when building a DLL for my Betray your Colony modcomp. I first got around it by removing the option to choose where to sail (which it sounds like is what was done here), but then I readded the function and got everything to work as normal.
 
I used alpaca's source code initially, but due to the canSailEurope error, I re-built the DLL using game folder source codes and JTradeRoutes mod source codes only.
Thanks for pointing the fix needed; we can make use of it, if I ever need to build a debuggable DLL.

@Karstedt, please check if you modified Europe screen py file to bypass canSailEurope function while using my buggy DLL; and still using it. You should remove it now.
I am not seeing any issue in sailing East-West.
 
It appears to be a problem with the Australia map by -sr. I just tried on the standard map and no problems. My europe screen py is unmodified. There are many different sail to europe zones on the Australia map.

I just tried the Australia map with no mods and get the same problem. So it's not the mod.
 
Hi all,

I'm glad there are others who find it valuable to have an improved trade interface, and who have worked towards making it happen. I'm trying to get the most recent changes to work, but I'm having no luck. I don't fully understand what's been going on the last two pages, so bear with me.

I took all of the files from post #68 and replaced their old counterparts in the game folders. I'm pretty sure everything is in the right place. But when I run a custom game on an "a_new_world" map, the trade routes screen doesn't work. The trade routes button appears in the top right of the main world map screen, but clicking on it does nothing at all. Similarly, when I bring up the Domestic Advisor, clicking on the trade routes button there does nothing.

Any help is appreciated. Getting an improved trade route interface would make this game 10x better for me. Thanks!
 
Hi all,

I'm glad there are others who find it valuable to have an improved trade interface, and who have worked towards making it happen. I'm trying to get the most recent changes to work, but I'm having no luck. I don't fully understand what's been going on the last two pages, so bear with me.

I took all of the files from post #68 and replaced their old counterparts in the game folders. I'm pretty sure everything is in the right place. But when I run a custom game on an "a_new_world" map, the trade routes screen doesn't work. The trade routes button appears in the top right of the main world map screen, but clicking on it does nothing at all. Similarly, when I bring up the Domestic Advisor, clicking on the trade routes button there does nothing.

Any help is appreciated. Getting an improved trade route interface would make this game 10x better for me. Thanks!

In post #79 I posted about a syntax error in the python file. You can open it in a text editor and goto the line I posted to fix it.
 
Hi

I just tried to run this mod. When Col restarted, it stopped and displayed the following message:

There are more siblings than memory allocated for them in
CvXMLLoadUtility::SetVariableListTagPair
Current XML file is xml\Civilisations/CIV4LeaderHeadInfos.xml


The game had to be closed manually using the Processes screen in Task Manager- it wouldn't close from the Applications screen.

I tried this a couple of times and the same thing happened both times.

I thought you may need to know.

cheers

Magdovus
 
Top Bottom