Linden Scripting Language Guide - Engineering Center
Linden Scripting Language Guide - Engineering Center
Linden Scripting Language Guide - Engineering Center
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Chapter 5. StatesAll scripts must have a ’default’ state, which is the first state entered when the script starts. States contain eventhandlers that are triggered by the LSL virtual machine. All states must supply at least one event handler - it’s notreally a state without one.When state changes, all callback settings are retained and all pending events are cleared. For example, if youhave set a listen callback in the default state and do not remove it during state_exit(), the listen callback will becalled in your new state if a new listen event passes the filter set in the default state.5.1. state_entry()The state_entry event occurs whenever a new state is entered, including program start, and is always the firstevent handled. No data is passed to this event handler.You will usually want to set callbacks for things such as timers and seonsor in the state_entry() callback of thestate to put your object into a useful condition for that state.17