Jump to content

My Tardis needs help :)


Sari6t
 Share

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

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

Recommended Posts

Hi there

I'm a 5 day LSL scripting professional...lol,  Anyway I've cobbled together loads of nifty things for a super ambitious project ...TARDIS...and nearly have the materialization thing working. 

Here is where I am stuck ,or not sure about. What I have duct taped together works well enough....once. What I mean is I can say on a channel "/77 show" and it fades and glow and appears with a working timer and all that. Yay!

But.. the second time it gets stuck in a loop of appearing, its like the timer().. llSetTimerEvent isn't stopping. I used a counter that seems to work fine the first time but not after that. I have to manually reset to stop it. I've tried llResetScript() but so far it just kills the timer counter totally. Not sure where its wrong. I'll post the code for it and keep banging away.

Thanks in advance :)

 

integer count;  // Count function
integer channel = 77;    // channel number
string showcmd="SHOW";    // show command - use uppercase only
string hidecmd="HIDE";    // hide command - use uppercase only

integer links = LINK_SET;

 // This is the show and hide that I need but don't know how to use properly
 show() {
         
    }



hide() {
        
      
    }

default
{

     state_entry()
            {
      
                llListen(channel, "", NULL_KEY, ""); // Listen on a channel
                llSetTimerEvent(0.0);
            }

    // Listen on the channel given at the top and do things
        listen(integer channel, string name, key id, string message) 
        {
            string m=llToUpper(llStringTrim(message,STRING_TRIM));
            if (m==showcmd)
             {
                show();
                     llSetTimerEvent(0.1); // Wont work without it so far
                 
                
            } else if (m==hidecmd)
            {
              
                hide();    
                
               
           }

        }

    // Makes wonderful glow and fade of the prim over a set number of seconds. 
    timer()
    {
    
        float glow = 0.0;
        while(glow < 0.5) {
            
                 glow+=0.01;  
                llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_GLOW, ALL_SIDES, glow]);
                llSleep(0.01);
                }
            
                 glow = 0.5;
            
        while(glow > 0.1)
                {
                    glow-=0.01;  
                    llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_GLOW, ALL_SIDES, glow]);
                    llSleep(0.01);
                }
 // Swapping the fade in and out does what I want in that it reversed the effect.       
       // fade out
        float alpha = 1.0;
        while (alpha >= 0.0)
        {
            llSetLinkAlpha(LINK_SET, alpha, ALL_SIDES);
            alpha -= 0.001;
        }
      
        
        // fade in
        while (alpha < 1.0)
        {
            alpha += 0.001;
            llSetLinkAlpha(LINK_SET, alpha, ALL_SIDES);
        }
     
     // Down here we have some Prim Params again cause more is better??       
       llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_GLOW, ALL_SIDES, 0.0]);
         
         llSetTimerEvent(0.1);
         ++count;  // Start Counting
           if(count == 3) // this is the timer that might cycle this for me
           llSetTimerEvent(0.0);   // Kill the Event at the set time
           
          
    
        }



}

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2655 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...