Jump to content

eclipz13 Waco

Resident
  • Posts

    5
  • Joined

  • Last visited

Posts posted by eclipz13 Waco

  1. 43 minutes ago, Rolig Loon said:

    OK, back up and look at what Ruthven was trying to make the script do.  He wrote

    
       touch_start(integer total_number)
       {
            if(llDetectedLinkNumber(0) == llGetLinkNumber())
            { 
            }
        }

    That is, "Get the number of the link that was just clicked and compare it to the number of the link that contains this script.  If they are the same, do something."  That's not what you want to do.  You are asking a different question: "Get the number of the link that was just clicked and compare it to the link numbered 3.  If they are the same, do something."

    
    touch_start(integer num)
    {
        if (llDetectedLinkNumber(0) == 3)
       {
            // Do something
        }
    }

    which is what I told you before.

    Perfect! thank you so much ❤️ 

  2. 15 minutes ago, Rolig Loon said:

    You are misunderstanding the way that function (and all other functions like it) works.  llDetectedLinkNumber(0) is literally "the first link that was detected by this click."  llDetectedLinkNumber(3) would mean "the fourth link detected by this click."  Since you can only click on one specific link, therefore, llDetectedLinkNumber(3) doesn't make any sense.  It will always fail.

    What you'll want to do is detect the click and then ask "which link was just touched?"

    
    if ( llDetectedLinkNumber(0) == 3 )
    {
        // Do something
    }

     

    Thank you for your response, i am still somewhat new when it comes to scripting, i'm constantly learning as i go.. 

    So I don't quite understand why, but when i tried to edit the script to this, i get the syntax error..

     

    The goal is to simply change what linked piece i click for the show/hide other than the "root" prim. 

     

    integer gIntSwing = 90;
    
    rotation gRotSwing;
    
    default{
        state_entry(){
            gRotSwing = llEuler2Rot( <3.0, 0.0, (float)gIntSwing * DEG_TO_RAD> );
        }
        
        touch_start(integer total_number){
            if(llDetectedLinkNumber(0) == 3 ) llGetLinkNumber()
            { 
            }
        }
        
        
        touch_end( integer vIntNul ){
            if(llDetectedLinkNumber(0) == 3 ) llGetLinkNumber())
             llSetLocalRot( (gRotSwing = (ZERO_ROTATION / gRotSwing)) * llGetLocalRot() );
             
             
        }
    }

     

  3. On 4/28/2018 at 9:43 PM, Ruthven Willenov said:

    ok, for it to be facing the same direction, then probably the X axis would do what you want, but you need to change the angle to 180 degrees instead of 90

    try this...

    
    integer gIntSwing = 180;
    
    rotation gRotSwing;
    
    default{
        state_entry(){
            gRotSwing = llEuler2Rot( <(float)gIntSwing * DEG_TO_RAD,0.0,0.0> );
        }
        
        touch_start(integer total_number){
            if(llDetectedLinkNumber(0) == llGetLinkNumber())
            { 
            }
        }
        
        
        touch_end( integer vIntNul ){
            if(llDetectedLinkNumber(0) == llGetLinkNumber())
             llSetLocalRot( (gRotSwing = (ZERO_ROTATION / gRotSwing)) * llGetLocalRot() );
             
             
        }
    }

     

    Perhaps this is a noobish question,

    But i would like to change what link i click, but simply changing the "llDetectedLinkNumber(0)" to "llDetectedLinkNumber(3)" doesn't work as i thought.. any advice is greatly appreciated ❤️ 

×
×
  • Create New...