XStreetSL: https://www.xstreetsl.com/modules.php?name=Marketplace&file=item&ItemID=1471933
XStreetSL demo: https://www.xstreetsl.com/modules.php?name=Marketplace&file=item&ItemID=1474518
Second Life: http://slurl.com/secondlife/Sunweaver%20Air/203/45/141
Ever wanted to ship a HUD with your hair, eyes or fairly much anything else, so it can be re-textured or re-colored by the end user? This is the product for you. Full perms on all scripts, a complete HUD for setting textures, colors and glow on unlinked prims. Comes with all the scripts you need to set up the HUD, plus a sample HUD. Script for putting in the target prims is also provided. Textures can be loaded from prim inventory or stored within the HUD script itself. Colors and glow can be configured by changing the button they’re on to the right values and using the included scripts to handle the HUD configuration for you.
Instructions
While a sample HUD is provided, you are strongly encouraged to make your own HUD to hold the scripts (particularly as mine is really ugly).
There are 3 scripts for the HUD, 1 script (change receiver) for the target prims, and 2 supporting tools (texture UUID dumper and face identifier).
HUD Setup
The HUD scripts are:
- Color reporting script
- Glow reporting script
- Texture changing HUD script
“Texture changing HUD script” goes in the ROOT of your HUD’s link set, and handles all clicks on the HUD. It identifies which button is being pressed by the prim’s name, which is where the two reporting scripts come in. While textures are managed by the HUD script, color and glow buttons must have pre-configured, and the two reporting scripts set name of the prim they are put in according to its color/glow.
There are 5 buttons supported by the HUD script (specified by name):
- “Texture preview” – these prims have textures set across their faces by the HUD script, to show the user textures they can choose.
- “Color <color>” – these prims trigger a color change when clicked. For example, a prim named “Color <0.00000, 0.00000, 0.00000>” would set the target to black when clicked.
- “Glow <glow>” – these prims trigger a glow (and optionally fullbright) change when clicked. For example a prim named “Glow 0.25″ would set a prim to quarter-glow when clicked.
- “Left arrow button” and “Right arrow button” – these allow paging through the texture preview.
- “Minimise button” – minimises the HUD by rotating it 90 degrees, and also de-minimises (but do make sure there’s a button on the face the user can see when the HUD is minimised!).
Any button is optional, and any button except left/right arrow can be duplicated across the HUD as many times as you can get to link.
Textures are loaded from two places; firstly, from a list stored inside the script, and secondly from prim inventory. While the first requires more work, it is required if you do not wish to ship full permission textures with your HUD due to SL’s security model. This is where the first supporting tool, “Texture UUID dumper” helps; if you put your textures (which MUST be full permission) into the Texture UUID dumper, then click it, it will produce a list or lists ready for insertion into the script.
If the texture UUID dumper produces more than one message (message length from LSL is limited, which makes this necessary), you’ll need to remove the “];” from the end, and “[" from the start, of between messages to create a single list for the LSL script.
The list should then be put into the script at the line (in place of "[]“:
list STORED_TEXTURES = [];
If you then ship the scripts (both HUD and change receiver) without modify permissions, the customer won’t be able to read the UUIDs out of the script. If you’re doing this, I’d recommend changing g_Channel in the HUD script and change receiving script, so they can’t listen for messages between the two scripts and extract the UUID that way. Remember that the channels MUST agree for the script to work.
Target Prim Setup
In each prim you wish to change you should put the script “Change receiver” into prim inventory. This script will attempt to load a configuration notecard and then listen for commands from the HUD. It can be configured to change only some sides of a prim, and to change full bright settings along with glow, by putting values into a notecard called “Configuration”, with the notecard placed in the same prim as the change script.
The configuration should look like:
sides=1,2,5
glow bright=false
In this case, that would change only sides 1, 2 and 5 of the prim, and would not change full bright settings. By default (if there is no sides entry in the configuration notecard), the script changes all sides of a prim at once.
For full bright settings; depending on use case, it can be beneficial to set full bright on prims when a prim is set glowing, in order to provide a glow boost, and also to disable full bright when glow is set to 0. This is where the “glow bright” option comes in; disabled by default, it sets a prim’s faces to full bright if glow is set to non-0 values, and sets full bright off if glow is set to 0. It can be configured with lines such as:
glow bright=true
or
glow bright=false
in the configuration notecard.
For identifying sides of a prim, a simple “Prim face identifier” script is provided which will say the number of the side clicked, when it is placed in a prim. Please note that the script is shipped not running; once you have added it to a prim, use Tools -> Set Scripts to Running in Selection to start the script.
Samples
A sample HUD, with a selection of random textures from a freebie box, is provided. Feel free to use it as a base for your own HUD (or ship it as is, if you like it, your choice).
A sample change receiving prim, “Change receiver”, is also supplied. It may provide particularly useful as it contains a sample configuration.