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!
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.
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!