Difference between revisions of "LSL Errors"
m (quote all of the Type mismatch compilation error message and make that the subsection heading) |
m (convert all the error names into subsection headings) |
||
Line 5: | Line 5: | ||
A script may stop running, and chat at you the complaint "Script run-time error", followed by another complaint such as: | A script may stop running, and chat at you the complaint "Script run-time error", followed by another complaint such as: | ||
===Lists may not contain lists=== | |||
Don't try adding a list into a list. | |||
===Math Error=== | |||
Float divided by zero, integer divided by zero, etc. | |||
===Stack-Heap Collision=== | |||
The Stack has collided with the Heap.<br/>The LSL memory space contains three sections Bytecode, Stack and Heap which all must be contained in 16KiB of memory. | |||
This can occur if the running script is too big. The script compiles and saves successfully, but when an object containing it is instantiated the script crashes. | |||
See [[llGetFreeMemory]]. | |||
==Sample scripts that demo script run-time error messages== | ==Sample scripts that demo script run-time error messages== |
Revision as of 07:07, 23 September 2007
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Script run-time error messages
A script may stop running, and chat at you the complaint "Script run-time error", followed by another complaint such as:
Lists may not contain lists
Don't try adding a list into a list.
Math Error
Float divided by zero, integer divided by zero, etc.
Stack-Heap Collision
The Stack has collided with the Heap.
The LSL memory space contains three sections Bytecode, Stack and Heap which all must be contained in 16KiB of memory.
This can occur if the running script is too big. The script compiles and saves successfully, but when an object containing it is instantiated the script crashes.
See llGetFreeMemory.
Sample scripts that demo script run-time error messages
default { state_entry() { list once = []; list twice = [once, once]; // Script run-time error: Lists may not contain lists } }
default { state_entry() { float one = 1.0; float zero = 0.0; float quotient = one / zero; // Script run-time error: Math Error llOwnerSay((string) quotient); } }
Surprising compile-time ERROR messages
The SL GUI may reject some code that you feel is perfectly clear, printing ERROR at you and then explaining with some further complaint.
ERROR: Type mismatch
You must name the .x .y .z .s components of a vector or rotation that you're assigning, you can't assign them all at once from a list, for instance:
default { state_entry() { vector vec = (vector) [1, 2, 3]; // ERROR : Type mismatch llOwnerSay((string) vec); } }