Reset

In SL terms, a reset generally means to put (or "set") back to a previous condition, state, form, or time. There are several different kinds of things that can be reset, and different ways of performing a reset in each case.

Note: rezzing an object does not reset the scripts in it, change the state of the scripts, or reset any other aspect of an object.

State

Each script has a state that is distinct from other things that are sometimes called state, such as the state of variables and properties of prims. When a script is reset (see below), its state is set to the default state which is called default, and the default state_entryevent is triggered.

Any events in the event queues of a script are cleared when the state is changed.

Scripts

A script can reset itself or another script back to the condition it started in. This is equivalent to when a script is compiled when it is saved after changes, or when the reset button is pressed or reset menu item is selected. Another aspect of the condition of a script is whether it is running. If an error occurs, a script stops running and cannot be reset by another script.

Functions

Global Script Values

When a script is reset, the value of each global variable is set to its initial value. There are also a few other global values hidden in scripts that act like global variables. Global variables may be explicitly set by a script's code and other hidden global values are set in other situations described in the following table.

Object/Prim Values

While each script contained in a prim has its own state, it is important to note that each prim and the object it is contained in maintains many values or properties that are separate from the scripts and, once set, the script is no longer needed.

With few exceptions, these are not reset when a script in a prim is reset. There are often special functions for setting the values or resetting to the default state. The default value is often one of these: 0 (zero), FALSE, constants (like ZERO_VECTOR, ZERO_ROTATION, NULL_KEY), or an empty string ("").