Jump to content

Wanting to Learn


AnieZGreat
 Share

You are about to reply to a thread that has been inactive for 919 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello! I'm on and off Second Life a lot, but I am curious about their scripting. I was hoping to learn the skill, and from what I know SL has it's own programming language. I suppose my questions are the following:

Which coding language has the most similarity to LSL?
And is there anywhere I can learn it off-world?

  • Like 1
Link to comment
Share on other sites

Linden Scripting Language shares some features of C++, but not many.  It is an object oriented language with its own syntax and structural logic.  Still, if you are familiar with other languages, you won't have difficulty picking up LSL.  I suggest looking at a few very simple tutorials to get a feel for the way that the language uses states and events , which are most likely to be unfamiliar and which are at the core of LSL.  Then start looking for examples that are a part of each description in the large section of the LSL wiki devoted to built-in functions.  You should learn quickly by dissecting examples and modifying them for your own use.  The wiki -- developed and maintained by users -- is the best manual I have found for any programming language.  Finally, as you learn and have questions or frustrations, share them here in this forum.  We have all learned from each other.  We will rarely post complete scripts here (free tested, documented scripts are posted in the LSL Library) , but we commonly post snippets and short examples to illustrate novel approaches or workarounds for unexpected problems.

Edited by Rolig Loon
Cleaner wording
  • Like 1
Link to comment
Share on other sites

22 hours ago, AnieZGreat said:

Which coding language has the most similarity to LSL?

LSL shares a more or less common base with "Curly-bracket" languages like C and javascript. If you've only ever used, say python which uses whitespace formatting, it may take a bit to get used to needing to end every statement with a ';' and enclose sections with '{ }'s but other than that, LSL is pretty easy to get used to if you've used another programming language before.

22 hours ago, AnieZGreat said:

And is there anywhere I can learn it off-world?

The wiki http://wiki.secondlife.com/wiki/LSL_Portal has a few tutorials apparently, but its real strength is reference sections, detailing function usage and so-on. In fact, I think most people have an open tab to the wiki while scripting, it's rather hard to remember the correct names for functions and such otherwise. (pro tip though: if you spell the name of a function correctly in the in-world editor, you can hover over it for a brief description, including the order of its arguments.)

22 hours ago, Rolig Loon said:

It is an object oriented language

I hate to be a pedant, but LSL is not an object-oriented language (there are no objects to orient it around, and no '.' operator.); It's an imperative one.

// Valid LSL
list unsorted = [5,2,9,3,7,1];
list sorted = llListSort(unsorted,1,TRUE);
// What some object-oriented languages would do:
list sorted = unsorted.llListSort(1,TRUE);
Edited by Quistess Alpha
  • Like 4
Link to comment
Share on other sites

3 hours ago, Quistess Alpha said:

I hate to be a pedant, but 

You're going to be one anyway, 'coz it' sChristmas :)

Imperative as in JFDI doesn't quite apply, because the events queue in in a "I'll do it when I get round to it" manner @)

But you're right, it is (refreshingly) un-object-orientated.

  • Like 3
Link to comment
Share on other sites

LSL is an event-driven language

for offline learning with coding tutorials then get the Jeff Heaton books here: https://marketplace.secondlife.com/p/Jeff-Heaton-SecondLife-Book-Examples/16675718

and the LSL Editor here: https://sourceforge.net/projects/lsleditor/

both are quite old and don't include all of the later LSL library functions available here: http://wiki.secondlife.com/wiki/LSL_Portal

but for offline learning of the basics of LSL event-driven programming, the LSL Editor and Jeff Heaton's tuts are pretty good aids

 

  • Like 2
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 919 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...