Linden Scripting Language (LSL)

An effective introduction to scripting in Second Life must begin with the LSL wiki. Have you seen it? This is the single best source of information, for ALL of us.
On the home page you will find links to a Script Library and Examples, as well as Tutorials, Scripting Groups and dozens of links categorized by function types. The site is well organized, and maintained. Every once in a while, open up the functions list in the wiki and have a look around; that is a good way to get to know what sorts of behaviours are at your command…

LSL101script_small2

Have you worked with other scripting languages? For me, having worked with Flash Actionscript before SL made learning LSL a bit easier. But, that is not necessary. If you have scripted before, then you will find LSL itself to be quite literal, and so quite accessible. Still, you are working within a new – and developing – medium. Second Life does experience growing pains. (To hear the groaning and moaning, just monitor any scripting group’s Instant Messages for a while.)

If you have not worked with scripting before this, be patient. LSL is a language. Understanding will come with frequent and persistent practice. And, once you “break through”, a new world will have emerged.

In either case, whether new to scripting or a scripting veteran, here is the best advice I received:

Start scripting. (I mean right now.)

  1. Go to a sandbox, (perform a text search in-world for “sandbox” and you’ll see plenty)
  2. Rezz a cube (“it all starts with a cube”)
  3. Edit the cube, open the Content tab, press the New Script button and…
  4. Make it do something

Move up, fall down, spin, change colors, talk (yes, objects chat), LISTEN, detect, display images…whatever you can think of. (Copy and paste a few scripts from the LSL Wiki Script Library.)

Once you have a bit of experience with simple behaviours, start imagining complex interactivity. Maybe you want an object to CHANGE color, get larger, and say something in public chat, all when it is touched. Or, how about an object that rises, spins, and then falls, after anyone chats a particular word.

Whenever you have an idea for a interaction you want to create, break it down into the simplest steps, and develop the script step by step. (First the object has to be listening; then the object has to evaluate what it hears; then the object has to move up; then it has to stop; then it has to start a spinning motion; then…)

NOTE: Use the llSay or llOwnerSay functions for feedback from the script to see what value a particular variable contains, or what function has just being called. When you get stuck, examine your code for errors in syntax or logic, then study the wiki some more.

Join a couple of scripting groups

When you just cannot find a solution in the wiki, then you can post a question in the group chats. These are live forums for discussing all things scripting.

Open Source Scripters
“Create, share, and teach LSL
Scripters Support Group
For scripting support. Ask questions or hire scripters here. Rules:

  • No off-topic spam.
  • Asking questions and hiring scripters is okay.
  • Asking for premade scripts is okay.
  • Providing free scripts is okay.
  • Promoting for-sale scripts is not okay.
  • Flaming is not okay.
  • Drama is not okay.
Scripters of Second Life
THIS IS ONLY A SUPPORT GROUP! Come join Scripters of Second Life. It’s a group of dedicated LSL Scripters. We are willing to exchange information & help on scripting to anyone. SoSL(Scripters of Second Life) Rules:

  1. No Drama, Flaming, or Spamming.
  2. No Hand-outs. (“Give me”, “Can I Have”)
  3. No Job Posting. (Come learn, not hire…)
  4. We write the rules & it’s our job to interpret them as we see fit. As such, anything an admin says goes.

Not all are as good as OSS, but each has its moments.

Do you have land? No?

You could go to any New Citizens, Inc. location in the grid, many have sandboxes. Their group is also great for general questions, even scripting questions. [Open Search > Places (Tab) > Enter NCI]

You might visit the Public Sandbox Group Academy (search Places: “Kings Bishop”). There are a few classes offered at that space, including scripting classes, and a large sandbox.

Other LSL Links

LSL Style Guide

“These guidelines…are critical to creating maintainable code.”

Script Me!

Automated script generator by Ann Enigma; makes simple scripts, an easy way to learn by example. “These scripts allow you to add interactive elements to your builds without knowing how to code.”

What will you script first?