Using preloaders

Previous section < Understanding preloaders

- Chapter: Preloaders -

First you have to prepare your themes as it was described in the previous chapters. There is nothing specific about preloaders in theme preparation.

Installing preloaders

There is no theoretical limit to the number of preloaders you can use. All preloaders are exact copies of the same script called T-O-M Preloader shipping with the Theme-O-Matic since version 2.0.

To install a new preloader, you just have to drag one copy of the T-O-M Preloader from your inventory to your object's contents.

The preloader scripts must all have unique names in the object's inventory but the viewer normally takes care of adding an appropriate suffix so you don't have to worry about this. Dropping several copies you will get "T-O-M Preloader", "T-O-M Preloader 1", "T-O-M Preloader 2", etc. The actual script name has no importance, as long as it is unique.

Once your preloaders are installed, install the T-O-M Core script and it will automatically assign every preloader a unique ID, which is a number starting from 1. This number will be useful for client scripts to refer to preloaders.

Note: if you added or removed preloaders since you installed the T-O-M Core, it is necessary to re-assign the preloader IDs. Do do this you can either:

An example setup with 12 preloaders

An example setup with 12 preloaders

Theme auto-loading

Principle

It is normally the job of the client script to tell each preloader which theme it should (pre)load and when to apply it.

In order to keep things as simple as possible for creators, an auto-load feature was added inside the T-O-M Preloader script. Here auto-load means that, as soon as it gets its unique ID assigned by the T-O-M Core script, the preloader looks if it can find in the prim's inventory a notecard named "AutoT #n" where n is the number equal to the preloader's ID. If it can find it then it attempts to preload this notecard as a theme immediately.

Example

For example, say you have 4 themes that you want to be ready as soon as possible through the usage of 4 preloaders. Then:

It is important that the T-O-M Core be added last since it will give the "start" signal to preloaders and coordinate the whole process. If you need to add another preloader, you can remove the T-O-M Core, add your new preloader, and add the T-O-M Core again. Alternatively, you can have your client script send a reset signal to the T-O-M.

Spelling!

Please note that: