Generate the theme

Previous section < Edit and Utilities

- Chapter: Creating a theme -

Next section > Test the themes

Theme creation

Theme generation has changed in version 3.0 since you now have the option of creating a theme notecard or creating the new theme straight to LSD storage. Deciding between these 2 theme types is a matter of taste and constraints (number and size of themes, speed requirements...) over your project. For a summary of the differences, advantages and drawbacks please refer to the Theme types page.

Later, you can always switch between LSD and notecard contents (as well as perform other operations) thanks to the Theme Toolbox set of scripts.

Theme generation consists in scanning all the required properties of selected prims and faces, and encoding them into a format understandable by the T-O-M Core script (or T-O-M preloader copies).

Before creating your theme, it's time to double check your properties selection and filters. When you are ready, click the Make theme! button from the main preparation menu to access a new submenu.

Of course the Back button will take you back to the main menu and the How to? button will give you some basic information about this menu. The other buttons will either create notecard contents or deal with LSD storage.

The Make theme! sub-menu

Creating an LSD theme

Making an LSD theme is probably the most direct way to create a theme since it does not involve any notecard manipulation or even copy/paste operations. Just click the Make LSD button when you are ready, and a new dialog will open, where you can enter the name of the LSD theme you want to create.

To cancel theme creation at this stage, just leave the text box empty and click submit. To enter a valid LSD theme name, you have to use a sequence of letters (both upper case and lower case accepted) and/or digits and spaces. Any other character will result in an error.

Once you submit a valid LSD theme name, the theme creation will begin and the scripts will tell you when it is done.

Warning: if the name you entered is the name of an existing LSD theme, it will be overwritten without further warning.

Make a new LSD theme textbox

Other operations related to LSD are available through the other buttons of the Make theme sub-menu:

Trivia : remember, LSD means LinksetData!

You can of course repeat the process to create more LSD themes, or notecard themes.

Creating a notecard theme

The first step may be to prepare an empty notecard in your inventory and name it as you wish. If you plan to use a client script that displays the theme names to the user it is advised to choose a rather short name. If you plan to use the preloader auto-load feature you will have to follow a naming scheme. Still you can always rename the notecard later so let's leave this aside for now.

All you have to do now is:

Then all the lines making your themes will be said in the local chat (but visible only by you).

What you have to do now is copy all these lines into your freshly prepared notecard and save.

You can safely leave the chat headers, or you can remove them. Just make sure the part between the *B* and *E* remains intact. Also make sure all the lines are copied. Depending on your selection of properties and filters, there can be quite a large number of lines, and the length of copy & paste operations are limited in most viewers. Therefore, several copy & paste operations may be necessary so you have all the lines. Check the line numbers following the *B* marker to make sure you did not leave out any line.

Then make sure you saved your notecard and drag it from your inventory into your object's contents, alongside the Theme-O-Matic scripts. You can also choose (new as of v3.0) to leave it inside your inventory and use its UUID instead, but this will be covered on the next page.

Repeat the process to create more themes.

Worth noting about notecards...

Object name length

Scripts read notecards line by line. Notecard lines are virtually unlimited in length but a script can only access the first 255 bytes (~255 characters except special Unicode characters). Silly limitation if you ask me but we have to deal with it.

The T-O-M Generator script takes care about notecard line length and makes sure it does not exceed 200 characters, excluding start and end markers, and line numbering. However, using copy and paste from the local chat will also copy and paste chat headers. If your object's name is too long, the total line length (the "useful" part and the object's name and datestamp) might exceed the fatal 255 bytes limit!

Object names are theoretically limited to 63 characters. Going to this very limit seems crazy so the 200 characters limit enforced by the Theme-O-Matic does sound reasonable. However, the script will send you warning if your object's name exceed 50 characters.

If this happens to you, there are 2 solutions:

Line numbering and theme optimization

The Theme-O-Matic requires that the notecard lines be processed in the right order. They are generated by the T-O-M Generator in that very order, but sometimes (laggy sim...) they may appear in the local chat randomly shuffled, line #1 after line #5 for example.

The T-O-M Core script is perfectly capable to put them back into the right order when reading the notecard because all the lines are appropriately numbered. However, waiting for the required lines to "pop out" of the notecard before applying them adds extra work for the script and may delay theme activation.

Therefore you may optimize the processing of the theme notecard by putting back the lines in the right order inside the notecard. Just use the cut & paste of whole lines to do so. The useful parts of all lines (except the very first line) have this format:

*B*number|encoded data*E*

where "number" is the line number. Anything before *B* (i.e. chat headers) or after *E* is ignored but read, so deleting this extra matter may help optimize your theme too.

The very first line of the theme does not begin with *B* but with *H* and has no number. It is a header, not really required for your theme. It is used to store parameters of the preparation phase (properties, filters) that the Theme-O-Matic used to create your theme. While it's not essential for theme application, you should keep it as it helps the Theme toolbox regarding compatibility as it keeps track of the encoder version and selected properties.

Other lines

The Theme-O-Matic should properly ignore other chat lines so it is rather safe to include them, like comments or other informative text intended for human-reading. However, of course, more lines mean more time taken to read the notecard, so better keep them to a strict minimum.

Moreover, make sure the lines you may add do not contain special markers like *B* or *H*, or the Theme-O-Matic will try to interpret and then (rightfully) report an error doing so.