[BTS] Need help merging 2 mods

FakeShady

Prince
Joined
Sep 9, 2009
Messages
389
Location
Singapore
Hey guys, need help merging these 2: (highly recommend both mods btw)

1) Civ4 Reimagined: https://forums.civfanatics.com/threads/civ4-reimagined.569959/

(direct download link: http://www.mediafire.com/file/e6dls98y2q8fj8b/Civ4_Reimagined_1.5.zip/file)

2) "Maps with realistic starting positions for all civs" by The_J: https://forums.civfanatics.com/threads/maps-with-realistic-starting-positions-for-all-civs.356237/

(upload 1)

The former is a content mod, the latter simply comes with custom Earth maps that lets each civ start in fixed positions.

On paper this looks like a straightforward merge, both mods do not have any conflicting files at all. The_J even have a merging tutorial on his modpage:

Spoiler :
How do i merge this with my mod?
Python: There are 2 changes in the CvEventManager, both labeled with "starting points", both changes have to be merged.
In the second part, there's 2 times "startingpoints" mentioned. This is the name of the mod folder, so you will have to change it to your mod folder.
The second python file, the startingpointsutil.py can just be dropped into the same folder like the CvEventManager, and you don't have to change anything there (only if you removed the units settler, warrior, worker and scout, then you have to adjust the starting units, just search for these unit types).

XML: In XML\CustomXML\mapname_startingpoints.xml are the civs mentioned. If you added a civ or changed the key for one, then you have to change the entries there.

Note: In the maps i've set the mod path, you also should change it there.


So I threw both mods into one big file and did the above but can't seem to get it to work. The mod loads properly, but it crashes on starting a new game.

I uploaded my merged CvEventManager file for reference. (upload 2)

Not sure where I went wrong, any help is much appreciated :)
 

Attachments

  • 76319-startingpoints.zip
    542.8 KB · Views: 210
  • CvEventManager.7z
    8.6 KB · Views: 193
Check My Documents/My Games/Beyond The Sword/Logs/PythonErr.log, it's quite hard to guess what the problem could be without that.
 
"Traceback (most recent call last):

File "CvWBInterface", line 65, in getGameData

File "CvUtil", line 212, in findInfoTypeNum

RuntimeError: unidentifiable C++ exception
ERR: Python function getGameData failed, module CvWBInterface
Traceback (most recent call last):

File "CvWBInterface", line 43, in applyMapDesc

File "CvWBDesc", line 1566, in applyMap

File "CvUtil", line 212, in findInfoTypeNum

RuntimeError: unidentifiable C++ exception
ERR: Python function applyMapDesc failed, module CvWBInterface"


............................................................


I'm not sure what all these means. I'm not even sure if all that is from the same playthrough. But I can tell that its an error with the python coding. Are there tutorials on fixing python/coding conflicts?
 
Since I have both mods on my machine I decided to look into this and apparently it has nothing to do with your merged Python stuff. What's happening here instead is that the parsing of your scenario files breaks because the mod uses a 32 civ DLL and the maps coming with realistic starting positions were made with the original 18 civ DLL.
So the fix is just appending 14 more BeginPlayer and EndPlayer tags to the scenario files (incrementing the team every time obviously, so the last player's team is 31). Attached a fixed version of the Earth 100X56(Standard-Clean)-by-strategyonly map as an example. Mind that I didn't actually merge the two mods, just threw this map into the PublicMaps folder to see what happens, so you might encounter other problems related to the StartingPoints mod.
BTW, I'd recommend you to disable HidePythonExceptions in the My Documents/My Games/Beyond The Sword/CivilizationIV.ini file (HidePythonExceptions = 0). With that it's much easier to see if and when an error occurs; here your second exception (and CtD) was actually caused by the fact that the first prevented the scenario file from loading.
 

Attachments

  • Earth 100X56(Standard-Clean)-by-strategyonly.CivWarlordsWBSave
    470.6 KB · Views: 73
Since I have both mods on my machine I decided to look into this and apparently it has nothing to do with your merged Python stuff. What's happening here instead is that the parsing of your scenario files breaks because the mod uses a 32 civ DLL and the maps coming with realistic starting positions were made with the original 18 civ DLL.
So the fix is just appending 14 more BeginPlayer and EndPlayer tags to the scenario files (incrementing the team every time obviously, so the last player's team is 31). Attached a fixed version of the Earth 100X56(Standard-Clean)-by-strategyonly map as an example. Mind that I didn't actually merge the two mods, just threw this map into the PublicMaps folder to see what happens, so you might encounter other problems related to the StartingPoints mod.
BTW, I'd recommend you to disable HidePythonExceptions in the My Documents/My Games/Beyond The Sword/CivilizationIV.ini file (HidePythonExceptions = 0). With that it's much easier to see if and when an error occurs; here your second exception (and CtD) was actually caused by the fact that the first prevented the scenario file from loading.

It worked! Thanks you!!! :D

This seems like such a small, yet important detail. Can't believe the other merging guides doesn't seem to mention at all.
 
Is is interesting that in this years nobody from the big mods improved the scenario file loader to made it more robust for errors like a different amount of players.
Over a decade are crashing games for no reason.

For this reason I wrote it on my own a few years ago. No stylish code, but it works for me.
Maybe you want add it files to your mod (or just adapt the idea and rewrite it in a better variant).
 
Top Bottom