Text Size
Login
Change Style

Featured Articles

image image image image
SL7B: Reveling in Unexpected Collaborations
An extravaganza with a magnitude yet unseen before is how the seventh birthday bash of Second Life this June 21–July 3 has been shaping up to be. Not even the “strategic restructuring” that was announced by Linden Lab (LL) on June 9 resulting in an anticipated 30 percent reduction in its staff could put a dampener on the celebrations for SL’s seventh birthday (SL7B). Yes siree, mademoiselles, if you please, SL7B flies high under its thematic “Unexpected Collaboration” banner.
Linden Homes On February 17th, LindenLabs unveiled their Linden Homes for premium customers. As a premium customer, in world for less than a year, regardless of what my “rezdate”
may say (I rolled up an avatar, wandered around for about 20 minutes, and logged out, not to return for several months.), this news made me pretty happy. I should say now, that while I'm a happy premium customer, I only..
Live like a Na'vi on Pandora in Second Life I've seen Avatar, not once, but four times, and soon will be watching it for the fifth. I'll be in line to get that DVD when it comes out. If you're like me and many others, wanting to experience the forests of Pandora, to fly an Ikran, and to ride a direhorse, you can! Or if  you identified more with the military and the collection of Unubtanium, you can also do that. After seeing Avatar each time, I'd return home to search Second Life for Pandora worlds, signs of the Na'vi wandering about. For weeks my searches produced zilch. Then one day, after returning home from seeing Avatar again..
Scripting 101: Running Scripts The first post in this series described how to create a script in Second Life. In this post, we'll show you how to place the script into an object in-world and get it running. In order for a script to run it must be in an object; scripts can't run when they're in your inventory -- or when the object they're in is in your inventory, either, for that matter. So the first thing you need is an object to put your script into.

Scripting 101: Creating a Script

Blogs - Newcomer Friendly


About the authorLaurie Stilman is a professional software developer in real life, and a builder and scripter (amoung other things) in Second Life. He counts himself lucky to have turned a hobby into a career; to have found a new outlet for that hobby in SL; and, through SL, to have met so many interesting and wonderful people, particularly his wonderful wife who puts up with him and all his obsessions...

 

So you've heard of 'scripting' in Second Life, and you have a vague idea of what it is and what it's useful for, and you think you might be interested in learning how to do it, but you are unsure where to start. This series of articles is for you. In this, the first part, we look at how to create a script in Second Life.

Creating a Script

The first thing you'll need to know how to do is how to create a script object in the first place! There are only two places where you can create a script in Second Life: in your personal inventory, or in the inventory of an object you have created or have modify permissions for. Note, however that you can't run a script that is in your personal inventory; scripts can only be active when contained in and object. We'll start by showing you how to create a script in your inventory, where you can find it again later. In part two, we'll show you how to put a copy into an object and get it running. scritping-create-script

So, to create your first script, start by opening your inventory. Pick or create a folder to put the script in (the standard Scripts folder is a good choice!) Select that folder, then go to the Create menu at the top of the inventory window and select Create Script. You should see a new script object appear in your inventory, named "New Script" by default, with the name highlighted so you can call it whatever you want. You can open the script (by double-clicking it or by right-clicking and selecting Open from the menu) if you want to take a look at it, but don't worry if you don't understand it at this stage. What you have created is already a complete and ready to use script! It doesn't do very much, but we can put it into an object and see that it works. We'll do that in part two, but for now let's take a first look at the Script Edit window.

Editing Scripts

You can edit any script, assuming you have permission to do so, by simply opening it. To do so, either double-click the script in your inventory or right-click it and select "Open" from the pop-up menu. You should see the Script Edit window open. This is where you make changes to the script to determine what it does.

Most of the window is taken up by a text edit area containing the script itself. Just below that is a gray message area, which should be empty at the moment. Beneath that, at the bottom-right of the window, is a button labeled "Save". It's grayed out at the moment, because we haven't made any changes that need saving. As soon as you make changes to the script, the Save button will light up to indicate you need to save them. Let's try it...

Click in the main edit area, at the end of the line that reads "llSay(0, "Hello, Avatar!");" Hit enter to add a blank line (but don't type anything else yet). You should see the Save button light up; click it to save your changes. You should see two new lines in the message area, "Compile successful!" and "Save complete." If you make a mistake, you might see an error message instead. This is how Second Life tells you about any problems in your scripts. If you type "cool!" on the blank line you just created, then hit save again, you should see an example: a "syntax error" will be reported. The numbers at the start of the error message tell you what line and column the error was found at. Delete the whole line you just added, and hit Save again. If all went well, you'll have a success message again.

Conclusion


We haven't talked about how to get a script running yet. We'll cover that in part two. We also haven't described what this script will do when you run it, or how to go about making it do what you want. But don't worry, we're getting to that...! Read on to part two to continue.

Add comment

Security code
Refresh

Login Form