|
Written by Linden Lab
|
|
jueves, 10 mayo 2007 |
|
The Linden Scripting Language (LSL) is a simple, powerful language used to attach behaviors to the objects found in Second Life . It follows the familiar syntax of a c/Java style language, with an implicit state machine for every script. Multiple scripts may also be attached to the same object, allowing a style of small, single-function scripts to evolve. This leads to scripts that perform specific functions ("hover", "follow", etc.) and allows them to be combined to form new behaviors.
The text of the script is compiled into an executable byte code, much like Java. This byte code is then run within a virtual machine on the simulator. Each script receives a time slice of the total simulator time allocated to scripts, so a simulator with many scripts would allow each individual script less time rather than degrading its own performance. In addition, each script executes within its own chunk of memory, preventing scripts from writing into protected simulator memory or into other scripts, making it much harder for scripts to crash the simulator.
This tutorial introduces the reader to the basic features of LSL, how to edit and apply your scripts, and a complete reference for standard linden constants, events, and library functions.
|
|
Last Updated ( viernes, 13 julio 2007 )
|