11.07.2015 Views

Linden Scripting Language Guide - Engineering Center

Linden Scripting Language Guide - Engineering Center

Linden Scripting Language Guide - Engineering Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 3. Basics• Integer to List• Float to List• Key to List• String to List• Vector to List• Rotation to List• String to Integer• String to Float• String to Vector• String to Rotation3.4. Global FunctionsGlobal functions are also declared much like Java/C, with the exception that no ’void’ return value exists.Instead, if no return value is needed, just don?t specify one:make_physical_and_spin(vector torque){// double the torquevector double_torque = 2.0*torque;llSetState(STATUS_PHYSICS, TRUE);llApplyTorque(double_torque);}3.5. Global VariablesGlobal variables and functions are accessible from anywhere in the file. Global variables are declared much likeJava or C, although only one declaration may be made per line:vector gStartPosition;Global variables may also be initialized if desired, although uninitialized global and local variables are initializedto legal zero values:vector gStartPosition = 10

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!