User:Eyana Yohkoh

From Second Life Wiki
Revision as of 18:00, 27 August 2007 by Eyana Yohkoh (talk | contribs)
Jump to navigation Jump to search

Eyana Yohkoh, LSL dabbler.

Page slowly under construction.

Eyana Yohkoh's script examples:

    • Basic Opacity Change: Method 1
// Change Opacity Script
// This script will change the transparency when the prim is touched.
// The first click will make it 50%, the second will make it invisible
// and the third will set it back to normal.



default
{
    state_entry()
    {
        llSetAlpha(1.0, ALL_SIDES);     // this will make the prim completely solid
                                        // the 1.0 is the alpha, and alpha goes from
                                        // 0.0 to 1.0 with 0.0 being invisible.
                                        // ALL_SIDES can be replaced with a number if
                                        // you want just one side of the prim to hide.
    } 

    touch_start(integer num_detected)   // this says everything in the following brackets
                                        // will happen whenever the prim is touched.
    {
        state seethrough;               // this will make the script jump down to the next
                                        // state. a state is basically a set of commands
                                        // that becomes active only when you tell the script
                                        // to go to that new state.
    }
}


state seethrough                        // this is the new state to set it to 50% alpha.
{                                       // the script doesn't go here unless it has a specific
                                        // instruction to do so.
    state_entry()           // every time you go into a new state you can have a state entry
                            // where stuff happens as soon as it enters that state
    {
        llSetAlpha(0.5, ALL_SIDES);     // this sets the prim to 50% see through.
    }
    
    touch_start(integer total_number)
    {
        state invisible;            // when touched the script will go to a third state
    }
} 

state invisible                         // this state is for everything that happens to make it
                                        // invisible as well as a touch thingie to make it go
                                        // back to the beginning of the script
{
    state_entry()
    {
        llSetAlpha(0.0, ALL_SIDES);     // sets the prim to invisible as soon as this
                                        // state starts.
    }
    
    touch_start(integer total_number)
    {
        state default;                  // when touched this will send the script to the
                                        // beginning.
    }
}