Functions
Built-in functions
Section titled “Built-in functions”The built-in functions are listed in the function reference and grouped by category. From the wiki’s delay page: “Some LSL functions delay script execution when they are called.”
User-defined functions
Section titled “User-defined functions”From the wiki: “LSL allows user-defined functions which will help keep scripts compact and readable, and allow code reuse.”
<return_type> function_name([<parameter1_type> parameter1[, <parameter2_type> parameter2[, ...]]]){ function_statements;
...
return value_of_return_type;}- “User-defined functions must be defined before any states in the script or a syntax error will be generated on compilation.”
- “The
return_typemay also be omitted for a void type function.” - “Parameters are passed by value, as with built-in functions. They behave like local variables and writing into them has no effect on what the function was called with.”
- “If multiple return values are desired, they can be packed into a list, a vector or a rotation, depending on what you need to return.”
Reference
Section titled “Reference”Quotations are from the Second Life Wiki pages Category:LSL User-Defined Functions (revision 1216649, 2024-05-12) and LSL Delay (revision 1175422, 2012-12-19); history, by Second Life Wiki contributors, under CC BY-SA 3.0. Last wiki edit: .