Magnum wrote (a long time ago):
Quote: The biggest challenge to all of that is the interdependency between the plugins. All of those proposed plugins require certain levels of interdependency on the others. The "monitor" calls the "Spellqueue" when my health drops too low, the "Autobots" only function when they are toggled on, and depend on "Monitor" data, and issue calls to the "SpellQueue", etc. Given the stickiness of making cross-plugin calls, this could require some interesting and
innovative subroutines. Also, because of that interdependency, I pretty much need all 3 to in production at the same time, else I go without a lot of functionality while I develop the next one. It's enough to make me want to just keep them all in the current state they are in... but again, it's not practical if I want to develop ALT characters.
Heh, since we are having flashbacks... I'll bring up another thing in this connection - the EventManager plugin. Here's a snippet from one of my EventManager instances, which allows a plugin to report a certain value changing to any other plugins (IDs - since the world can be called also) and point those other plugins in the direction of that value, so they can use world.GetPluginVariable() on it.
'Register a new event
RegisterEvent "OnVariableChanged"
'Register a plugin to listen for the event, supplying the plugin's ID and the event's name.
'The listening plugin must have a sub with the same name as an event it is listening to and
'this sub must accept exactly 1 argument, otherwise the event will cause an error
RegisterListener "9ba81f81508fb8a03adac921", "OnVariableChanged"
The plugin being called is responsible for knowing how to handle the offered value, and therefore should only retrieve the contents of variables whos names it is familiar with. The event includes the caller's ID and a variable name as a '_' delimited list.
Since all the EventManager needs to know in order to keep the whole setup running are IDs, you can even go so far as to create multiple "instances" for the same IDs, by assinging different names to plugins but keeping their IDs, each slightly modifying the ID's behaviour. If you plan it right, you could even make a plugin to switch alts on the fly by switching ID implementations with a single alias, though that would require that your world file contains ONLY stuff that is 100% guaranteed to be used by all your alts unmodified, meaning - practically nothing, which is about as much as mine does nowadays ;) |