Scripting in Second Life: Part 1 of a Series

By on October 13, 2008

Scripting can be one of the most rewarding, but most elusive ways to make money in Second Life. Complex scripts used to cause more lag, but now with the option to compile in Mono, more complex scripts can be used while you learn to script efficiently.

This series of posts will show you how to avoid syntax errors that bring your would-be scripts to a halt, and properly organize your scripts so they can be easily debugged.


Part 1: Scripting overview.

To open an LSL script, it has to be one you made, or one you own that has modify permissions.

To access a script, either find it in your inventory and double-click it, or right click an object, choose Edit, go to Contents in the five tabs, and double-click.

LSL, Linden Scripting Language, reminds me a lot of PHP. It is organized on the following areas:

_____________________________

Variables & Functions

______________________________

Main area

default {

(States go here)

touch_start(integer a) { Instructions }

(end bracket for default state) —> }

______________________________

Variables are what you can use to hold data for your scripts: names, numbers, information, UUIDs (keys), lists, and so on. Before you use a variable in the main section of the script, you have to tell the script you want to use that variable by declaring it.

Stay tuned for a discussion of variables!

About

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>