Game Development Reference
In-Depth Information
in square brackets, [ and ], for example [“this is a list,” 125, 2.34, <1.0,0.0,0.0>,<0.5,0.0,0.1,1.0>] and are
often seen in scripts for texture animations and particle effects. A vector is 3 loats inside of pointy brackets
<  and >, such as the number for the color green, <0.0,1.0,0.0>. Rotations are 4 loats also in the pointy
brackets and indicate the object's relative position to the axes of the virtual space and its angle of banking,
for example <0.0,0.2,0.0,1.0>. A key is a unique number, or UUID (Universally Unique IDentiier) given to
every texture, object, sound, avatar, and animation in the virtual environment. These numbers are generated
randomly when the item is created or rezzed from the inventory and allow for the script to ind the particular
item in the simulation, connect with it, and run its code.
Let's sum up the concepts in LSL scripting. Oberon Onmura, one of Second Life's master scripters and
art makers, described it this way to me: “I think of LSL as an 'event driven state machine' in which func-
tions are nested within events which are nested within states. So a state is a deined environment, events
relect things that happen within that environment, and functions are the things that actually do stuff in
response.” Another way to think about it is to visualize the cause and effect you encounter in the real world.
For instance, let's suppose you are taking an afternoon nap on the couch. Think of this as the “state” you are
in. Your new puppy decides to jump up on your stomach, which is an “event.” The nerves acting like “event
handlers” in your abdomen feel the impact of canine weight and send signals to your brain which causes you
to enter another “state,” and you wake up. The brain sends signals acting like “functions” to your arms, so
you can steady the bouncing puppy. More events can follow, and more states can be entered, and more func-
tions can be triggered, all deining what happens in your real environment. LSL is designed to help create
real world scenarios in a simulator environment, and that is why it has this speciic structure. Now that you
have the basic concepts, you are on your way to learning more about how to enhance the user's experience
in your designs.
14.6 DO IT YOURSELF OR HIRE A SCRIPTER?
For some folks learning about LSL, scripting is like learning a foreign language. To really get the hang of
it, you need to immerse yourself and do it every day for a few months. Learning LSL can be rewarding, but
you will need to have the time for focused study or already be adept at another programming language like
Java or C#. Making the decision to devote time for training in scripting will most likely be driven by the
parameters of your project and your goals for self-development as a designer.
For instance, if you are designing and building an amphitheater with 50 seats and need a sit script for the
audience in each chair, you might want to take the scripting task on by yourself. There are several tutorials
online that demonstrate how to use this basic script and readily available free sit scripts in the LSL library
that you could probably modify and use. Modifying existing scripts that are available to the community is a
good way to learn about how to manipulate variables and use constants in an LSL script.
Another example of a good do-it-yourself project is particle script work. Just having one good working par-
ticle script can give you the foundation for creating everything from bonires to snowstorms. The best place to
acquire information and pre-written scripts is at the Particle Lab in Second Life, (http://maps.secondlife.com/
secondlife/Teal/191/56/21).
Reach out to the community; there are several groups in Second Life, notably Builders Brewery, College
of Scripting Music Science, and one named Scripts, where you can contact experienced scripters to share
your efforts and ask for support. In OpenSim, many scripters exchange information on the OS Grid Forum
(http://forums.osgrid.org/), and they keep a large script library there for all to use.
The best thing is to try it, see what works for you in the parameters of your skill level, and push a little bit
harder each time to make more scripts for your inventory. It will give you not only more conidence as a virtual
builder and designer but also more granular control over the behavior of your designs. The autoscript program
Search WWH ::




Custom Search