how to un-merge BUG components?

Joined
Feb 6, 2006
Messages
796
I like some of the features of BUG, so I tried to merge it with my mod.
Anyway, it seems a long and hard work, and some files are quite difficult to merge (like GameFont.tga).
Now that you have merged all these components to create BUG, can you help me to un-merge it?? :)
Can you give me some indication, about either which mod components have been used to implement a feature, or which files and/or sections I can use to implement the feature in my mod?
I find very useful the feature that shows a fist icon in the score panel in the main screen, to show AIs in WHEOOH. How can I do, if I want to merge this feature only?
Also, the military screen is a great idea. I've downloaded an old version and I'm looking forward to having the update! Are you posting it in BUG only, or also as a stand-alone mod component?
 
Now that you have merged all these components to create BUG, can you help me to un-merge it?? :)

:eek: Oh no you didn't! :D

Can you give me some indication, about either which mod components have been used to implement a feature, or which files and/or sections I can use to implement the feature in my mod?

If you ask about specific features, yes. I would rather not list out every file that goes with every mod. If you take a look at the help file for BUG (online and in the installation), you can at least see links to the original mods to get their unmerged files and sometimes get a clue as to the files that contain the mod.

I find very useful the feature that shows a fist icon in the score panel in the main screen, to show AIs in WHEOOH. How can I do, if I want to merge this feature only?

Ah, a specific question. Perfect! The scoreboard code is split between two files: Screens/CvMainInterface.py and BUG/Scoreboard.py. CvMI contains the code that inspects the players in order to determine which icons apply. Scoreboard.py, if you have the Advanced Scoreboard enabled, determines which of those icons get show and in what order they get drawn.

If you want to merge in the fist icon without using the Advanced Scoreboard, ignore Scoreboard.py. Looking at the code that does this, you will also need to take BUG/PlayerUtil.py. Here's the code in CvMI that adds it to the scoreboard:

Code:
if (PlayerUtil.isWHEOOH(ePlayer, PlayerUtil.getActivePlayerID())):
	szTempBuffer = u"%c" %(CyGame().getSymbolID(FontSymbols.OCCUPATION_CHAR))
	szBuffer = szBuffer + szTempBuffer

PlayerUtil.py doesn't depend on any other Python files, so you can safely use it outside of BUG. It's actually quite a handy utility module for dealing with CyPlayer and CyTeam and a little with CyCity and CyUnit in relation to players. The comments at the top and for each function are quite comprehensive. Let me know if anything is unclear in that module, please.

On the other hand, Scoreboard.py requires a few BUG files, including the BUG core for options. You can extract those dependencies, but that's a tougher beast to slay.

Also, the military screen is a great idea. I've downloaded an old version and I'm looking forward to having the update! Are you posting it in BUG only, or also as a stand-alone mod component?

I'll let Ruff answer that since releasing it separate from BUG was his baby. I would hope so, but it's starting to rely more and more on BUG utility files, and some of those require the BUG core (initialization) and won't be so easy to extract. :(
 
wow, a thread so similiar to my question i figured it might as well go in here :)

same question, but for all of civ4lerts. i'm trying to merge it with ffh2 for my own benefit, since i always forget to keep track of my city populations and they always get angry ^^;
 
In general, for mods that were released originally by others and later included into BUG, it's probably easiest to merge them directly from the original mod. Otherwise you'll need to remove or replace all the BUG components.

In the case of Civ4lerts, I fixed quite a few of them by fixing the EndTurnReady event in Civ4. This will not be so easy to extract as you'll need BUG's event manager and some code from the dreaded CvMainInterface.py. You could add the functionality from BugEventManager.py to CvEventManager.py if you know Python.
 
yeah, i saw that you had done a lot with the civ4alerts, so i thought i'd try it with your version if possible. i've installed all the bug xml and python files to my mod's folder, and then used winmerge to cobble together a couple of the files. (not the cvmaininterface one though, you're right, it's terrifying. i just used the one from ffh).
with this setup, civ4lerts works perfectly, it's the rest of the bug mod i'm having trouble with; i get TXT_KEY not found errors for all the options in the options panel, and an error where cvDiplomacyutil is sending bugutil.debug too many arguments.

i thought i might be able to prune it down to just the files required by civ4lerts, seeing as i can change options in the .ini if i need to, and i don't think i need the diplomacy util, or the debug logging. i'm working on figuring it out my self, but any help you could give me to set me in the right direction would greatly be appreciated :)

edit: oh wait, i used the maininterface.py from fall further, which already has BUG implemented, and that's why it works. if you could possibly point me towards the code in maininterface that i would need so that i could keep it in line with FFH updates i would greatly appreciate it :)
 
Also, the military screen is a great idea. I've downloaded an old version and I'm looking forward to having the update! Are you posting it in BUG only, or also as a stand-alone mod component?
I released the first proto-type version as a stand alone mod mainly to generate (or try to) interest in BUG. I don't have plans to maintain it. It should be fairly easy (he says with totally no actual knowledge or even trying it) to just pull it straight out of BUG but you might have to take some of the utility files that we've created for it - just check the import files at the top.
 
btw, thanks emperorfool, it took me three re-reads of this thread before i saw your sig and realized i was using an old version of bug for some reason. 3.5 is infinitely easier to work with :)
 
3.5 is infinitely easier to work with :)

Yay! I am so glad that I'm not the only one that feels this way. I was starting to think I had made a grave error by rewriting the BUG Core. I'm so used to learning new coding technologies in my career that I often forget the pain of having spent a lot of time learning method X only to have to switch to method Y. Even if Y is much easier than X, you still have to learn a new method.
 
Back
Top Bottom