Preloader-aware standard clients

Overview

In this section we will discuss another two standard client scripts. As you will notice they are very similar to the two clients covered in the previous section, with one notable difference: they use preloaders.

T-O-M-SC QuickCycle

Usage

The T-O-M-SC QuickCycle is used to have a new theme applied every time someone touches the object, very much like the T-O-M-SC SimpleCycle, except that the themes are preloaded and that the script supports a few parameters to fine-tune its behavior.

To use this client, you have to set up preloaders and use their auto-load feature described in the previous chapter. Then your themes whill be activated in turn in the order of the preloaders.

Configuration

Customization of this client is done my editing the following parameters, all grouped at the beginning of the script.

integer messaging=1; // recommended value is 1

The messaging parameter tells how verbose the client will be when applying themes. Possible values are:

This applies to messages about the themes (number of themes, activation of a particular theme etc.), but not error messages (those are always said to the owner - luckily there will not be any!).

integer msg_channel=PUBLIC_CHANNEL;

This parameter sets the channel on which the messages are whipered, said, shouted or region-said, as set by the messaging parameter. Use either PUBLIC_CHANNEL or a non-zero number in case, for some reason, you want the messages to be heard by another script in another object. Note however that PUBLIC_CHANNEL will cause an error if messaging is set to 5 (SL limitation).

integer updateoninventorychange=TRUE;

If this parameter is set to TRUE then the script automatically reboots if inventory is changed at some point. While this is useful if you are installing more preloaders, for example, it can become annoying if inventory changes as part of the "normal life" of your object. In that case set updateoninventorychange to FALSE. Please note that we are only talking of the T-O-M-SC QuickCycle script, not the whole Theme-O-Matic system.

integer whocantouch=0; // possible values are 0 (everyone), 1 (same group as the prim), 2 (owner only)

This parameter defines whose touches will be considered for theme cycling. Setting this value to 1 is an easy way to restrict usage of your object to a specific group, just remember that it's the group of the prim containing the script, not the whole object's (root prim) that matters in this regard.

LSD themes

... are not supported by this very script. Feel free to request them if you need them inside the T-O-M-SC QuickCycle, but this is not really the "philosophy" for this script.

T-O-M-SC PreloaderMenu

Usage

The T-O-M-SC PreloaderMenu is a more sophisticated client script managing a menu system that makes use of the preloaders, either with or without their auto-load feature. You will be able to define the button names and the themes they trigger directly inside the script. Just make sure you set up as many preloaders as required, as described in the previous chapter, or your menu will be truncated.

An example of the menu created by T-O-M-SC PreloaderMenu is shown in the following picture.

Example of a menu created by T-O-M-SC PreloaderMenu

Example of a menu created by T-O-M-SC PreloaderMenu

Configuration

Some parameters have exactly the same meaning as for the T-O-M-SC QuickCycle, please refer to their description above.

integer whocantouch=0;

integer messaging=1; 

integer msg_channel=PUBLIC_CHANNEL;

The main parameters deal with the menu configuration:

list themes=[

"Theme-1","Button-1", // example of explicitly named theme "Theme-1" which will be triggered by Button-1

"","Button-2" // Button-2 (rename as you please) will trigger theme "AutoT #2" (auto-load feature)

];

The themes parameter expects a list of pairs of strings. This of course implies that this list contains an even number of strings. Each pair consists in:

In the example above, "Theme-1" is the name of a theme notecard which will be sent to preloader #1. In the menu this theme will be activated by clicking the button labeled Button-1.

A second button in the menu, labeled Button-2 will be there. Since in the themes list there is the empty string where the theme notecard name was expected, the script will take for granted that you used the auto-load feature and will not try to explicitely preload a theme in preloader #2. Of course you are then supposed to have named your theme notecard "AutoT #2".

The themes list can be expanded with as many elements as you wish, just make sure that enough preloaders are set up.

float menu_timeout=30.0;

string menu_timeoutmsg="Menu timeout. Please touch again to get the menu.";

The menu_timeout parameter sets the number of seconds after which the menu will stop responding (as an anti-lag measure). If this happens, the message set by the parameter menu_timeoutmsg is displayed.

string menu_prompt="Available themes:"; // this is displayed at the top of the menu when the user activates it

The menu_prompt parameter is the text displayed inside the menu. You can write what you want, including special Unicode characters like ☺ ☻♥♦♣♠ and newlines by entering \n (backslash n). The only limitation is that you must not exceed 512 bytes (around 256 Unicode characters).

string label_next="Next ►"; // appears as required to select the next menu page

string label_prev="◄ Prev"; // appears as required to select the previous menu page

string label_placeholder=" - "; // appears in place of the "previous" or "next" page if there is no previous or next menu page

These parameters are the labels of the special buttons in the menu: label_next and label_prev appear when pagination is required, and get replaced label_placeholder if there is no previous or next page.

string about_msg="Theme-O-Matic by Oggy's Scripted Items. Visit http://oggysscripteditems.blogspot.com for latest news.";

string label_about="- About -"; // this button appears between the "previous" and "next" buttons on each menu page

The label_about button is used for the botton center button in the menu, and is used to display a message you can define inside about_msg.

LSD themes

... are not supported. If you need them, please consider using the T-O-M-SC FullMenu script (convered in the next section) instead, as it will enable much more versatility as well as ease of configuration through a dedicated notecard.