DEV Community

Cover image for Must-Haves for Second Life Scripting
Galaxy Littlepaws
Galaxy Littlepaws

Posted on • Updated on

Must-Haves for Second Life Scripting

So, you want to get into scripting for Second Life, one of the most-popular virtual worlds? Need to pizzazz that plywood cube, or create something a little more complex such as a HUD for texturing mesh clothing? Let's discuss what has helped me with scripting with Linden Scripting Language (LSL).

IDE:

For this, I greatly prefer the editor and external editor options that exist in the Firestorm or Alchemy viewers. You can customize the UI, insert things, and get error messages and test immediately. You also have the option to use a pre-processor in both viewers.

If you want to use something like Visual Studio Code, I recommend using one of these extensions:
https://github.com/Minuit-Ferina/vscode-lsl
https://github.com/jyaoma/vscode-lsl

Other popular IDEs include Sublime Text and NP++.

Optimizer:

I recommend using PyOptimizer. You can download it and even use it in your browser here: http://lsl.blacktulip-virtual.com/lsl-pyoptimizer/

It is written in Python 2.7, and supports supports code memory optimization for Mono. There are many reasons to use it, check out their website above for the full details.

Alchemy and Firestorm also include optimizing in their pre-processor.

Wikis, Documentation, and Free Scripts:

There are many places to learn about LSL and how it works.

First, you need the official and most up-to-date documentation that's found on the SL wiki here: https://wiki.secondlife.com/wiki/LSL_Portal

You can also get many free scripts online. I'll link to some of my favorite websites:

You may also be able to find other LSL code or snippets on GitHub or other code-sharing sites.

In-World Groups:

You can also make use of groups in-world. I recommend searching for these inside the viewer, as it is otherwise hard to link to them outside of SL. There are many groups out there, so feel free to search for others as well.

  • Builder's Brewery
  • Script Academy

Ideas:

So, let's get down to business. The best way to learn scripting is to script, so let's look over some ideas. And feel free to put your own spin on things!

  • A painting that looks different depending on which day of the week it is, or perhaps on holidays (texturing, date checking)
  • An object that alerts you when the simulator hosting the region is rebooted
  • A HUD that changes the appearance of furniture in a home, and the listener inside the furniture (texturing, contacting other objects)
  • A pet that you can wear, and interacts with other people on a touch event (anti-spam measures, chat or hover text)

What's Next?

I'll be writing more posts on how to make various things with this language, so stay tuned!

Top comments (2)

Collapse
 
paulpreibisch profile image
Paul Preibisch

Thanks so much for this Article Galaxy Littlepaws! My name is Paul, but way back in 2005 - I became known as Fire Centaur in Second Life. I actually created several products in the Marketplace, using prims and LSL. One of my proudest contributions is my Game Buzzer marketplace.secondlife.com/p/Game-...

I'd love to know what you are currently programming in LSL

Collapse
 
galaxylittlepaws profile image
Galaxy Littlepaws

I'm glad you liked my post!

Currently I'm working hard on fixing up a breedable system (I had bought some code in production, but something happened due to relying on the old backend that I've been fixing ever since). I think the next time I do code for a breedable, it will be far more efficiently done due to so many changes that have happened in LSL the past few years, such as LinkSetData. I'll have to write all about it when the time comes.

One big thing I plan on working on is a role-play system for cat avatars, allowing things like hunting, fishing, fighting enemies, and so on. I haven't quite found anything that does that yet and it would be a lot of fun. I think it would be a great exercise in writing games for Second Life, and I will be releasing that code as Open Source.