LSL Linden Scripting Language Andrew Orr 121707 ObjectOriented

  • Slides: 8
Download presentation
LSL: Linden Scripting Language Andrew Orr 12/17/07

LSL: Linden Scripting Language Andrew Orr 12/17/07

“Object”-Oriented LSL is a high-level scripting language Developed by Linden Labs for their virtual

“Object”-Oriented LSL is a high-level scripting language Developed by Linden Labs for their virtual world Second Life. Simple, powerful language used to attach behaviors to the objects

Purpose of LSL Control the behavior and interaction of objects within Second Life Allows

Purpose of LSL Control the behavior and interaction of objects within Second Life Allows internet communication through HTML requests and email Users create scripts to enhance their products that they make available to other SL residents

LSL is very similar in syntax to C/C++ and Java, and is compiled into

LSL is very similar in syntax to C/C++ and Java, and is compiled into byte code much like Java LSL is state-event driven language Event triggers: collisions with other objects, movement, chat commands from users, email, timers, etc.

Functions There approximately 300 preset library functions, but users can also define their own

Functions There approximately 300 preset library functions, but users can also define their own functions. All Linden library functions begin with ll, eg. ll. Say (0, “Shoulda had take home exam!”);

Script Facts Each script executes within its own chunk of the simulator’s memory. Each

Script Facts Each script executes within its own chunk of the simulator’s memory. Each script is given a slice of time from a set amount of time given to scripts in a simulator. Multiple scripts can be attached to an object to allow for complex behaviors.

Data Structures Integers Floats Strings Vectors (used for position, direction, colors) Rotations (quaternions) Lists

Data Structures Integers Floats Strings Vectors (used for position, direction, colors) Rotations (quaternions) Lists

Example Script default { state_entry() { ll. Say(0, "Hello, Avatar!"); } touch(integer total_number) //executes

Example Script default { state_entry() { ll. Say(0, "Hello, Avatar!"); } touch(integer total_number) //executes when an avatar { //touches the object. ll. Say(0, "Touched. "); } }