Join us in Outworldz at www.outworldz.com:9000 or follow us:

[Table of Contents]

Tandy's Quest

This is Part 3 - Scripting the avatar. The previous step was Part 2 - Making Tandy a Twin

Scripting:

Beware In this section, we will add the scripts that change clothing and skin textures to the bodies.

You cannot edit this avatar when it is worn, so once they have uploaded, edit the avatar that is in-world, and place all the textures for clothing and skin in her Content Tab. These go into her root prim, the prim outlined in yellow when you edit her.

Select the avatar, navigate to the Content Tab, and click "New script". Open that script so you can copy and paste text into it.

Scripts are ordinary text files. Mine are all named something.LSL. The format of the zip file is designed so it can be used in LSLEditor, a free Windows LSL debugger, so you can expect to see some odd files and empty folders. Ignore them. They are just odd files and empty folders, so lets not get hung up on small details.

Look in the Avatar folder for ""Fairy control Script.lsl".

I greatly love and adore LSLEditor. It is worth the price (free) even if you are new to scripts.

It supports the LSL Wiki and auto completion of LSL events and parameters by pressing tab. It will run most LSL code without needing to log in and show you the insides of what is happening.

Double click the file, and it will likely open in the old Notepad.exe program Blech... the default "Notepad.exe" is terrible as it does not understand the CR/LF convention of LSL files. If you did open it in Notepad, all is not lost as it will just display as one long line. This is okay, you can still select and copy all the text in the file, then paste it into a new script in Second Life or OpenSim. But the best way to view these files is to right-click them and open them with WordPad or some other editor, like LSLEditor.

Place the "Fairy control Script.lsl" script inside the avatar. I named my script "!Tandy Script" so it would sort to the top of the textures because of the ! at the front:

images

Once you compile and save the script you should get a menu:

Menu

This menu will also appear when you put on the avatar. You can also bring up the menu by typing '/100 menu' in chat at any time. Later, you will be able to click Tandy's wings and get a menu.

The "Clothes" menu allows you change the colors of the fairy clothing. You should test this, and the 'skins' feature now.

If the clothing or skins do not work, you either incorrectly named the files in the inventory, or you failed to properly name a body part. Check for an extra space at the beginning, or end. Everything in this system depends upon names. If you change a name, or added files, just reset the !Tandy Control script so it will re-scan the contents, and then type '/100 menu' again.

This is what it should looks like after setting a skin and a cloth. There should be one head, two uppers, one with clothes and one with skin, and two bottoms. The position makes no difference, and there is no need to align the pieces unless you want a preview of them lined up.

menu

There is no code for you to edit, no UUID's to fiddle with. Names do all the work. Well, and me! It took a lot to make this all plug and play so you can just name things, and the magic happens.

One of the really nice functions I used in this script is from the Second Life wiki at http://wiki.secondlife.com/wiki/SimpleDialogMenuSystem. If you add or take away clothes choices, the menu will adapt automatically. There is no need to change anything. You can store about 120 different outfits in a single avatar with ZERO code changes!

Part 4 - Wearing Tandy

Back to the Best Free Tools in Second Life and OpenSim.