Jump to content

Sunbleached
 Share

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

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

Recommended Posts

 

float   sun_height;vector  sun_position;
default{      
 state_entry() {     
  llSetTimerEvent(150);   }   
  timer() 
  {        
  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
default
{    
state_entry()    
{  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); 
//Wait        
}        timer()        {           llSetTimerEvent(0.0); //remove the timer           
state begin; 
// Go back to the Begin State 
       }    }

 

Edited by Sunbleached
Link to comment
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
Link to comment
Share on other sites

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