11.07.2015 Views

Linden Scripting Language Guide - Engineering Center

Linden Scripting Language Guide - Engineering Center

Linden Scripting Language Guide - Engineering Center

SHOW MORE
SHOW LESS

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

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!