In a previous post, I mentioned my intent to support the scheduling of events within The Enforcer. This is something that's been requested, and there are several interesting use-cases for such a feature. So I had started work on building a scheduler into The Enforcer that could generate events on a predefined schedule. However, when quite a way along with this effort, I had an idea if how to do it rather more elegantly.
There are two very distinct types of scheduled events we might want to support: ones that occur on a schedule (e.g. "every day at 10am"), and ones that are one-shot and occur after a delay (e.g. "in ten minutes from now"). The latter could be used to initiate a trance every so often, or to check whether the sub is making progress with some task; the former is suitable for "housekeeping" tasks, particularly in situations where you don't really care which sub(s) the event runs for.
The Enforcer already has a crude way of doing the second type of event - the !delay command. While this doesn't generate a new event but merely suspends the current event for the specified interval, that may often be sufficient, and if a separate event really is needed, the event could be generated immediately via the !event command, and then the notecard that processes that event could begin with a !delay command. The only real problem with this is that the context that represents the event within The Enforcer hangs around for the duration of the delay, taking up resources. So a variant of the !event command that fires after a delay (rather than immediately) would be useful. This can be used both for one-shot events, or for repeating events (the event would schedule another future event each time it runs), and would typically run on behalf of the sub who caused the original event.
The first type of event - scheduled for a specific time and then possibly repeating - is much more complicated. There's a lot of complexity around handling date-times, that really has no place in The Enforcer. And this type of event, being independent of an particular sub logging in, would presumably want to continue to run after a reset of The Enforcer.
I have also been thinking about teaching The Enforcer to run Mesmerizer trance scripts. The Enforcer can be used for trances today, but it's clumsy in that you need to do a manual delay after every piece of text, and it's easy to forget that trance text needs to be sent within a ^text or ^text2 command. The Mesmerizer script format is designed to make creating trances as simple as possible, and it would be very useful if The Enforcer could play them back unchanged. But doing this within The Enforcer itself would mean that it would now have to support two scripting languages, which would very likely introduce bugs and increase memory use.
So, instead of adding these new features directly into The Enforcer, I have decided to add a remote control interface to The Enforcer, so that functionality like this - generation of events, and playback of trances - can be done by new individual products that connect to The Enforcer. This means that only those people who want to make use of these functions will be impacted by them. In addition, it opens the door to various custom add-ons to The Enforcer. I plan to make available a simple toolkit that will permit LSL scripts to easily be connected to The Enforcer to allow for the easy construction of custom controllers.
So in addition to the "future event" capability, The Enforcer 1.1 will add the concept of "External Controllers". The Enforcer will be able to scan the sim for new controllers and, if found, can connect to them. Once connected, a controller can send commands to The Enforcer to generate events, or to be forwarded to a logged-in user's Mesmerizer. At the same time, I will launch the CHAOS Scheduler as a new product. The trance reader will come somewhat later.
The CHAOS Scheduler offers the ability to generate Enforcer events according to a timetable set out in a notecard in the Scheduler's inventory. Events can be repeating or one-shot, and since they're defined in a notecard, they will survive script resets, and will continue to operate if the Scheduler is taken back into inventory and then re-rezzed (although the new instance will have to be manually connected to The Enforcer before the events will have anywhere to go).
No comments:
Post a Comment