Jump to content

llGetPrimitiveParams question


Misy Pera
 Share

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

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

Recommended Posts

Hi Everyone!  

 

Okay... so I always run into problems when I use llGetPrimitiveParams and of course this time is no exception.

 

I want to make my script check to see if the glow is one thing or anouther and then do whatever but if only fires Glow2 and never Glow1 so I know I have this wrong.  Thanks!

 timer()
  {
    float glowon =  Intensity*2;
    list GL  = llGetPrimitiveParams([PRIM_GLOW, 1]);
    integer glow = llList2Integer(GL, 0);
 if (glow == (integer)glowon)
    {  
       Glow1();
    }
    else
    {  
       Glow2();
      }
    }

 

Link to comment
Share on other sites

Xijia is right.  Glow is a floating point number between 0.0 and 1.0.  When you make it an integer, it will always round down to zero.  The way to solve this one is to multiply by 10 (or maybe 100) and then make it an integer.

integer BigGlow = (integer)(10.0*glow);if (BigGlow >= 30){   Glow1();}else{    Glow2();}

 

 

Link to comment
Share on other sites

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