Merging mods ?

DerChefkoch_75

Chieftain
Joined
Aug 15, 2006
Messages
16
hi

i'm fairly new here, but already spent the last 3 days browsing your forum .. unfortunately, many questions did not get answered (and yes, i even used the 'search' option)...

i am a software developer but not fit in python. i have the warlord expansion ...

my first question: i only play the warlord expansion, and make use of the customasset folder, but a look at the python code in the CvPath.py file shows me that the warlords customasset folder is ignored - am i correct ?
(the command shows something along the line of 'merge the civ4 path with warlord path' - in 'my documents' warlord has an own folder parallel to civ4 by default)

second question (more important): many mods come with 2 ini files and a CvModName.py. how to merge those ?

i downloaded for example a couple of small mods (JUnitReligion, Great Generals From Barbarian Combat Mod).
i already use the Ethnically Diverse Units mod which works fine (does not use a mod config, just a simple ini for the game). merging it with the immigration mod (which is only for the 1.61 vanilla version, but i was able to edit the xml files so it would be compatible with warlord) resulted in +2419434686598 gold per round shown on the top left of the screen(which you do not actually get), so i don't know if the game itself would have worked. replacing the cvpath and cvconfigparser files of the immigration mod with appropriate files from 'Great Generals From Barbarian Combat Mod' after comparing them with 'araxis merge'-developer tool resulted in a crash.

nonetheless, i'd like to at least include these 2 small mods, but i do not know how to handle the different eventmanager files and the different config and cvmodname files....
i guess cvmodname would be renamed to the ethnical mod, since that mod is my default mod, but how to proceed further ?

thx in advance
 
Ok, let me see if I can answer a few of these for ya.

1) The two ini files generally in a mod's /Mods/<modname> directory. The <modname>.ini one, example JUnitReligion.ini is generated by the Civ4 hardcode and can basicly be ignored. IF you delete it, the game will make a new one with default values the next time you use the mod to play a game.
The other ini you usely see, example JUnitReligion Mod Config.ini, is the ini file that is part of the mod and has options you can set and change to effect how the mod works.

2) The CvModName.py file. If you look in the file you will see that it has only one variable. That variable should be the name of the mod's directory, it should be the exact same as <modname> in /Mods/<modname>, example /Mods/JUnitReligion is the directory so the variable in CvModName.py should be "JUnitReligion". You have to have the quotes around it so Python knowes it is a string and I'm pretty sure it is case sensitive.

3) CvPath.py, using the mod directory name in CvModName, is used by CvConfigParser to find the config.ini file of the mod. I don't really know if it has anything to do with finding stuff in CustomAssets, you might want to ask on Dr. Elmer Jiggle's thread.

Hope that helps and good luck. :)
 
Jeckel said:
Ok, let me see if I can answer a few of these for ya.

1) The two ini files generally in a mod's /Mods/<modname> directory. The <modname>.ini one, example JUnitReligion.ini is generated by the Civ4 hardcode and can basicly be ignored. IF you delete it, the game will make a new one with default values the next time you use the mod to play a game.
The other ini you usely see, example JUnitReligion Mod Config.ini, is the ini file that is part of the mod and has options you can set and change to effect how the mod works.

2) The CvModName.py file. If you look in the file you will see that it has only one variable. That variable should be the name of the mod's directory, it should be the exact same as <modname> in /Mods/<modname>, example /Mods/JUnitReligion is the directory so the variable in CvModName.py should be "JUnitReligion". You have to have the quotes around it so Python knowes it is a string and I'm pretty sure it is case sensitive.

3) CvPath.py, using the mod directory name in CvModName, is used by CvConfigParser to find the config.ini file of the mod. I don't really know if it has anything to do with finding stuff in CustomAssets, you might want to ask on Dr. Elmer Jiggle's thread.

Hope that helps and good luck. :)


thx for your answer
eventually i figuered that out myself - my problem is how to merge two config / python files ....(the config shouldn't be a problem, simply appending the options, but how to name the file itselft afterwards ?)
 
Just include both config.ini options. In the python files the config files are called by name so moving the options from one file to another or renameing the config.ini files without also editing the proper places in the python will cause the ini file reading to fail.

If you have any other question just post them here and I'll keep an eye on this thread, I'm always happy to lend ahand. :)
 
DerChefkoch_75 said:
thx for your answer
eventually i figuered that out myself - my problem is how to merge two config / python files ....(the config shouldn't be a problem, simply appending the options, but how to name the file itselft afterwards ?)

The config parser parses all .ini files in the directory of the mod, so the config's name is not important.

And yes, unfortunately, CvPath doesn't recognize files in the CustomAssets folder.
 
Teg Navanis said:
The config parser parses all .ini files in the directory of the mod, so the config's name is not important.

I don't think I understand what you mean by this. It has been my impression that if you change the name of a config.ini file then
Code:
config = CvConfigParser.CvConfigParser("<config.ini file name>")
is not going to find its given file, and then all your config.getint()s and config.getboolean()s will not know which config file to lookin.
 
Jeckel said:
I don't think I understand what you mean by this. It has been my impression that if you change the name of a config.ini file then
Code:
config = CvConfigParser.CvConfigParser("<config.ini file name>")
is not going to find its given file, and then all your config.getint()s and config.getboolean()s will not know which config file to lookin.

as far as i can interprete the python code (similar to basic or c) all the parser does is to retrieve an array of files and parses ALL of them
so i think the name of the config could be pointless after all ....

problem: how to merge the python file "cvmodname" ?
and even worse: how to merge a python file "custom event handler" ??
 
DerChefkoch 75 said:
problem: how to merge the python file "cvmodname" ?
and even worse: how to merge a python file "custom event handler" ??

First it is very important to point out that the CvCustomEventManager.py file is somthing seperate from the CvPath.py, CvConfigParser.py, and CvModName.py files. CvCustomEventManager.py is a custom event manager, where as the other three files are a INI file reading utility. The INI file reading has nothing to directly do with custom event managing and visa versa.

1) You don't need to merge CvModName files. The CvModName file has a single variable. This variable should be set to the name of the mod's main directory under the Civ4/Mods/ directory. For example, JUnitReligion mod is in the Civ4/Mods/JUnitReligion/ directory so in the CvModName file that single variable should be set to "JUnitReligion" with the quotes so python knows its a string.

2) ..Well, I started explaining the CvCustomEventManager.py file, but this is a little more complex and I have to go do some RL stuff. I am going to be out of town for a day or two so I am going to write up a little Tutorial on using Dr Elmer Jiggle's Custom Event Manager and post it in the Tutorial forum. I'll link to it from here when I get back in town and post the tutorial. :)
 
Back
Top Bottom