Merging BUG with other Mods

So I don't know if this kind of thing has already been addressed here (sorry if it has). I'm trying to do something that I think should be pretty simple, but I'm just not getting it. I'm using BUG (building a mod off of all the work done by Legends of Revolution), but trying to merge in python custom events done by Edgecrusher, and I'm just not getting how to merge python events with BUG.

I want a building to be able to culture bomb when built, so I thought I'd steal Edgecrusher's methods from his CN Tower. But again, I don't know how to merge the python for that with BUG's BugEventManager.
 
hello Omathaar, thanks for using LoR as a base to build off of. I've been hoping someone would use it for a mod mod. And you are correct to ask here about the specific python questions, LoR's python is built off of RevDCM's which in turn is built off of BUG's, so the BUG team usually knows more about it then anyone on RevDCM or LoR's dev teams, in fact I come here quite often with interface issues.

One thing though, to help you, more specifics need to be known. What python files are part of the custom event's done by Edgecrusher? You also should open them up and compare with default BtS code to find the specific modifications Edgecrusher has made. You can then often find these functions in BUG's python by using the "Search in Files" function of notepad++ for the function you are looking for.

For example whenever I've merged in a Python component I'll look at the modded python, compare it, and find something like:

def getPythonFoo
*stuff

has been changed from the default BtS code (totally made up function, but assume getPyhonFoo is in default BtS for the sake of my explenation), and I'll find this function in BtS CvEventManager.py file. So then I'll search for "def getPythonFoo" in the BUG files, using search in files function of notepad++, usually something in CvEvenentManger.py in BtS has been moved to BUG's BugEventManager.py file, so assuming this happens, I'll open up notepad, and merge in the changes to BugEventManager's def getPythonFoo function.

So that's a cursory explenation of how to begin. Hope that's helpful.
 
hello Omathaar, thanks for using LoR as a base to build off of. I've been hoping someone would use it for a mod mod. And you are correct to ask here about the specific python questions, LoR's python is built off of RevDCM's which in turn is built off of BUG's, so the BUG team usually knows more about it then anyone on RevDCM or LoR's dev teams, in fact I come here quite often with interface issues.
arrrrg - shoot me now. Someone else that uses 'off of' - this expression kills me as it sounds stoopid (sp) and is wrong. Please, just stick to 'LoR's python is built off RevDCM's'.
Spoiler :
sorry about the grammar rant ... actually, I'm not really sorry :D
 
I just hate the superfluous (to me) 'of'. I have only ever heard it used in America ... so it must be wrong ... right?
 
I just hate the superfluous (to me) 'of'. I have only ever heard it used in America ... so it must be wrong ... right?

I couldn't say for sure. Personally I'd take greater issue with Webster's insistence on changing English so it was better for Americans and all the annoying Websterisms my spell checker tries to correct me on.
 
@Omathaar - The BUG documentation on events is the first place to start. I agree it needs some good complete examples.

Next we need to know how the mod your merging in was built itself. Some provide a modified copy of CvEventManager.py. This is the toughest to work with because you need to extract the changes they made into a new module and ditch CvEventManager. The other possibility is that it uses CvCustomEventManager.py. In this case merging is pretty easy and should be covered by the docs above.

No matter how the mod was built you will need to create a configuration XML file that BUG will use with your merged code. Again, the docs cover how to make this as well as the Configuration section.
 
http://www.wsu.edu:8080/~brians/errors/based.html

:confused:
arrrrg - shoot me now. Someone else that uses 'off of' - this expression kills me as it sounds stoopid (sp) and is wrong. Please, just stick to 'LoR's python is built off RevDCM's'.

Canadian chiming in: I remember a 20-minute-long rant my grade 11 English prof went on about "off of" and other grammatical errors. And I'm 29 now, so it's obviously stuck me. :D So it's not just you ruff_hi!!!
 
It's obviously stuck me.

It's stuck you, has it? Like a pig? Perhaps it struck you or it stuck with you, or maybe it even stuck off of you. :mischief:
 
Hey, I'm making a screen mod mod for RoM 2.8 which uses BUG 4.0. I've never made a new screen and the only tuts I've found were for vanilla BTS. If I could get a tut or example of an already existing screen but with only the files it affects would be nice. I've attempted it twice but with silent errors, looking at different screens in the python folder to try to construct it. The logs didn't really help either.
 
We haven't built new screens for BUG yet--only new tabs on existing screens--so I don't have any good examples other than what's in BTS. Did you get Python errors in PythonErr.log? What is your screen supposed to do? Is it similar to any other screens? Does it have any complex interaction or just present information like the Finance Advisor?
 
Well it's a space screen for galactic colonization, but I'm just trying to get it to open for now. Nothing is on or attached to the screen, just want it to open and close with it's own button on the main interface. I can add the tabs info etc. later. and no, I didn't get errors, it was a silent fail with nothing than initiating all the other python stuff (at least I think it's logging, was suppose to be on by default, or so I heard).
 
The tutorial posted about making a basic screen should work for BTS (nothing on that front has changed). Perhaps your code that detected the button press on the main interface was the part that failed and not the screen itself.

There are a lot of helpful people on the SDK/Python forum. I recommend posting up your code in a ZIP as a mini-mod and ask for help. If you paste the CvMainInterface code that should open the screen in your post I bet you'll get some help.

One thing I can say is that creating a new screen in BUG will not differ from how you'd do it in regular BTS. BUG has some code to help you allow the user to customize your screen, but nothing to help build a screen.
 
Thanks tons for the help, EF and phungus. Yeah, I love LoR, I use it instead of BtS :D You did a lot of stuff I was trying to do with my own merging of mods, and you did it a lot better, lol. It's great to be able to stand on your shoulders.

As for my problems, tho, I guess I need more help. I don't know enough python to make enough sense of the pages you sent EF, and still no luck with trying to figure out how to merge on my own. Here's some more detail of what I'm trying to merge in:

Edgecrusher made it so the Eiffel Tower culture bombs when built. His download has a python folder, which has a CvCustomEventManager inside, along with an EntryPoints folder that has CvEventInterface, and a CustomEventManagers folder. The CustomEventsManagers folder has a CultureBomb folder, which has CultureBomb.py and CvCultureBombEventManager.py inside. EF, you said it's pretty easy to merge a mod with a CvCustomEventManager, so I'm in luck there. I'm just trying to merge this little mod with normal LoR python, if that helps.

Do you need any detail about what's in the individual python files?
 
All you should need are CultureBomb.py and CvCultureBombEventManager.py--ditch the other Python files. Next you need to tell BUG to use CvCultureBombEventManager by adding a line near the end of Assets/Config/init.xml. There should be a section marked "<!-- Mods -->". After that line add this line:

Code:
<events module="CvCultureBombEventManager"/>

See if that works. If not, it will require more work and inspection of the module itself.
 
No way....wow, you did make it simple! Thanks, that sounds like it should work, I'll let you know if it doesn't. Hope I can just do this with other python modcomps too.
 
I merged my personal BTS mod of Next War with BUG 4.2 by installing BUG as a standalone mod and then copying the BUG folders and files into my mod’s appropriate folders.

Only four files were duplicated. Two I omitted (the Terrain art folder and CIV4RouteModelInfos.xml file) because I had already modded the roads and didn’t want to change. That left (CIV4EventInfos.xml and CIV4NewConceptInfos.xml) for which I used Winmerge to combine the BUG differences into my files.

The merged mod works great except for a few event errors such as “unit built event handler error” for new units I created for the mod, and some errors I haven’t been fast enough to catch while playing (I often forget I'm debugging when I play the game).

What am I missing in the merge process that will make my mod work perfectly?

PS. Most of the “BUG modders’ corner” is beyond my level technical skill at this point but I’m willing to learn.
 
Start by looking at the Troubleshooting page for the instructions to enable logging. This will write all those Python exceptions you see to a file for later perusal. Cammagno put together a Next War merge a while ago, so you could read that thread as we discussed the problems he had to fix to get them to play nicely together.

Without the specific stack traces I couldn't begin to guess why it's failing for you. Turn on logging and post some stack traces here.
 
I enabled logging and played a few turns before trying Cammagno’s python files, see attached files.

Note: Even with “HidePythonExceptions = 1” the error messages are still spamming the screen.

I looked at Cammagno’s Python files he uploaded, and tried them in my mod without changing them. His file CvScreensInterface.py was incompatible with BUG 4.2 as some of the advisor screens failed to work in the game.

Cammagno’s files: CvRandomEventInterface.py and CvEventManager.py appear to be adapted for the additional random events added in the original Next War mod. I do not know if these files are compatible with BUG 4.2 since I would have to wait for one of these random events to strike.

I would appreciate any help you can provide.

Thanks.

FYI Disclosure:
OS: XP home SP2
BTS 3.19
BUG 4.2
Installation source: EXE
Multiplayer (Mods Folder)
Modded mod of BTS Next War
 

Attachments

  • PythonDbg.log.txt
    161.2 KB · Views: 79
  • PythonErr.log.txt
    4.6 KB · Views: 86
Top Bottom