Don't click here unless you want to be banned.

LSL Wiki : LSL101

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl801.us.archive.org

LSL 101

The Complete Newbie's Guide to Scripting in Second Life


Table of Contents

Foreword: Using This Wiki
Hello, Avatar! A Simple Script, Line By Line
States And Events
Syntax Revisited
Variables
Logic
An Introduction to Primitive Parameters
The Simple Poseball

Appendices

Do's and Don't's of Scripting
Common Errors
Solutions To Challenges

Welcome to the LSL wiki! If you're unsure how you got here, don't be afraid - this guide is made just for you.

LSL is a (mostly) clear and straightforward language. The way it's structured and how it's written make sense and provide for easy readability regardless of prior programming experience. Whether your final goal is a simple sound script or a chess computer, this guide will help you get your feet wet.

If you have no coding experience, don't worry! This guide is written with that in mind. If you're already an expert coder, especially with C++, click here for the quick and dirty guide.


Homepage | Tutorial | CrashCourse | Glossary
Comments [Hide comments/form]
"...LSL is one of the finest scripting languages you will find..."

There are so many things wrong with that statement, I won't even care to list them.
-- KeknehvPsaltery (2005-07-01 15:30:04)
Shhh... don't scare off the newbies!

It might not be the *best* language, but all things considered, it's well-traveled.
-- JeffreyGomez (2005-07-01 16:26:23)
It's only well-traveled because 30,000 people are forced to use it. Now, if they could just get Mono running, I think we could have some more developed languages, like C++.
-- KeknehvPsaltery (2005-07-01 18:47:40)
(i almost died of laughter when i first saw that; but saw the reason for the lie)
-- BlindWanderer (2005-07-01 22:43:22)
So much for editorial control... you're worse than some English teachers I've had, Kek. :p
-- JeffreyGomez (2005-07-02 06:54:22)
I'm just ensuring accuracy. That statement was a blatant lie, unless you lived in a Second Life-enabled cave.
-- KeknehvPsaltery (2005-07-02 13:17:35)
Whatever man.

When this guide has been thoroughly looked at, would someone add it to the Home Page? I don't add there as I'd prefer to not get yelled at if I screw it up.
-- JeffreyGomez (2005-07-03 13:19:35)
Can we please remove the chess computer bit, and replace it with something more realistic, like a vehicle? Without arrays, or pointers, or structs, or decent basic types, a chess AI would be absolutely hellish.

You made Primmies; do you still hold by this statement?
-- KeknehvPsaltery (2005-08-19 15:39:50)
Chess AI? The heck are you talking about, man?
-- JeffreyGomez (2005-12-01 11:27:59)
"Whether you're writing a simple sound script or a chess computer, this guide will help you get your feet wet."
...

Chess Computer? In LSL?
-- KeknehvPsaltery (2006-01-18 18:45:56)
Ah. Meh. Figurative speech is illegal this week? Not that it couldn't be done, actually.
-- JeffreyGomez (2006-02-28 18:47:38)
If I recall correctly, Alondria Lefay created a chess AI to demonstrate the capabilities of her ALSL programming language. Im not sure if she still has it out on her land though.
-- ChristopherOmega (2006-03-01 08:18:40)
Hate to burst your bubble Keknehv, but LL is not planning to make other languages available with Mono. From what I understand we will still be using LSL it will just be compiled to CIL bytecode instead of whatever its being compiled/tokenized to now. The plan is to "transcompile" all scripts with an LSL CIL compiler while maintaining state. In other words they will recompile all scripts and somehow bootstrap the existing state into the new processes. I suppose state serialization already happens when you derez a prim with a running script in it.
-- GordonPrior (2006-03-08 20:44:36)
Really? Perhaps you should voice this in the forums-- it appears that everyone their is also of the opinion that with Mono will come new languages. Yes, of course they'll keep LSL, and I've heard of the transcoding, but new languages are going to be introduced.

In fact, I believe Babbage Linden confirms it in this thread: (http://forums.secondlife.com/showthread.php?t=77199)

Babbage Linden: ''...we have developed a LSL to CIL compiler and it produces code that runs processor intensive algorithms 50-100x faster than the current LSL interpreter. Although we plan to run the existing interpreter and Mono virtual machine side by side initially, the long term goal is to phase out the interpreter and run all scripts on the Mono virtual machine. In addition to the performance increases it would allow us to open some of the .NET framework classes up to LSL as you mentioned as well as allowing other languages that target the CLR like C# and VB to be used to script SL. For more information, keep an eye on my blog http://secondlife.blogs.com/babbage Cheers, Babbage.''

It would appear that Babbage plans to have new languages as well.
-- KeknehvPsaltery (2006-03-09 15:43:01)
I say, hire KeknehvPsaltery. He seems to know more on what is going on then others do ;-)
-- ZulguroCamelCaseWakkaWiki (2006-05-29 04:38:30)
The problem with C++ is that it would exclude casual users from scripting (Maybe they should be excluded... But that's another thread... LOL).

Q: Why don't we use binary Machine Code which would be clean, concise and superior to any other language?
A: Because there are probably only 1,000 people in the world that are fluent in Machine Code.
-- DrDrebin (2006-08-22 19:51:23)
Attach a comment to this page: