State exit: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
Strife Onizuka (talk | contribs)
No edit summary
Strife Onizuka (talk | contribs)
mNo edit summary
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{LSL_Event
{{LSL_Event
|event_id=1|event_delay|event=state_exit
|event_id=1|event_delay|event=state_exit
|event_desc=Triggered on any state transition
|event_desc=Triggered on a qualifying [[state]] transition.
|constants
|constants
|spec
|spec
|caveats
|caveats
|examples
|examples=<lsl>default
{
    state_entry()
    {
        llOwnerSay("in default state");
    }
    touch_start(integer detected)
    {
        state other;
    }
    state_exit()
    {
        llOwnerSay("leaving default state");
    }
}
 
state other
{
    state_entry()
    {
        llOwnerSay("in state \"other\"");
    }
    touch_start(integer detected)
    {
        state default;
    }
    state_exit()
    {
        llOwnerSay("leaving state \"other\"");
    }
}</lsl>
|helpers
|helpers
|also_header
|also_header
Line 12: Line 42:
|also_articles
|also_articles
|also_footer
|also_footer
|notes
|notes=While the [[default]] [[state_entry]] is triggered on script reset, state_exit is not triggered prior to the reset.
|mode
|mode
|deprecated
|deprecated
|cat1=Script
|cat1=Script
|cat2
|cat2=State
|cat3
|cat3
|cat4
|cat4
}}
}}

Revision as of 13:42, 27 February 2009

Description

Event: state_exit( ){ ; }

Triggered on a qualifying state transition.


Caveats


Examples

<lsl>default {

   state_entry()
   {
       llOwnerSay("in default state");
   }
   touch_start(integer detected)
   {
       state other;
   }
   state_exit()
   {
       llOwnerSay("leaving default state");
   }

}

state other {

   state_entry()
   {
       llOwnerSay("in state \"other\"");
   }
   touch_start(integer detected)
   {
       state default;
   }
   state_exit()
   {
       llOwnerSay("leaving state \"other\"");
   }

}</lsl>

Notes

While the default state_entry is triggered on script reset, state_exit is not triggered prior to the reset.

Deep Notes

Signature

event void state_exit(  );