Merging BUG with other Mods

Well, I have done everything as you've explained. When I load up a game, I get no interface, and this content in the PythonErr.txt:

Code:
Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "<string>", line 52, in load_module
  File "CvEventInterface", line 19, in ?
  File "BugEventManager", line 168, in __init__
  File "InquisitionEvents", line 35, in __init__
  File "BugEventManager", line 242, in addEventHandler
AttributeError
: 
'function' object has no attribute 'append'

Failed to load python module CvEventInterface.
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
Traceback (most recent call last):

  File "CvAppInterface", line 56, in onLoad

AttributeError: 'module' object has no attribute 'onEvent'
ERR: Python function onLoad failed, module CvAppInterface
Traceback (most recent call last):

  File "CvAppInterface", line 63, in preGameStart

AttributeError: 'module' object has no attribute 'getEventManager'
ERR: Python function preGameStart failed, module CvAppInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
ERR: Call function onEvent failed. Can't find module CvEventInterface
...

The CvEventInterface file is there, unedited, as in BUG 4.0. What's wrong?
 
Did you modify BugEventManager? That stack trace is showing that BugEventManager.__init__() is calling InquisitionEvents. You should not modify BugEventManager like you would CvCustomEventManager.
 
Oh, darn, that was an from an older attempt at merging these two. I will try again later today. Thanks again!
 
Ok, using BugEventManager unmodded gives me back the UI. However, when I try to use the Inquisitor, nothing at all happens and I get this error message:

Code:
Traceback (most recent call last):

  File "CvScreensInterface", line 905, in handleInput

  File "CvMainInterface", line 7067, in handleInput

AttributeError: BugEventManager instance has no attribute 'm_iNetMessage_Inquisitor'
ERR: Python function handleInput failed, module CvScreensInterface

Now, this relates to code that used to be in the CustomEventManager. I previously tried merging it into BugEventManager, placing it in the exact same position as in CEM, so it would look like this (code inserted at the bottom):

Code:
	def __init__(self, logging=None, noLogEvents=None):
		CvEventManager.CvEventManager.__init__(self)
		
		global g_eventManager
		if g_eventManager is not None:
			raise BugUtil.ConfigError("BugEventManager already created")
		g_eventManager = self
		
		if logging is None:
			self.setLogging(DEFAULT_LOGGING)
		else:
			self.setLogging(logging)
		if noLogEvents is None:
			self.setNoLogEvents(DEFAULT_NOLOG_EVENTS)
		else:
			self.setNoLogEvents(noLogEvents)
		
		self.bDbg = False
		self.bMultiPlayer = False
		self.bAllowCheats = False
		
		# used to register shortcut handlers
		self.shortcuts = {}
		
		# init fields for BeginActivePlayerTurn
		self.resetActiveTurn()
		
		# map the initial EventHandlerMap values into the new data structure
		for eventType, eventHandler in self.EventHandlerMap.iteritems():
			self.setEventHandler(eventType, eventHandler)
			# Net Messages for Inquisitor  #The two lines below was added by Ninja2
			self.m_iNetMessage_Inquisitor = 0
			InquisitionEvents.InquisitionEvents(self)

However, now I am back to no interface. Where am I to put those two line of code?

Cheers.
 
You don't need those two lines. It is using m_iNetMessage_Inquisitor as a constant for the ModNetMessage ID, and it never changes. There are better ways to fix this from a program design point of view, but the simple fix is good enough. Modify handleInput() in CvMainInterface:

Code:
		[s][COLOR="Red"]pGodsOfOld=CvEventInterface.getEventManager()[/COLOR][/s]
		
		# Eliminates Religion from city
		if (inputClass.getNotifyCode() == 11 and inputClass.getData1() == 665 and inputClass.getData2() == 665):
			pPlot = CyMap( ).plot( g_pSelectedUnit.getX( ), g_pSelectedUnit.getY( ) )
			
			iMessageID = [COLOR="Green"]0[/COLOR] [s][COLOR="Red"]pGodsOfOld.m_iNetMessage_Inquisitor[/COLOR][/s]

Also, remove those two lines you added to BugEventManager.
 
Thank you, it now appears to be working correctly!! :)

I got a brand new error in the log, though...

Code:
Traceback (most recent call last):

  File "CvScreensInterface", line 905, in handleInput

  File "CvInfoScreen", line 3059, in handleInput

  File "CvInfoScreen", line 666, in redrawContents

  File "CvInfoScreen", line 1651, in drawTopCitiesTab

  File "CvInfoScreen", line 1861, in drawWondersTab

  File "CvInfoScreen", line 2531, in drawWondersList_BUG

AttributeError: 'NoneType' object has no attribute 'getColorTypePrimary'
ERR: Python function handleInput failed, module CvScreensInterface

I have not edited CvInfoScreen. Inquisition adds a new wonder, would that cause this error though?
 
That error is on this line:

Code:
color = gc.getPlayerColorInfo(gc.getPlayer(iPlayer).getPlayerColor()).getColorTypePrimary()

It means that getPlayerColorInfo() is returning None, probably because getPlayerColor() for that player is returning -1. Do you have any civilizations with an invalid player color specified (not found in CIV4ColorVals.xml)?
 
No, everything appears to be defined correctly. However, one of the colors is called COLOR_X_DARKRED, so it doesn't follow the syntax of the other colors, i.e. COLOR_PLAYER_BLUE, COLOR_PLAYER_WHITE, etc.
 
The actual key for the color doesn't matter as long as it matches one in CIV4ColorVals.xml. "NOT_A_REAL_COLOUR" is acceptable. Is there anything special about that game? Was it modified in WorldBuilder at all? AFAIK it pulls all of the wonders from all of the cities from all of the living players, so it shouldn't end up with an invalid player.

And the CyPlayer is coming back valid otherwise the error would say "NoneType doesn't have attribute getPlayerColor". The color comes back as -1--that's the only way I could see getColorInfo() to return None. :confused:
 
Well, I added some Inquisition units using the WorldBuilder, but I have not touched any wonders in any cities, nor placed any. I will do some more testing and report back if I see this error again. Like I said, I have NEVER seen it before, and I doubt it has anything at all to do with the Inquisition code.
 
Following your previous posts, I have just finished merging my Inquisition Mod with BUG 4.0 and I like it. :thumbsup: I see potential. :yumyum:

Now, I want to take this one step further and Merge WoC Lite, which currently utilizes an older version of BUG. How hard would it be to upgrade WoC Lite to utilize BUG 4.0? :confused:

Respectfully,

Orion Veteran :cool:
 
Mostly you just replace all the files in WoC with the latest versions from BUG. It really depends on how they did the merge. If they avoided modifying files from BUG (except init.xml, that's still required right now), this is a snap. You should ask the WoC team how they did the merge or for them to update BUG in their mod.
 
Mostly you just replace all the files in WoC with the latest versions from BUG. It really depends on how they did the merge. If they avoided modifying files from BUG (except init.xml, that's still required right now), this is a snap. You should ask the WoC team how they did the merge or for them to update BUG in their mod.

I have just finished combining OIM, BUG 4.0 and WOC Lite. This mod pack will become my standard mod package, from which to begin all future mod packs. Testing revealed it all works! But now after all that work, I find that you have released BUG 4.1. I have two questions:

1. What significant improvemenmts were made to BUG 4.1 over version 4.0?

2. Can you specify which files were changed?

I'd like to focus my merge effort to only those files that changed in BUG 4.1.

Respectfully,

Orion Veteran :cool:
 
Using our Subversion repository you can easily see the differences between any two BUG versions. I tag each release which makes a copy of the files at the time of release.

Install TortoiseSVN so that you can check out the BUG files. Then checkout the two versions you want to compare. They are all stored in the /tags/releases folder.

If you're unfamiliar with using SVN, you might just want to download the two ZIPs and compare then using WinMerge after expanding them. I don't have a list of which files were changed, but you can use either SVN or WinMerge to find out. Most of the changes were fairly minor, and I'd bet most were in files you didn't modify during the merge except for CvMainInterface.py.
 
I know this is going to sound monumental, maybe insane eaven but how would I go about merging this with Ryes. And yes, I am willing to go into the DLL.
 
BUG currently works with 3.13 through 3.19. BULL only works with 3.19. The two are complementary but will work fine alone each. If RFC has been updated to 3.19, you can choose either one or the other or both to merge; otherwise only BUG will work.

The first step is to familiarize yourself with how mods are merged with BUG by skimming the BUG modding docs. We at BUG follow the Eat Your Own Dog Food principle, so there are plenty of working examples of how to use events and configuration in BUG.

I'm not at all familiar with how RFC was built or what it contains. If it has events, I would bet that it uses CvCustomEventManager. If so, you can hook up its event managers to BUG easily. The big issue will be CvMainInterface.py. This is a huge module that draws both the main interface and the City Screen. BUG has an Advanced Scoreboard which is drawn by Scoreboard.py, but the data that it draws is filled in by CvMainInterface.py right along the normal scoreboard code. This might be the trickiest module.

I would recommend getting WinMerge and diffing RFC against the original BTS Python sources. BUG has a bootstrapping initialization process that occurs when either you start or load your first game, and this must not be tampered with for BUG to work. Thus I suspect it may be easier to merge RFC with BUG rather than the other way around.

Then get started and post your questions and issues here. :goodjob:
 
That's fine, I am stuck on 3.17 due to some other mods I am working on and once I can complete this experiment I may try to make a 3.19 version but this is purely experimental.

Thanks for your support, firstly (and this is going to make me sound stupid but) what is WinMerge and where do I get it.
 
I'd like to merge my own DLL mod with BULL. Where could I go to find all the modified sourcecode files in one place?

PPQ, WinMerge can be found with a Google search. It's an open-source project, so downloading it is free. WinMerge allows you to easily compare two files, highlighting the differences between them. It's incredibly useful.
 
Thanks, now step 2:

BUG has many files that don't exist in RFC or even in normal civ.
Do I just copy these?
 
PPQ, yes just copy those over.

Draco, www.civ4bull.sourceforget.net you'll need SVN to get it easily. There are directions on our New Files thread on how to set it up. Just change civ4bug to civ4bull
 
Top Bottom