Merging BUG with other Mods

But why were there indentation differences? Are you using spaces instead of tabs for indentation? I use tabs exclusively in BUG, and Civ4 mostly does. Did you have to indent blocks of code due to merging with BUG changing the level of indentation needed by adding an "if" test or something similar?
 
I honestly don't know. I never touch either space or tab when merging. I was using WinMerge to find changed sections, and also used WinMerge to then copy-paste those sections that it identified as being different. If I had marked that Space option in WinMerge beforehand, maybe everything would have worked from the first go - in fact, I'm quite sure it would. However, there were mostly indentation errors, where PythonErr2 logged "indentation expected" or similar. A few syntax errors also, but those were caused by indentation errors.
 
If it doesn't show up in PythonErr.log (no 2), it's not an error but a warning. I bet you didn't need to fix any of that indentation stuff. It was probably places where it was using spaces and Python was just warning you that it was different and possibly incorrect.
 
Well, I did have no interface, so something was not working correctly. :)
 
Do you have the LoggingEnabled setting as 1 in your CivilizationIV.ini file? Perhaps Python errors aren't written to PythonErr.log unless it's on.
 
Turns out, I didn't have logging enabled. I had one error related to unitnaming, but I've fixed it. :)
 
Thanks a lot for the informations on the wiki; will be of a great help when I want to include BUG in my personal mod :)

I would just like to check if I am correct:
For all simple stuffs that only require XML (new leaders, buildings, units...) and/or sounds/arts, there should be no conflict with BUG
For all stuff having python, I see two possible conflicts:
- if the stuff modifies CvEventManager.py, then I have to integrate it into the BUG event system: I create a new python file, a class, put the correct code inside, register the event using addEventHandler; then create an xml configuration file for my python file, and register the former into init.xml; right ?
- if the stuff modifies the interface: well, not too much choice other than to change that by hand :D
Could there be a conflict with other python file? Like, if I modified CvGameUtils.py ?
 
For all simple stuffs that only require XML (new leaders, buildings, units...) and/or sounds/arts, there should be no conflict with BUG

Correct.

- if the stuff modifies CvEventManager.py, then I have to integrate it into the BUG event system: I create a new python file, a class, put the correct code inside, register the event using addEventHandler; then create an xml configuration file for my python file, and register the former into init.xml; right ?

If it modifies CvEventManager itself, you can use that one with BUG most likely, but doing as you stated above is the better route. If you're creating stuff yourself, it will be much easier too as you don't even need a class.

- if the stuff modifies the interface: well, not too much choice other than to change that by hand :D

Yup.

Could there be a conflict with other python file? Like, if I modified CvGameUtils.py ?

For the most part, yes. Check if BUG has that file. If it does you'll need to do some merging. For example, BUG 3.6 added its own CvScreenUtils for the Strategy Layer. BUG will likely never have its own CvGameUtils because that file is specifically for altering game rules.
 
If it modifies CvEventManager itself, you can use that one with BUG most likely, but doing as you stated above is the better route. If you're creating stuff yourself, it will be much easier too as you don't even need a class.
Ah, good to know; I'll perhaps try first to merge into CvEventManager itself at first, it will surely be more simple ;)

For the most part, yes. Check if BUG has that file. If it does you'll need to do some merging. For example, BUG 3.6 added its own CvScreenUtils for the Strategy Layer. BUG will likely never have its own CvGameUtils because that file is specifically for altering game rules.
Good to know! Thanks again for you help :goodjob:
 
One new question :p

I'm now in the process of merging BUG with some stuff of mine, some modifying CvEventManager.py. As I said before, I thought that I could just perhaps take my changes and include them in the BUG file, 'coz I thought that CvEventManager.py was replaced in BUG.

However, that is not the case. The file BugEventManager.py does not replace at all CvEventManager.py, unless I'm missing something; does this mean I can just take my CvEventManager.py file, include it, and all of its changes will be included as well ?
 
Does this mean I can just take my CvEventManager.py file, include it, and all of its changes will be included as well ?

Typically, yes. For a personal mod, that's fine. If you intend to release it or merge in other mods, you might want to check out the section on adding events on the BUG wiki.
 
A quick check shows that the only area of overlap between BUG and Varietas Delectat is Assets/XML/Art/Civ4RouteModelInfos. What lines do I have to modify to get at Route Model file that works for both mods, and if I then throw everything into one mod, should there be any other conflicts?
 
I'm not a VD expert, but I believe VD does the same thing BUG does: replace modern roads with more visible ones. You can pick either XML file and be okay. BUG uses ricardojahns's I Love Asphalt. I don't know what VD uses.
 
I'm not a VD expert, but I believe VD does the same thing BUG does: replace modern roads with more visible ones. You can pick either XML file and be okay. BUG uses ricardojahns's I Love Asphalt. I don't know what VD uses.

I guess it's from Ethnic Citystyles VD uses. But I remember I might have cleaned out some modern roads in v6.1 from the EC component.
 
I am in the process of merging the BUG/BAT Mod with the Great Person Mod - the one that displays a popup screeen with art and a quote for each Great Person born to a player. I am merging it via init.xml and placing the python files in the Contrib folder, so when I am finished I can release it for other users or it can possibly be added into the BAT mod.

I have almost got it to work. I say almost because the popupscreen does appear with the GP's correct name and an image of a GP, but the image is the default image found if the path to the proper GP image cannot be found.

The CvPath.py file that the Great Person mod uses for the path says:

A mod that wishes to export its name to this module must create a Python module called CvModName that contains a string variable named modName set to the name of the mod.
and
Furthermore, if the value of the modName variable does not correctly match the mod directory name, the path variables will not be set properly.

The BAT mod already has CvMod.py, and in there it sets the Mod name to "BUG Mod". I left that alone. However, the default install directory name (at least when installing to the "Mods" folder) when using the BAT Mod is "Bat Mod 1.2". So the GP Mod is looking for a folder named BUG Mod I believe, and since the actual install folder is BAT Mod 1.2 it fails at the last step of finding the correct image.

How can I get around this? The default image is in the same folder as the correct named images that are not displaying, so maybe it is only the part of the .py (CvGreatPersonScreen.py) that looks for the exact image. I have changed the name of the default image in the .py file to another image name as a test and it loaded the changed name image in that instance. However I have not modified the above .py file from the original, and the original did work as standalone and when I merged it with the Varietas Delectat mod.
 
Use BugPath.py's findAssetFile() instead of CvPath. In fact, do not include CvPath at all.
 
Use BugPath.py's findAssetFile() instead of CvPath. In fact, do not include CvPath at all.

So I want to import BugPath instead of CvPath into the file (GreatPersonScreen.py).
And then in the same file szArtPath = CvPath.getPath(os.path.join("art","GreatPeople"), "Great Person.dds")
would instead become
szArtPath = BugPath.findAssetFile(os.path.join("art","GreatPeople"), "Great Person.dds"), correct?
Or is there something I'm not grasping here?
 
So I want to import BugPath instead of CvPath into the file (GreatPersonScreen.py).
And then in the same file szArtPath = CvPath.getPath(os.path.join("art","GreatPeople"), "Great Person.dds")
would instead become
szArtPath = BugPath.findAssetFile(os.path.join("art","GreatPeople"), "Great Person.dds"), correct?

That's almost exactly right. You're on the right tack, but the path and filename are reversed in findAssetFile because path is optional:

Code:
szArtPath = BugPath.findAssetFile([B]"Great Person.dds", os.path.join("art","GreatPeople")[/B])

Everything else was spot on. :goodjob:
 
I've been trying to merge BUG 3.6 with Liambane's Earth 40 Civs mod, but I keep getting the "Bugoptions: Cannot locate settings folder" error, why is this?
Thanks for any help you can offer.
 
Top Bottom