Jump to content

Recommended Posts


float   sun_height;vector  sun_position;
 state_entry() {     
  llSetTimerEvent(150);   }   
  sun_position = llGetSunDirection();        
  sun_height = sun_position.z;               
   if(sun_height < 0.0)        {            
   llSetPrimitiveParams([PRIM_POINT_LIGHT,TRUE,<1.0, 1.0, 1.0>,1.0,15,0.750, 
PRIM_GLOW, ALL_SIDES, 0.4]);        }       
 else        {            
 llSetPrimitiveParams([PRIM_POINT_LIGHT,FALSE,<1.0, 1.0, 1.0>,1.0,15,0.750, PRIM_GLOW, ALL_SIDES, 0.0]);        }    }}


float glow;float time;
// Main program
{  llSetColor(<1.0, 1.0, 1.0>, ALL_SIDES);        
state begin;    }}
// Begin state
state begin    
 {        state_entry()        {        glow = (integer) llRound(llFrand(1)); 
// Random on or off        
time = (float) llFrand(2); 
// Random wait time            
llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <1.0, 1.0, 1.0>, glow, 5.0, 0.5, PRIM_GLOW, ALL_SIDES, glow]); 
// Set prim light on/of            
state wait; 
// Go to the Wait State        
}    }
// Wait state
state wait    {        state_entry()        {            llSetTimerEvent(time); 
}        timer()        {           llSetTimerEvent(0.0); //remove the timer           
state begin; 
// Go back to the Begin State 
       }    }


Edited by Sunbleached

Share this post

Link to post
Share on other sites

I suggest getting rid of the second script rather than trying to combine the two.  Just add a fake timer to the first script to create the blinky effect.  Use the fake timer (specifically, the no_sensor event) for the SLPPF statements that mess with your PRIM_POINT_LIGHT and PRIM_GLOW.  Turn the fake timer off while the sun is shining.

Edited by Rolig Loon
  • Like 1

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now