modular python loading in ffh

davidlallen

Deity
Joined
Apr 28, 2008
Messages
4,743
Location
California
In the download database, I happened to find this recent entry: Modular Python Loading by arcticnightwolf. There is no discussion thread listed, and I wasn't able to find one easily in the ffh forums, so I added a comment to the download page. It appears to "grep" in user python files for names matching a certain pattern, and then call the functions. This is limited compared to the BUG capability of registering callbacks, but it is also a little simpler to use because it does not require any user action.
 
discussion thread about this is in internal RifE developer forum, so it's not available for normal users;
however i put this into file DB so any developer could look at it and eventually find some bugs and/or use it ... if you use it, just send me PM, that you use it, just so I know ;)
 
You may find it interesting to look at what BUG has already done here. The capabilities in BUG are much more complete and do not require the user to choose special names for the functions. There are multiple discussions in different FFH sub-forums about "BUGifying" FFH, which I think would be an excellent project.
 
Problem is, that this is seems to be coded in dll. Unfortunately I was unable to convict my linker to link CvGameCore dll, so my solution is coded only in python ... :D
 
You may find it interesting to look at what BUG has already done here. The capabilities in BUG are much more complete and do not require the user to choose special names for the functions. There are multiple discussions in different FFH sub-forums about "BUGifying" FFH, which I think would be an excellent project.

I'm honestly not too interested in merging BUG. There are certain aspects that are nice, and that is one of them, but on the whole I don't want most of the features.
 
One thing BUG is still missing is auto-discovery of modules by placing a modcomp folder inside a Modules folder a la WoC. I opened a discussion with a few modders a ways back, but I never felt I got a good consensus of their needs.

That being said, it's something I very much want to add. As for picking the functions out of a module, I decided against it because in many cases I wanted one function with a more descriptive name to be called by multiple events. In the end this probably wasn't necessary and could easily have been achieved by having two event functions call this other function. I also wanted to support custom event managers written to work with CvCustomEventManager.

BTW, in CvEventManager where it loads the modules using imp.load_module(), the first loop isn't closing the files after importing the module, but the second loop does.
 
Back
Top Bottom