Understanding Second Life State Machines | Heaton Research

Understanding Second Life State Machines

    To see state machines in action, consider the default script, which is automatically generated by Second Life, when a new script is created. This script is shown here.

default
{
    state_entry()
    {
        llSay(0, "Hello, Avatar!");
    }

    touch_start(integer total_number)
    {
        llSay(0, "Touched.");
    }
}

    This script starts with the word default. The word default specifies the name of the state that the enclosed code belongs to. For this script there is only one state. This state, which is named default, is the starting state for any script in Second Life.

Copyright 2005-2008 by Heaton Research, Inc.