Jump to content

First time scripter looking for some help or something T-T


RheaGale
 Share

You are about to reply to a thread that has been inactive for 3516 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Ok so I have never done a script on my own before (Ive done a few script edits a while back but nothing extensive) and Im looking to make a HUD for an item Im making.

 

What I need to know his how toggle between Object_1 and Object_2. When 1 is active, 2 is invisible and vice-verca .A toggle to turn both alpha would also be nice.

Id also like to eventually add two more objects, Object_3 and Object_4. These would be texture overlay models for 1 and 2 (respectively). Id like it so that when 1 is active, only the textures in 3 would activate when clicked on, and the textures on 4 would only activate when when 2 is active.

 

I hope this doesnt sound too confusing and heres a pre thanks to any and all who try to help me with this <3

Link to comment
Share on other sites

You have already done a lot of the heavy thinking.  You have worked out the logic of what you want to do.   All you need is the language to make it work.  I suggest, first, spending some time working through some basic LSL tutorials to become familiar with the structure and flow of LSL scripts in general.  Pay particular attention to elements that redirect a script's flow (if, while, do, ... ).  Then look for simple scripts that you know are already working and that do things you are interested in.  A good starting place is the set of example scripts in the LSL wiki. (Some are not as easy as others, but explore.)

For now, here's the basic structure of a toggle switch:

integer gON;  // This is the global flag that will tell whether the switch is on or offdefault{    touch_start(integer num)    {        gON = !gON;  // Flip the switch from TRUE to FALSE or vice versa        if (gON == TRUE)        {            // Do things that happen when the switch is on. like llSetAlpha(1.0, ALL_SIDES)        }        else        {            // Do things that happen when the switch is off. like llSetAlpha(0.0, ALL_SIDES)        }    }}

 

Link to comment
Share on other sites

 

 If you are touching a HUD, you will need either a texture with certain areas

 representing buttons, or a multi prim HUD?

 

 if you use a multi prim, you can get the link number ( and name) of the prim button that was touched...

 if(  llGetLinkName(llDetectedLinkNumber(0)) == "button_1")
        {

        }

 .... or just get the number....

    if(  llDetectedLinkNumber(0)) == 2)

      {

      }

 if you are using a texture, you will need touch UV ?

 

http://wiki.secondlife.com/wiki/LlDetectedTouchUV

 

after you have gotten the button touched, you will need to send a msg from

your HUD to the objects...

 

    if (gON = !gON )                                 // toggle the switch and check if it is true or flase

   { llRegionSay(-123,"Alpha ONE on");

   }

   else

    { llRegionSay(-123,"Alpha ONE off");

    }

 

 then you need a listen event in your objects to act on the message they recieve...

 

 hope this helps :)

E.T.A.   for changing alpha...

http://wiki.secondlife.com/wiki/LlSetAlpha

http://wiki.secondlife.com/wiki/LlSetLinkAlpha

http://wiki.secondlife.com/wiki/LlSetLinkPrimitiveParamsFast#llSetLinkPrimitiveParamsFast

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3516 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...