usf-team team mailing list archive
-
usf-team team
-
Mailing list archive
-
Message #00034
USF-MOD Progress
To be honest, after the first attempt at writing a functional plugin system, I haven't touched usf-mod-- until today. Part of the reason was that I wanted to wait until my brain stopped hurting, and the other reason was that I have been active on talk.maemo.org (my phone's OS) helping write a couple of programs for it (aptly and vertsms if you're curious).
I finally decided to do a bit of work on usf-mod today at a second plugin system and wanted to report that I have it working! The only think that doesn't work yet is dynamically importing plugins from a user-defined plugin directory, and some default behavior. I will update the wiki with documentation on how the plugin system works and push my changes early tomorrow morning (heading to work soon), but here's a glimpse:
USF-MOD (short for modified or modular if you are curious) defines plugin mount points, which describe what the plugin can do. For example, I've already implemented a dummy mountpoint called GameMode. Other examples might be items, bots, etc. A user then need only follow the documentation for these mount points (help(GameMode) or GameMode.__doc__) and subclass them to create a plugin. For example:
class CaptureTheFlag(GameMode):
name = "Capture the Flag"
...
Is a perfectly functional game mode -- albiet useless.
Next I just need to modify config.py to load plugins correctly. (there is a plugin option in the config file which allows a user to choose which plugins are loaded. Later, there should be an in-game option that will allow them to load plugins on-the-fly).
Keep your eyes open for changes on my gitorious repo.
--Aspidites
____________________________________________________________
Publish your photos in seconds for FREE
TRY IM TOOLPACK at http://www.imtoolpack.com/default.aspx?rc=if4