Default

From Second Life Wiki
Jump to navigation Jump to search
The correct title of this article is default. The initial letter is shown capitalized due to technical restrictions.

default { events }

default { events }
• event events one or more events

default state definition. When a state target; is encountered at runtime, if the current state and the target state are different:

  1. Trigger state_exit in the current state if it exists and clear the event queue.
  2. Change state to target, any listens are unregistered.
  3. Trigger state_entry in the target state if it exists.

If target state is the same as the current state, no state change occurs nor do any of the side effects.

Caveats

  • On state change all listens are released.

Examples

default
{
    touch_start(integer a)
    {
        state hello;
    }
}

state hello
{
    state_entry()
    {
        llOwnerSay("Hello");
        state default;
    }
    state_exit()
    {
        llOwnerSay("Goodbye");
    }
}

See Also

Keywords

•  state
•  jump
•  return

Events

•  state_entry
•  state_exit