CHAOS TranceCaster
If you write Mesmerizer trances for a sub, you generally want to modify them as the sub becomes accustomed to them. You might want to speed up an induction as the sub become more adept at trancing. You may want to add new suggestions to the trance as they internalize the original ones. And you may want to remove or rewrite parts that have caused confusion or resistance.
You could do this by maintaining a working copy of the trance script notecard and using a CHAOS AutoInstaller to periodically upload the current version into the sub's Mesmerizer. But this requires that the sub visit the location of their AutoInstaller to receive the update, and it requires you to visit that location to upload the updated trance script. And if you want to use your script with multiple subs, you have to visit and upload it to each of their AutoInstallers.
An ideal solution would be to use The Enforcer. And indeed, it is possible to write EnforcerScript to start a hypnosis session and to periodically send lines of text to the sub. However, this either requires an event to run for the duration of the trance (which is bad practice - each running event script consumes memory, so you want to keep each script as short as possible to minimize the chance of having many event scripts running simultaneously), or to divide a trance into many "scriptlets" running as a series of delayed events (which is very clumsy and has its own performance issues). What's wanted is a way to run "trance scripts" that don't compete with Enforcer events. And that's what the new TranceCaster is.
The CHAOS TranceCaster allows you to run trances centrally, via The Enforcer. You drop a trance script notecard into the CHAOS TranceCaster, and it can then be played back to any sub either via the TranceCaster menu, or via an Enforcer command. The syntax of a TranceCaster script is the same as the syntax used for Mesmerizer trances with a few minor differences, making it relatively easy to develop and test scripts in the TranceCaster, and then move them via an AutoInstaller into a sub's Mesmerizer if you prefer them to run locally.
Extensions to trance script syntax
When a script runs within the TranceCaster, it is created with a namespace that can be used in variable expansions withing the trance. This can be used to personalize a trance script - for instance to insert the sub's name into a trance script that can be use with multiple subs. This leads to the most important difference between running a script within the TranceCaster versus running it in the Mesmerizer: that variables could potentially be expanded either using the variable definitions in the target Mesmerizer or the definitions in the current namespace. This is similar to how symbols can be expanded within EnforcerScript, where a symbol preceded by a single dollar symbol is expanded using The Enforcer's namespaces, whereas a symbol preceded by two dollar signs is converted to a single dollar symbol and passed to the target Mesmerizer, where it will be expanded using Mesmerizer symbols. The same convention is used in TranceCaster scripts: the use of a single dollar symbol will translate the symbol within the TranceCaster, using the Namespace that the script was started with, while a double dollar symbol will be replaced by a single dollar symbol and passed to the target Mesmerizer.
Note that this is different to Mesmerizer trance scripts which use only a single dollar to mean "expand using Mesmerizer symbols". Moving a script from the TranceCaster to the Mesmerizer will therefore require some small modifications.
Enforcer events can be initiated from a trance script using the new !event=name script command. This will fire the named event within The Enforcer, running it for the user who the trance is running for, and passing the same namespace that the trance script is using. Typically, !event would be used at the end of a trance script, if further processing by The Enforcer is wanted, although you can create events at any point during a trance script.
I have also added support in background images for the new features of the show2 family of Mesmerizer commands introduced in Mesmerizer 1.6.6. This allows you to have background images that are not square, or that are animated. To recap, background images are defined within a trance using the !bgpics=pic1, pic2, … syntax, or the related !addbgpics=pic1, pic2, … or !rembgpics=pic1, pic2, … commands. In Mesmerizer trance scripts, pic1 and pic2 etc, are either keys or names of images. In Trance Library scripts, these keys or names can be followed by a semicolon and a string that will be used as the second parameter of a show2 family command. For instance, !bgpics=306942ab-2bda-bd53-6d18-5dda710af8a6;alpha=1.0;animate=7:8:10 will display the background image as a 56-frame animation, fully opaque. I will likely extend support for this syntax to Mesmerizer trance scripts in the next Mesmerizer release, so this is likely to be only a short-term difference. Note that if a picture is referenced by name (as opposed to by key), then either the named texture must reside within the target's Mesmerizer, or if it resides within the TranceCaster, then it must be a full-perm texture.
One final difference is that the !pause=n command is not appropriate in a TranceCaster script, since !pause is intended for live trancing, in conjunction with the resume Mesmerizer command.
Running a trance script
Running a trance script requires The Enforcer 1.2, which will be released at the same time as the TranceCaster. Before you can run a trance, you have to connect the TranceCaster to The Enforcer as an external controller. You do this via The Enforcer's Cntrllers menu option. With the TranceCaster rezzed nearby, select Find New… from the Cntrllers menu - this will scan the region for unassociated controllers, and present you with a menu of any that were found. Choose the TranceCaster, and the hovertext above the TranceCaster should indicate that it is now connected. If you wish, you can change the name that The Enforcer will use to access the TranceCaster by first selecting it via the Current… choice in the Cntrllers menu, and picking Rename from the resulting menu. Now it is ready to run trance scripts.
To run a trance script, first you have to place the script notecard in the contents of the TranceCaster. Once a trance script is present, you can either run it manually via the TranceCaster's Scripts… menu, or from within an EnforcerScript program using the new EnforcerScript !runscript command.
!runscript takes two parameters: the name of the TranceCaster, and the name of the script to be run from within it. So if your TranceCaster is called "My library" and the script you want to run is called "Example script", you would run this trance by the following EnforcerScript command:
!runscript My Library::Example script
Note that both the library name and the script name are case-sensitive. The trance script will run for the same user that the EnforcerScript program is running for, and will be given a copy of the current namespace to be used for any single-dollar symbol expansions needed by the trance script.
Since a trance script can invoke an EnforcerScript program, and an EnforcerScript program can invoke a trance script, it's possible to create complex programs that switch back and forth between the two, with data being passed between them in a Namespace. For instance, you could introduce random branching within a scripted trance by having the first segment of the trance generate an Enforcer event when it ends, and that Enforcer event would then choose the next segment to play. Since a namespace is passed back and forwards between The Enforcer and the TranceCaster, it's possible to use this technique to create counted loops in a scripted trance, maintaining the loop counter as a variable that's incremented (and checked against a limit) each time the Enforcer event runs.
Using Mesmerizer trance scripts
As noted above, TranceCaster scripts and Mesmerizer scripts are very similar, the main difference being the use of $$ in a TranceCaster script to indicate symbol expansion withing the Mesmerizer, whereas a Mesmerizer script uses a single $-symbol for this purpose. To simplify moving scripts between the TranceCaster and the Mesmerizer, a future update to the TranceCaster may treat trance scripts named with a leading "Script:" prefix as being Mesmerizer trances, interpreting a single dollar symbol to indicate variable expansion within the Mesmerizer, and not interpreting a double-dollar symbol at all. So for now, you should avoid using the "Script:" prefix for TranceCaster notecard names.