Game Development Reference
In-Depth Information
should say and do. A script in a virtual world, like a movie script, also has a speciic structural format. It also
utilizes color-coded text to identify its key components for easy reading.
Just as a movie script uses capitalization, indentation, and parentheses to let the reader quickly differen-
tiate between who is speaking, what they are saying, and what they are doing, a virtual world script uses
indentation and curly brackets {and} to identify its components and allow the scripter (coder) to keep track
of what goes on in it.
14.4 ABOUT THE SCRIPT EDITOR
Fasten your seatbelts and turn on your brain. Log in with the Firestorm Viewer, and go to a sandbox or some
land where you have build permission. Let's go ahead and create a few basic scripts inside of an object by
using the new script button in the Build menu. When you double click on a script within the contents of an
object, the Script Editor menu will let you examine the actual code of the script itself.
14.4.1 y our f irsT s CripT
We start this section by creating a cube. There are samples of basic scripts in the next sections for both
Second Life (Table 14.2) and OpenSim (Table 14.3), so the world in which you start really doesn't matter.
Figures 14.2 and 14.3 illustrate the process.
1. Activate the Build menu on the top bar of your viewer. Rez a cube and look down at the tabs in the
Edit menu that appears. Find the last tab over, the Content tab as shown in Figure 14.2. Open the
Content tab and click the New Script button.
FIGURE 14.2 Screen shot from OpenSim, showing the process of adding a new script into a cube's content. Note how
the object now says “Script running” to you in local chat as it runs the script.
Search WWH ::




Custom Search