Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Scripting for Dummies

Olympia Rebus
Muse of Chaos
Join date: 22 Feb 2004
Posts: 1,831
06-10-2005 09:19
I do some simple scripting... but I'm a dummy!
Even the LSL Wiki (as wonderful as it is) can't always help me. Trouble spots (mine and others) are mentioned in this thread

One thing we seem to have in common is that while we understand much of the concepts, we have trouble integrating them successfully into scripts, particularly from scratch.

We've learned much from tinkering with existing scripts, but not everything.

Script savy in-world friends are helpful, but the liner nature of chat sometimes makes it difficult (for me at least) to describe the interconnected nature of a script and its parts.

Any ideas, resourses, excercises, things to watch out for, for us?

Your help is apprciated.
_____________________
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
06-10-2005 18:03
From: Olympia Rebus
Any ideas, resourses, excercises, things to watch out for, for us?

Several. While the Wiki is the most consolidated body of information, there are several residents that are available to answer any questions.

Let me break this down into 10 simple "Do's" and "Don'ts" to start things off.


Do List:

1) Learn from others' scripts available for free.

Available on the Scripting Library and Wiki, as well as countless places in-world, these examples are the necessary first step to cracking into LSL.


2) Ask questions often, both here and in-world.

For many people, this is the only way to learn effectively. There's no shame in not knowing how to do something.


3) Try to do new things with old commands.

Test the limits of the commands you come across. Notice any patterns, nuances, and bugs that may occur.


4) Use states and personal functions when tasks are repeated often.

Doing so greatly reduces the volume (and frustration) of code you must write.


5) There is no shame in Trial and Error; use it.

We all make mistakes. I've been known to spend several days to tackle very simple problems at times, and people seem to have a high regard for my abilities. We're all human.


6) Use multiple scripts as needed.

That's what they're there for. If you run out of room or usefulness in one script, start a second. Don't be afraid.


7) Read the context-based help.

One of the best-kept secrets of LSL is also its simplest. By highlighting any command typed in properly, you can see a tooltip on its syntax and usage. As for figuring out how it's spelled? Try the Wiki.


8) Set realistic goals for yourself.

Achieve them by accomplishing real tasks. Say to yourself: "I want to make this really cool killer app in Second Life" and strive to create it. Make these goals realistic.


9) Work smarter, Not harder.

Once you have a fair deal of coding experience under your belt, ask yourself how something might be done better - even if it's been done before. Working smarter means servers are happier; working harder means the reverse.


10) Code, Code, Code

Nothing beats experience. Get out there and do something.




Don't List:

1) Don't push yourself too hard.

It's easy to get frustrated if you cannot tackle a problem. There's a fine line between creation and obsession. Know your limits, and strive to extend them at a realistic pace.


2) Avoid stuff that you know is harmful. If you have to use it, be polite:

A lot of the complaints filed on these boards and in Second Life stem from people failing to use simple common sense. Anyone can be better than this if they're willing to try to do so. Will you?


3) Don't expect LSL to have a neat solution for everything:

LSL is a language created to give us tools, not necessarily solve all common problems in a nice, neat package. Because a task does not have an LL function does not mean it cannot be done. It also does not mean the Lindens should "just add it." It means you should take a whack at it first.


4) Don't expect functions to do exactly what you want all of the time:

Learning is in order. LSL is half bending LSL to your will, half bending to fit its design. The same can be said of any coding language.


5) Don't overuse dynamics and community functions:

Set reasonable limits on physics, push, and player-related functions. Physics is the single-most laggy ability of Second Life, second only to poor scripting. Abuse of messages and ban scripts are the single most annoying part of Second Life.


6) Don't get carried away:

Just because you can do something doesn't mean you should. Always weigh in the possible benefits and concerns of scripts you write.


7) Use some functions in moderation:

A few listeners, a few sensor loops, and a few timers are all okay; Second Life was built to handle these. A couple hundred in an object are not okay. A couple hundred objects with a few of these are not okay. If confronted with this problem, think it through prior to working on it.


8) Don't expect to know everything:

I use the Wiki extensively for reference. Keep good notes, and refer to them often if you're forgetful.


9) Don't delete something when you're done:

Save a copy! It might prove useful later.


10) Don't use scripting to plot World Domination:

Unless you want to find me waiting with my Nerf Bat. ;)


--------


Feel free to add more.
_____________________
---
Olympia Rebus
Muse of Chaos
Join date: 22 Feb 2004
Posts: 1,831
06-10-2005 18:45
Thanks, Jeffrey.
Much appreciated! :)
_____________________
Toy LaFollette
I eat paintchips
Join date: 11 Feb 2004
Posts: 2,359
06-10-2005 19:04
thanx from me too Jeffery, I hope you dont mind but I made your post a notecard in world :)
_____________________
"So you see, my loyalty lies with Second Life, not with Linden Lab. Where I perceive the actions of Linden Lab to be in conflict with the best interests of Second Life, I side with Second Life."-Jacek
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
06-10-2005 20:07
No problem. And I don't mind.
_____________________
---
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
06-11-2005 03:11
Some great advice.

This should be in the wikki too under the "getting started" section I think.

/esc
_____________________
http://slurl.com/secondlife/Together