Step 7A closer look
First we see the "state_entry" event, which gets triggered each time the default state is entered.
SPEAK TO ME!
The first line in the event state_entry is...
llSay(0, "turning on!");
This makes the object speak "turning on!" on channel zero. What is channel zero? It is the same channel you see all public chat on.
A semicolon ends the line and yet another instruction follows.
llSetColor(<1,1,1>, ALL_SIDES);
This turns the prim to it's brightest tint. If you take the texture off the prim, you'd see it as bright white, with a texture, it looks "normal". The three 1's stand for the Red, Green, and Blue, values of the tint.
After that the event is done with the two lines of commands, the script waits idle in default waiting for more events to happen.
TOUCHED BY AN AVATAR
While idle in the default state a touch will trigger the "touch_start" event.
Inside of the "touch_start" event is only one command:
state off;
This is a command to move immediately to a new state named "off".
This state is defined after the default state and nearly mirrors the default state except that it turns the prim dark and when touched will put the script back into default mode. Thus creating a loop.
1. Enters default state
2. Runs code in "state entry"
3. Waits to be touched.
4. When touched enters "state off"
5. Enters "state off".
5. Runs code in "state entry" (note in the "off" state's body)
7. Waits to be touched.
8. When touched enters "default" state.
Where the whole thing starts over.
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|

































