Sloodle LSL Library
From SLIS Second Life Wiki
The Linden Scripting Language (LSL) does not contain any facility to include one script within another, or access functions defined elsewhere. Instead, we must rely on either duplicating common code between different scripts, or indirect access to common scripts via link or chat messages.
The Sloodle LSL Library is split into two parts: scripts, and fragments. The scripts are complete scripts which reside in the Sloodle repository (although you can usually also copy them out of other Sloodle objects in-world if you need to). These scripts can normally be used exactly as they are, with little or not customization.
The fragments are usual functions or events (in whole or in part) which provide useful common functionality which you need to copy-and-paste into your own scripts. Sometimes, these can be used as they are, but sometimes they will required that you change to suit your specific requirements.
Contents |
[edit] Scripts
The scripts themselves can be found in the "lsl" folder of the Sloodle module, and they are documented in the Sloodle module file reference. Direct links are provided in the following list:
sloodle_setup_notecard
This script is useful if you need to be able to configure your object using a notecard. It will 'read' each line of the configuration notecard (sloodle_config) via link message to other scripts in the same prim, meaning that you do not need to write all of the dataserver handling code yourself.
sloodle_slave_object
This script is essential if you want to include your object in the Sloodle Set or similar automated rezzing/configuring device, as it will listen for configuration commands via chat messages, and relay them to your script(s) via link messages. As far as your scripts are concerned, it is exactly the same as receiving configuration commands from the sloodle_setup_notecard script. This script also contains complex security features to prevent other objects from 'hijacking' the configuration process.
sloodle_url_loader
The "llLoadURL" function in LSL to give the user a URL to load incurs a long script delay. As such, it is useful to be use this script to off-load the functionality through link messages, allowing your main script(s) to carry on as normal.
sloodle_debug
If you use the sloodle_debug function (see below) to output debug information via link message, then you will need this script to intercept it and display it on your screen. This combination of methods is very useful as enabling/disabling debug is a matter of running or stopping this debug script -- you do not need to alter your original scripts in any way.
[edit] Fragments
NOTE: if you want to use these LSL functions and fragments, then you must copy-and-paste them directly into your own LSL scripts.
[edit] Functions
sloodle_debug
This function can be used to output debug information. There are different versions depending on your specific requirements. The recommended version uses link messages in conjunction with the sloodle_debug script (see above).
sloodle_handle_command
When object configuration is automated using sloodle_setup_notecard or sloodle_slave_object, you need to process the incoming commands. This function provides an example of how to do the processing, although you will sometimes need to change it to suit your own commands.
[edit] States
sloodle_wait_for_configuration
This state is commonly used when an object is required to receive configuration commands via link message. It waits for link messages, dispatches them to the sloodle_handle_command function, and should go to the appropriate state once configuration is complete.
| This page is part of the Sloodle documentation | |||
|---|---|---|---|
| SloodleDocs Home | User Documentation | Administrator Documentation | Developer Documentation | Sloodle Wiki Home | |||
