Merging BUG with other Mods

That error tells me that you pulled the latest version of BUG from the SVN. Is this correct? If you have it installed to CustomAssets you need to create a folder called "BUG Mod" that is a sibling to CustomAssets. Put both Info and UserSettings into that new folder.

Otherwise, visit this page and follow the instructions. It will tell you how to get the information we need to help you. You can post again here with that information and we can go from there.
 
I think this was asked before but I couldn't really find an answer: how do you make a new trait that you added to the xml (it works completely) also show up in the traits part of the civilopedia. I added the trait in the xml file (CIV4TraitInfos.xml). I added the following to the TraitUtil.py:

Spoiler :

def init():
"Performs one-time initialization after the game starts up."
game = gc.getGame()
global GENERIC_ICON
GENERIC_ICON = u"%c" % game.getSymbolID(FontSymbols.MAP_CHAR)

addTrait("AGGRESSIVE", game.getSymbolID(FontSymbols.STRENGTH_CHAR), "Art/Interface/Buttons/Promotions/Combat1.dds")
addTrait("CHARISMATIC", game.getSymbolID(FontSymbols.HAPPY_CHAR), "Art/Interface/Buttons/TechTree/MassMedia.dds")
addTrait("CREATIVE", gc.getCommerceInfo(CommerceTypes.COMMERCE_CULTURE).getChar(), "Art/Interface/Buttons/TechTree/Music.dds")
addTrait("ENLIGHTENED", gc.getCommerceInfo(CommerceTypes.COMMERCE_RESEARCH).getChar(), "Art/Interface/Buttons/TechTree/Liberalism.dds")
addTrait("EXPANSIVE", game.getSymbolID(FontSymbols.HEALTHY_CHAR), "Art/Interface/Buttons/Actions/Heal.dds")
addTrait("FINANCIAL", gc.getCommerceInfo(CommerceTypes.COMMERCE_GOLD).getChar(), "Art/Interface/Buttons/TechTree/Banking.dds")
addTrait("IMPERIALIST", game.getSymbolID(FontSymbols.OCCUPATION_CHAR), "Art/Interface/Buttons/Actions/FoundCity.dds")
addTrait("INDUSTRIOUS", gc.getYieldInfo(YieldTypes.YIELD_PRODUCTION).getChar(), "Art/Interface/Buttons/TechTree/Industrialism.dds")
addTrait("MERCANTILE", game.getSymbolID(FontSymbols.RELIGION_CHAR), "Art/Interface/Buttons/TechTree/Meditation.dds")
addTrait("NATIONALISTIC", game.getSymbolID(FontSymbols.RELIGION_CHAR), "Art/Interface/Buttons/TechTree/Meditation.dds")
addTrait("ORGANIZED", game.getSymbolID(FontSymbols.TRADE_CHAR), "Art/Interface/Buttons/Buildings/Courthouse.dds")
addTrait("PHILOSOPHICAL", game.getSymbolID(FontSymbols.GREAT_PEOPLE_CHAR), "Art/Interface/Buttons/TechTree/Philosophy.dds")
addTrait("PROTECTIVE", game.getSymbolID(FontSymbols.DEFENSE_CHAR), "Art/Interface/Buttons/Promotions/CityGarrison1.dds")
addTrait("SEAFARING", game.getSymbolID(FontSymbols.RELIGION_CHAR), "Art/Interface/Buttons/TechTree/Meditation.dds")
addTrait("SPIRITUAL", game.getSymbolID(FontSymbols.RELIGION_CHAR), "Art/Interface/Buttons/TechTree/Meditation.dds")
addTrait("STRATEGIC", game.getSymbolID(FontSymbols.RELIGION_CHAR), "Art/Interface/Buttons/TechTree/Meditation.dds")


Still ingame there is nothing to see. I added strategic, seafaraing and nationalistic (enlightened was in the mod already and does work, but I can't find why).
 
How do you make a new trait that you added to the xml (it works completely) also show up in the traits part of the civilopedia.

You must add your traits to the file "XML/BasicInfos/CIV4NewConceptInfos.xml". Search for this:

Code:
<!-- Traits Infos -->
<!-- Modders: These must be kept in sync and sorted if you add/remove any traits -->
<NewConceptInfo>
	<Type>CONCEPT_TRAIT_AGGRESSIVE</Type>
	<Description>TXT_KEY_TRAIT_AGGRESSIVE</Description>
	<Civilopedia>TXT_KEY_TRAIT_AGGRESSIVE_PEDIA</Civilopedia>
</NewConceptInfo>
...

and insert your traits in the list in alphabetical order. You can put the <TEXT> entries into any CIV4GameText.xml file you like (create your own typically).
 
It's been a while since I've played civ and I'm getting back into it recently. I'm a little confused. Is the /daily_build/BUG_SVN.rar considered "BULL"? Does it contain BUG + better ai + unofficial patch? Or have you not yet integrated the better ai with this particular SVN? Also, do I still need to change Nocustomassets=1 for singleplayer? Thanks :)
 
The daily snapshot is literally a copy of what's current in the BUG SVN. It doesn't have anything extra (BULL or BBAI) in it. It's there for people to get what's in the SVN without installing an SVN client.
 
The daily snapshot is literally a copy of what's current in the BUG SVN. It doesn't have anything extra (BULL or BBAI) in it. It's there for people to get what's in the SVN without installing an SVN client.

Oh I could really use this. Can you please give me the link for it, or tell me where to find it?
 
Oh I could really use this. Can you please give me the link for it, or tell me where to find it?

Here ya go. It's a RAR packaged up each nite. Honestly, it's so easy to install TortoiseSVN that if you want to keep up-to-date that's the way to go. The RAR requires that you unRAR it each time and overwrite the files.
 
hey team,

I'm truly lost here, I'm stuck with 3.6 because I really don't get the directory changes... :crazyeye:

I know, I must be drunk or something... but I don't get it.

So, please give me a list of steps of what to do if I download the latest SVN snapshot, and have 3.6 installed in My Games/BTS etc folder.

Thank you for the help.

Ricardo
 
Yeah it's a little confusing.

  1. Rename Assets to CustomAssets
  2. Create a "BUG Mod" folder
  3. Move Info and UserSettings into that new folder
 
I've been playing with BUG for quite awhile. Recently, I decided to try out the FFH mod. I'm really missing the "field of view" slider from BUG. Is it python, or SDK, or both? Was it ever released as a standalone? Is it commented in the python and source files separately from the rest of BUG, or would I have to root around to sort it out?
 
The FoV item is actually pretty easy to pull out. Search maininterface.py file (the BUG version) for 'field of view' or 'FoV' and you should find where we insert it. I wouldn't suggest putting in all of the option control stuff that we add so that players can turn it off.

The only tricky part is making sure that the game knows that you have changed the slider value - look for the section that controls that at the bottom of the file.

Edit: we have marked it up ... search for '# BUG - field of view slider' to find that code that controls it.
 
I have BAT 2.0 installed and I want to also install Unofficial 3.19. I know this is in the fact, but it wasn't quite clear to me. Could someone provide me with a more in depth explanation of what to do? I installed BAT 2.0 as a standard install. Thanks.
 
I'm attempting to merge Inquisitions 250c into BUG. The Inquisitions modcomp is (for me anyways) a very advanced and extensive python mod. It has a modded CvCustomEventManager (this I can deal with), an InquisitionEvents.py which imports the CEM, an InquisitionGameUtils.py file, and also a modded CvGameInterfaceFile.py. From the wikidocs I can sort of figure out what is to be done (I think) to most of this - but I have no clue about that GameInterfaceFile.

In any case, even though OrionVeteran has done a lot of work to make this mod modular, it is still pretty tricky to merge with BUG, since you guys have made such fundamental changes to the adding of events. I don't know if python mods get any more advanced than Inquisitions, but I find the wiki to be a little lacking in describing what's to be done to these more advanced mods. Basic events are easy enough to deal with, but this is just too difficult for non-programmers. :) Using winmerge is simply not enough when trying to merge modular mods, understanding what file does what and what file references what is required, since the BUG mod has changed the rules a little when it comes to adding other mods.
 
BUG's event handling and game utils were primarily designed to make it really easy for me to add features. I have put much of it into XML to hopefully make it easier for others as well. I would love to improve the documentation for non-programmers. The trick is getting inside their heads to explain it in a way that makes sense. Asking specific questions is a great way to help me figure out what's lacking.

Game Utils

Orion made InquisitionGameUtils modular by having its class extend CvGameUtils. This makes hooking it up to BUG a snap.

1. Toss out CvGameInterfaceFile and use BUG's.

2. I think this step is actually not necessary. If you get strange behavior, modify InquisitionGameUtils to remove the CvGameUtils superclass:

Code:
class InquisitionGameUtils[s](CvGameUtils.CvGameUtils)[/s]:

so it looks like this:

Code:
class InquisitionGameUtils:

3. In init.xml or your config XML if you created a separate file, add this near the end:

Code:
<gameutils module="InquisitionGameUtils" class="InquisitionGameUtils"/>

This will register all of the functions in the class as callback handlers based on their names, autodetecting them as long as they match the names in CvGameUtils which it looks like they do. If you enable DEBUG logging in BUG and restart your mod, you'll see each callback registered as it's loading your config file in PythonDbg.log.

Events

Merging the events is very similar:

1. Use BUG's CvEventInterface module instead of Inquisition Mod's. You also don't need CvCustomEventManager.

2. Definitely no need to modify InquisitionEvents module.

3. Add this to the same config XML file as above:

Code:
<events module="InquisitionEvents" class="InquisitionEvents"/>
 
Thank you very much, that's most helpful. I have posted my comments/questions below. Some of the comments are tips on what to put on the wiki. I am reading the wikidocs, doing winmerge comparisons and looking at at least three python files in Notepad ++ simultaneously to figure this out. That alone should give you a hint as to why we neandertals find this so tricky! :D

BUG's event handling and game utils were primarily designed to make it really easy for me to add features. I have put much of it into XML to hopefully make it easier for others as well. I would love to improve the documentation for non-programmers. The trick is getting inside their heads to explain it in a way that makes sense. Asking specific questions is a great way to help me figure out what's lacking.

Game Utils

Orion made InquisitionGameUtils modular by having its class extend CvGameUtils. This makes hooking it up to BUG a snap.

I understand this now, just by that first sentence. IGU simply adds to the stuff already inside CGU, so there's no editing of the original CGU file, like a normal merge would require. Correct? A little info on the wiki explaining the difference between modular and integrated python, and in particular how to treat the two differently would be immensely helpful.

1. Toss out CvGameInterfaceFile and use BUG's.

This should definitely be stated and explained in the wiki. BUG's CvGameInterfaceFile seems to pass (if that is even the correct term) any inputs to this file on to BugGameUtils. Looking at the code in BugGameUtils, I don't see anything even remotely similar to the code in Orion's CvGameInterfaceFile.

2. I think this step is actually not necessary. If you get strange behavior, modify InquisitionGameUtils to remove the CvGameUtils superclass:

Code:
class InquisitionGameUtils[s](CvGameUtils.CvGameUtils)[/s]:

so it looks like this:

Code:
class InquisitionGameUtils:

Ok.

3. In init.xml or your config XML if you created a separate file, add this near the end:

Code:
<gameutils module="InquisitionGameUtils" class="InquisitionGameUtils"/>

This will register all of the functions in the class as callback handlers based on their names, autodetecting them as long as they match the names in CvGameUtils which it looks like they do. If you enable DEBUG logging in BUG and restart your mod, you'll see each callback registered as it's loading your config file in PythonDbg.log.

Understood. So far, I have added to the init.xml file. I also have the Merged Mod.xml file, which looks like this:

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<mod id="Merged Mod" 
	 name="Merged Mod"
	 version="1.00"
	 url="http://forums.civfanatics.com/showthread.php?t=262206">
	 
	<events module="CvPartisanEventManager"/>
	<events module="InquisitionEvents"/>
</mod>

Are you saying I can paste this
Code:
<gameutils module="InquisitionGameUtils" class="InquisitionGameUtils"/>
into that file?

Events

Merging the events is very similar:

1. Use BUG's CvEventInterface module instead of Inquisition Mod's. You also don't need CvCustomEventManager.

I understand about the CEM. I can also deduct that I should use BUG's CEI, but this should probably also be mentioned on the wiki.

2. Definitely no need to modify InquisitionEvents module.

3. Add this to the same config XML file as above:

Code:
<events module="InquisitionEvents" class="InquisitionEvents"/>

Understood. As you can see above, this I had already done - at least halfways. :D


In more general terms, I think the wiki should perhaps explain what the xml file is capable of, as per my question above. I also miss some general info about what the importing statements at the beginning of the files mean, and, if possible, an overview of what hooks into what. This might be too basic python, I don't know, but it's this type of information that can be helpful.

Anyways, I hope you find these inputs useful! :)
 
2. Definitely no need to modify InquisitionEvents module.

Ah, forgot this question: InquisitionEvents.py imports the CustomEventManager. I am not using that module anymore, so should I import the BugEventManager instead?
 
Both wiki pages have a note at the top saying to keep CvEventInterface.py and CvGameInterfaceFile.py, but I will make them more clear.

Since the InquisitionEvents module wasn't using anything from CvCustomEventManager anyway, you can safely remove the import. There is no need to import BugEventManager, again because you aren't referencing anything from it. Importing a module makes the variable/function names from the imported module available in the importing module. If you aren't going to reference variables/functions from another module, you should not import it.

The objects in two modules can be hooked together externally without either one importing or knowing about the other. This is precisely what BUG does when it sees the <events> element.

You have done the XML correctly. In init.xml you should have

Code:
<load mod="Merged Mod"/>

and paste the two XML lines I had above into "Merged Mod.xml".

CvGameInterfaceFile works like CvEventInterface in that each one merely tells the game which object is responsible for handling events/callbacks. They differ in that CvEventInterface receives all events through handleEvent() whereas game utils callbacks get called in CvGameInterface which route them to the object in CvGameInterfaceFile.

Both BugEventManager and BugGameUtils are called dispatchers. They receive an event/callback and determine which function(s) should receive it. CvEventManager does something similar, but it is designed to have all handler functions be its own functions. With game utils callbacks, the initial dispatching happens in CvGameInterface which calls a specific function in CvGameUtils. BUG changes this by using a second dispatcher, BugGameUtils, that can send the callbacks to other modules, just like BugEventManager does.

If you compare BUG's and Inquisition's CvGameInterfaceFile, you'll see they differ only in the dispatcher object they point to. This is the same for CvEventInterface except that BUG adds a little extra code to this module.
 
Top Bottom