Working On zModular Python, Any Feature Requests?

Well screens I thought just be renamed and loaded from the default path, but anything that tells what screen to be used to be loaded from modules. Basically someone could drop in a folder that tells the game to load a different python screen versus manually merging it in the python folder.

It would be nice to have all the screens modular in tabs though, but doubt anyone would actually finish doing that on the maininterface alone for example so that loads in sections. Well anyway that is what I was hoping for just load different screens by adding something to modules. Modular screens are not going to happen.

The random events might be useful for others because of how hard it was to link them in before they might find it easier to add some now. I mean if they are modular it is a lot easier for them to test them by dragging and dropping I mean. But I am not sure really if there is a demand.

Zebra I think is working on more modular files, but I am not sure. Thanks again for all of the help.
 
The main hurdles to having completely modular Python are pretty high. First, the interface just isn't going to be modular. Probably the best we could achieve would be to have the ability to add tabs to screens, but that would require rewriting those screens entirely. And I know of very few mods that consist of just adding/replacing a tab to a screen.

As for having .py files outside the Python folder, that is controlled by the Python interpreter. Civ4 initializes it with a set of system folders (like a system path for finding applications), all the folders under Python. It may be possible to add new folders to that set, but then you need to deal with name conflicts (if that's possible).

The only truly modular parts that I've seen so far are events and game-utils. I think random events could be made modular with some Python trickery, but I don't know how many mods there are that add new events. If this would be something very useful, I'd consider adding it to BUG.
I already have solved the name conflicts. Instead of using the "__import__" method I'm using the "execfile" method. This also allows me to do some other cool stuff, adding to the module abstraction. :D IMO the reason you don't see new events that often is because the current event system is so bulky and poorly designed that it is almost pointless to make new events outside of a full fledged MOD. I am going to modularize the random events with what should be a very simple change to the SDK. This would make it possible to add your own python without touching any other python files. I also have some ideas to make the event XML more flexible.:)

P.S. I might work on a system that allowed a config file to control which python file to use for a screen.


EDIT: I'm getting ready to head back to college so this might take a little longer than I had hoped.
 
Top Bottom