Now, we'll open up LightScript, look through it and make a small customization.

1. Right-click on your lamp's bulb, and select Edit from the pie menu.

The reason you have to right-click to select the bulb is because it has a script that has taken over the left click to turn the light on and off.

2. Look at the Content tab of the Tool Palette.

3. Double-click on LightScript.

A new window opens, showing the script. It may look complicated if you've never played with scripts before, but it's really not hard at all to understand enough to make a few useful changes.

4. Read through the script and see if any of it makes sense to you.

Lines of text that begin with // are comments. They aren't actually part of the code -- they're there to explain what's going on. A well-written script will have good, clear comments that explain how the script works.

5. Look for the lines that start with llListen.

Near the end of one, there's the word "on" and near the end of the other is the word "off".

These lines tell the light bulb to look for the words on and off to turn itself on and off.

One simple modification that we can do without understand the script at all is to change the words that turn the lamp on and off.

Why bother? For a light, there's not really much of a reason to change the activating words, but you could modify a script for a door in the same way, setting up a password for entry that only you and your friends will know.

6. In the lines that begin with llListen, change the word "on" to "light", and the word "off" to "dark". (You can use any other code words you want.)

There's one more place you have to modify:

7. Scroll down the script to the line that says if (text = "on"), and change "on" to "light" (or whatever other code word you chose).

8. Click the Save button.

9. Close the Script window and the Tool Palette.

10.Test your lamp with the new words for on and off.

Now that you've created a masterpiece, it's time to link it together and save it to your Inventory.

11. Right-click on one part of the lamp and select Edit from the pie menu.

12. Hold down the Shift key and click on the other two parts of the lamp,so they're all highlighted.

13. Open the Tools menu and select Link.

The lamp is now all linked together, so you can move the whole thing around instead of having to move each piece separately.

14. With the lamp still highlighted, open the Tools menu and select Take Copy of Object.

A copy of the lamp will be placed in the Objects folder of your Inventory.

15. Right-click on the new object (named Object) in your Inventory, and select Rename.

16. Type in a new name, like "My Floor Lamp".

17. Drag the newly named lamp from the Objects folder into the Furniture folder.

18. Now you can delete both the model lamp and the lamp you made.

You can pull them out of your Inventory any time you need them.

[ Advanced Skills Home | Creation 101 Home | Previous | Next ]