Merging BUG with other Mods

I suspect that when BUG says it cannot find the module, it is only responding to any error it encounters when loading the module. I will double-check this when I get home Friday, but that's my guess.

The best way to proceed is one module at a time, and you may have done that already. If TWE is the last one to do, try importing it yourself elsewhere to get the real error that's happening. You can do this in the Python console in the game.

Put "chipotle" in for the cheat code without quotes and then start/load a game. It doesn't matter if you have no interface. Hit tilde (SHIFT + `) and type

Code:
import ThomasWarEvents

You should see the errors when loading it. Hopefully they will also be written to PythonErr.log so you can easily past them here. Otherwise a screenshot will do.
 
Any word on that event handler? Can it be handled somehow? Becouse merging it seems to be beyond my skill.
 
@PPQ_Purple - Try this file. It looks like that event manager was based on or the basis of Dr. Elmer Jiggles's CvCustomEventManager. I removed the stuff for that and kept just the RFC-related things.

Code:
## This file is part of Rhye's and Fall of Civilization.
## This file was originally taken from CivPath mod.
##  modified by eN

import CvRFCEventHandler
import RiseAndFall
import Congresses

class CvRFCEventManager:

    def __init__(self, eventManager):
        self.CustomEvents = {
            7614 : ('RiseAndFallPopupEvent', self.rnfEventApply7614, self.rnfEventBegin7614),
            7615 : ('FlipPopupEvent', self.rnfEventApply7615, self.rnfEventBegin7615),
            7616 : ('VotePopupEvent', self.congEventApply7616, self.congEventBegin7616),
            7617 : ('AskCityPopupEvent', self.congEventApply7617, self.congEventBegin7617),
            7618 : ('DecisionPopupEvent', self.congEventApply7618, self.congEventBegin7618),
            7619 : ('InvitationPopupEvent', self.congEventApply7619, self.congEventBegin7619),
            7620 : ('BribePopupEvent', self.congEventApply7620, self.congEventBegin7620),
            7621 : ('GoldPopupEvent', self.congEventApply7621, self.congEventBegin7621),
            7622 : ('ResurrectionEvent', self.rnfEventApply7622, self.rnfEventBegin7622),
            7623 : ('AskNoCityPopupEvent', self.congEventApply7623, self.congEventBegin7623)
        }

	eventManager.Events.update(self.CustomEvents)

        CvRFCEventHandler.CvRFCEventHandler(self)
        self.rnf = RiseAndFall.RiseAndFall()
        self.cong = Congresses.Congresses()

    # popup events
    def rnfEventBegin7614(self):
            pass
       
    def rnfEventApply7614(self, playerID, netUserData, popupReturn):
            self.rnf.eventApply7614(popupReturn)

    def rnfEventBegin7615(self):
            pass
       
    def rnfEventApply7615(self, playerID, netUserData, popupReturn):
            self.rnf.eventApply7615(popupReturn)

    def congEventBegin7616(self):
            pass
       
    def congEventApply7616(self, playerID, netUserData, popupReturn):
            self.cong.eventApply7616(popupReturn)

    def congEventBegin7617(self):
            pass
       
    def congEventApply7617(self, playerID, netUserData, popupReturn):
            self.cong.eventApply7617(popupReturn)

    def congEventBegin7618(self):
            pass
       
    def congEventApply7618(self, playerID, netUserData, popupReturn):
            self.cong.eventApply7618(popupReturn)

    def congEventBegin7619(self):
            pass
       
    def congEventApply7619(self, playerID, netUserData, popupReturn):
            self.cong.eventApply7619(popupReturn)

    def congEventBegin7620(self):
            pass
       
    def congEventApply7620(self, playerID, netUserData, popupReturn):
            self.cong.eventApply7620(popupReturn)

    def congEventBegin7621(self):
            pass
       
    def congEventApply7621(self, playerID, netUserData, popupReturn):
            self.cong.eventApply7621(popupReturn)

    def rnfEventBegin7622(self):
            pass
       
    def rnfEventApply7622(self, playerID, netUserData, popupReturn):
            self.rnf.eventApply7622(popupReturn)

    def congEventBegin7623(self):
            pass
       
    def congEventApply7623(self, playerID, netUserData, popupReturn):
            self.cong.eventApply7623(popupReturn)

Save this as the same file you posted.
 
How do I test it, do I just run normal RFC with this in the place of the original file?
If that is the case than I must report that the test is negative, as in the game loads perfectly and the scenario loads perfectly but at game start there is an instantanious "You have been defeated" message.
 
I thought you were trying to merge RFC with BUG? Ideally you'd add each module one at a time to BUG, but that's unlikely to work. Instead you may have to try to merge everything at once. How many Python modules are there in RFC?

No, this module by itself replacing the one in RFC with no BUG components is not going to work.
 
A lot, but most of them handle different things and since BUG is only interface based I don't have that many files to merge (only 22 files to do).

But I honestly have no idea how to test this file you want me to test. What do I do with it?
 
This file imports other RFC Python files, so you can't test it in isolation. At the very least you need to copy over the RFC files imported at the top of the module as well, and any modules they import, and so on. This is where merging can get tricky.
 
Wait now? I am sorry but I am completely lost now.
I have my Merged RFC files (most of them at least), I have this code that you posted for me, I have the BUG version of the same file and I have absolutely no idea what to do with it.

This code has to be merged in with the BUG event handler right?
 
1. Copy RFC to a new folder called "RFC BUG"
2. Copy BUG over this new "RFC BUG", replacing all files in common.
3. Copy this new file we worked on into "RFC BUG".

Now, there are probably other files in common, yes? If no, try the above. If yes, you need to find those files and modify each one to get it to work.
 
Just one thing about that, if I use this file as the RFC event interface wich CvEventInterface.py do I use?
The RFC version will only call the worked on (posted here) RFC file but will ignore the BUG EventHandler so BUG won't work.

Conversly if I use the BUGEventHandler it won't load the file we were working on.

I am 100% lost.
 
You use the BUG one, and then you need to hook up the RFC event manager to BUG by adding this to init.xml near the bottom:

Code:
<events module="CvRFCEventManager"/>

The BUG Core: Events page I linked to before explains how the XML configuration works. You need to read that page and ask specific questions about the things you don't understand.
 
I did what you said (hopefully correctly) and I still get the same thing. (abit note that I did not merge all python and any of the XML files yet).

I just hate it that I am so clueles as to what I am doing.
 
I need more information to help. Are you getting error messages? If so, what are they? Post the contents of PythonErr.log and PythonDbg.log. Did you read that page I linked? What did you understand? What parts didn't make sense?
 
@Are you getting error messages?
No

@Post the contents of PythonErr.log and PythonDbg.log.
Too long to post, had to upload.

@What parts didn't make sense?
It all makes sense, I just have no idea what to do with it.

PS. This forum is killing me...
 

Attachments

  • Logs.zip
    4.5 KB · Views: 203
I see a lot of errors in there that make me suspect that you have replaced some BUG files (CvEventInterface maybe?) with ones from RFC. You must be absolutely sure that all BUG files are in there.

I would start with a copy of BUG and slowly add parts of RFC until you get it working. Never replace BUG files with files form RFC.
 
I did as you said, copied the BUG files (and merged bug files, that I created by opening bug files and adding text from RFC files) over the files in the RFC directory and pressed Yes to All on the overwrite question.

No way anything from RFC replaced anything from bug.
 
I have a fairly simple question, which has sure been often asked, but i can't find it somewhere: What do you have to modify to play with BUG + a >18 civs mod?
I've already looked at this thread, but it doesn't help.
The user, who has the problem, has already installed a 40 civs dll, but get's the no interface issue and a python exception (picture).

I hope (okay, i'M sure :D), this can be solved fast :).
 
That the user is playing with a 40 player DLL shouldn't have an effect. BUG doesn't depend on anything special in the DLL. When they remove the DLL, do they still get this exception?

This is a generic exception that happens when BUG doesn't complete initialization. I'll take a look at fixing this artifact so people can at least play when BUG doesn't initialize.
 
That the user is playing with a 40 player DLL shouldn't have an effect. BUG doesn't depend on anything special in the DLL.

So i thought right :). I was really suprised, when this was reported.

When they remove the DLL, do they still get this exception?

Yes, he does.

BUG is installed in custom assets and works in the normal game.
If he loads the mod, it doesn't work anymore (with and without dll).

-> Any obvious mistakes, which could lead to this?
 
Ah yes, this bug is caused by a "fix" I added for BUFFY users that also had BUG installed to the CustomAssets folder. If BUG detects that a mod is loaded, it ignores the CustomAssets folder when looking for its config XML files.

Solution: Copy "CustomAssets/Config" to "<mod>/Assets" so that the path to init.xml becomes "<mod>/Assets/Config/init.xml". This must be done for any mod that you want to play.

I'll have a fix for the next BUG release.
 
Top Bottom