Game Development Reference
In-Depth Information
TABLE 14.5
Setting the Parameters for a New Door Script
Line No.
LSL Code
What You Want the Script to Do
?
The door has to rotate on its hinge.
?
The door has two States in its script besides the default; they are Open
and Shut.
?
The door knows who the owner is; it has the owner's identity, called Key
or UUID.
?
The door lets the owner update a list of people with access to the owner's
place so they can enter.
?
The door needs to open on the owner's verbal command.
?
The door needs to shut by itself after some time or when the owner or
guest touches it again.
?
The door makes a nice closing and opening sound.
This exercise should have shown you the following two things:
1. This kind of door script is probably beyond the abilities of a novice scripter.
2. There are many factors that can go into creating even the simplest things in a virtual world, especially
if we want them to be interactive.
It is not typical to think of a virtual door as interactive, but in fact, doors most often are to some extent.
A good scripter will make a nice, clean, readable door script with understandable comments on it. A great
scripter will look for and suggest ways the door can be made more interactive and streamline the script to
help the script run faster.
14.8 SCRIPTING AND VARIOUS PERFORMANCE PITFALLS
Every prim or object, every texture on them, every script in them, demands attention from the processor
of the virtual machine that runs your sim. When this is overtaxed, we begin to experience “lag,” which
can manifest in various ways. Our chats and instant messages (IMs) start to show up out of order, making
conversation dificult, or our avatars and their cameras jerk or just freeze in position.
The following is a list of some of the biggest lag producers in the scripting family as well as scripts that
can interfere with the overall rendering of the virtual world on your screen:
1. Listener scripts that are utilizing the llListen() function to scan the region for chat to which they
should respond. If there are a lot of these scripted objects, it will start to have an impact on the server's
processing time, especially if these objects are all listening and chatting on the same channel.
2. Lots of changing textures or animation of textures on the surfaces of your build will demand signii-
cant processing time from your viewer.
3. Physics-based elements such as vehicles, moving animals, or even physical coconuts falling from a
tree can add work for the physics engine and tax the region's processing response.
4. Object-embedded software scripts, such as URL givers that open a viewer or seek a database on an
outside server, will add to the load.
 
Search WWH ::




Custom Search