Difference between revisions of "LSL Errors"

From Second Life Wiki
Jump to navigation Jump to search
(add Math Error with example of float nonzero divided by zero)
m (balance the pre tags in the format)
Line 23: Line 23:
</pre>
</pre>


</pre>
<pre>
default
default
{
{
Line 34: Line 34:
     }
     }
}
}
<pre>
</pre>

Revision as of 21:33, 5 September 2007

Script run-time error messages

  • Lists may not contain lists
  • 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.

Examples

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);
    }
}