Direct interface

- Chapter: Using themes -

Any script system versatile enough to be able to send or receive link_messages to other scripts can be very easily interfaced with the Theme-O-Matic. This is done either directly or through some "glue" script. In this section we will give some examples of such interfaces with popular third-party systems.

Of course you can always contact me to have advice on how to do with a system that is not listed here.

AVSitter™

AVistter™ is a very popular system used to add poses or animations to rezzed objects that get triggered when one or several persons "sit" on it. It is very thorough and has a complete API and plugin system.

In a first approach, you may want to add one or several buttons in the AVSitter™ menu to apply themes through the Theme-O-Matic. For example you can use this to change the textures of furniture, maybe move one seat (changing local position of one or several prims)...

To do this at a basic level you do not need an additional script, ony modify AVSitter™'s avpos notecard. Specifically, AVSitter™ allows you to add a BUTTON directive to the avpos notecard in order to allow sending a link_message to another script at the click of a button.

Apply a theme by a button

If you want one button to activate a theme without preloading it then use the following syntax in the avpos notecard:

BUTTON apply theme|77000|myTheme|T-O-M

When reading this line, AVSitter™ will create a new menu button labeled "apply theme". When a user clicks on it, a message will be sent to the Theme-O-Matic instructing it to read and activate the theme notecard "myTheme". Here the number 77000 is a command saying "load and apply this theme" and the last part T-O-M is a "key" so that the Theme-O-Matic knows this message is for it. More info about such commands will be given in the scripting reference section.

Of course you can duplicate and modify this line to create more buttons to apply themes, organize them in menus, etc. Please refer to the AVSitter™ documentation to learn how to do this.

Apply a preloaded theme by a button

You could also want to apply a preloaded theme at the click of the button, especially is your theme is rather large, because for example if it changes a lot of textures, materials etc. on many faces. If you do not want anything more elaborate, the easiest way to do this is using the auto-load feature to have preloaders load themes and have them ready for immediate applying. Then the following line in the avpos notecard will create an appropriate button:

BUTTON apply theme|77017|1|T-O-M

Comparing this line with the previously explained command you can notice that the command number has changed: 77017 means "apply a preloaded theme". The third part has changed too, it is no longer the name of a theme notecard but instead a preloader number. In this example, this command will cause the sending of a message saying "apply the theme from preloader #1".

Other theme operations with AVSitter™

A few customers contacted me to know how to do slightly more complex things with AVSitter™:

  • have a dedicated menu that reopens automatically after applying themes
  • automatically apply a theme when a specific AVSitter™ pose is played.

Doing these kinds of operations is rather easy using the API from AVSitter™ and Theme-O-Matic but requires a specific script. Such scripts ship with the Theme-O-Matic and will be discussed on the next page.

WearPose System

The WearPose System is a script system designed to activate poses and animations when you wear an attachment, taking care of positionning the attachment itself and offering a full menu. As such it does for attachments what AVSitter™ does for rezzed objects. It also features a unique way of altering animations by using complementary "adjustment" animations.

Regarding the Theme-O-Matic things are very similar to what was previously explained with AVSitter™. The WearPose System's configuration was designed to be very much the same syntax as AVSitter™ and therefore you can just use the same BUTTON directives as with AVSitter.

MVtPlayer

The MvtPlayer is a script system used to have objects move and rotate in a smooth manner (keyframed motion) along a predetermined path. You define a sequence so that your object smoothly moves and rotates, has an immediate move, makes a pause, plays a sound... and trigger actions performed by other scripts. This is where the Theme-O-Matic can be plugged in.

To be more precise, sequences defined in MvtPlayer include steps that can be of type "PLUGIN ACTION", where the script sends a message and continues playing back the sequence without waiting, and "PLUGIN WAIT", where the script will send a message and wait for the response before continuing its sequence.

Interfacing the MvtPlayer with the Theme-O-Matic does require some "glue" script but such a glue script is already shipping with the MvtPlayer in the form of the standard full-perm plugin script Plugin_ChatListen. Please refer to the MvtPlayer documentation for more information about this.