Dr Elmer Jiggle said:
One thing I've noticed that isn't going to solve your problem but that will be a good idea in general is that you're calling the superclass event handler from all of your handlers. You don't need to do that anymore. CvCustomEventManager already does that, so you're actually calling all those handlers twice. It probably won't make a difference in most cases, but it could cause strange behavior depending on exactly what those handler functions do.
I'll look at this again later, but I don't see anything obvious at first glance. My intuition is that it's something about your modified CvEventManager class. That's the base class of both CvSpockoEventManager and CvCustomEventManager, and I wouldn't be surprised if one of the modifications is causing a problem for one or both of those classes. Can you post that file?
What you say rings true, because when I start a new game, the Dawn of Man window displays twice. But, being a newbie to OOP and Python, I don't know how to take action on this - I'd like to not be calling all those handlers twice, but I don't know what to comment out in which EventManager file.
The inner list of event handler invocations in step 3 is deliberately unnumbered. Although I think the current implementation does call the handlers in the same order in which they were registered, and with the default handler first, I'm not sure I want to make that guarantee. Just assume that your handler will be called at some point but not necessarily first, second, or last. For example, it's conceivable that the base class handler would be called after yours.
I'm interpreting this as meaning that several files can include a "def takeAction" block of statements, and all of these blocks would eventually be called by the system. For example, if three files that are called via imports have the following three blocks:
Code:
{CvEventManager}
def takeAction
statement A
statement B
{CvCustomEventManager}
def takeAction
statement J
statement K
{CvSpockoModEventManager}
def take Action
statement X
statement Y
... then the system would see "def takeAction" as being a block for all six statements, A,B,J,K,X, and Y - and that the system would not accept only the last block as an overriding of any previous encounters with a "def takeAction" block. If so, I see how I am not having problems just because def statements are defined differently in the three EventManager files. And it thus may not be helpful for me to try to fuse these three files together. What do you think? Am I learning?
My previous post (three or four posts above) have attached text files that include the contents of my three EventManager files.
My specific problem is with respect to the "Reminder" mod that is embedded in CvEventManager - pressing Shift-R no longer invokes this handy mod. You can see in CvEventManager five blocks of edits each preceded by a comment such as "# reminder addition 1/5".
I've been waiting for the new patch to use the new files to rebuild SpockoMod. But since the patch has yet to be published, I'm thinking of rebuilding SpockoMod (which is a conglomeration of 30 or so forked mods, many of which do not touch the EventManager) this week starting with the original Civ4 CvEventManager and your CvCustomEventManager. I would just add one mod at a time and test each time to verify that each additional mod works. But before I do this, I want to work toward a greater understanding of how your CvCustomManager works so that I can rebuild SpockoMod in an informed way and so I can add new forked mods later in an informed way.
Oh, incidentally, the crown jewel of SpockoMod is that I've combined Alilum's "Alt Religion" mod and Kidinnu's "True Prophet" mod - because of this, religions are founded by Great Prophets (not by technology discovery) and the religions founded are abstract religions, not named after Earth's religions. It has been hard to see Berlin a center of Hinduism - oh, and I've renamed all cities to be abstract names that sound like they came from their respective cultures, but they're not real names (an idea forked from Alilum's "Generic City Names" mod).
Thank you for your time,
Spocko