
Untitled
By: a guest on
Jun 20th, 2012 | syntax:
None | size: 1.06 KB | hits: 13 | expires: Never
float frequency = 60; // 5 min
integer set_daynight = 0; // 0 night 1 day
float glow_full = 0.05;
//LINK_ROOT 1 sends to root prim in a linked set
//LINK_SET -1 sends to all prims
//LINK_ALL_OTHERS -2 sends to all other prims
//LINK_ALL_CHILDREN -3 sends to all children, (everything but the root)
//LINK_THIS -4 sends to the prim the script is in
integer link_set = LINK_SET
start_glow()
{
llSetLinkPrimitiveParams(link_set, [PRIM_GLOW, ALL_SIDES, glow_full]);
}
stop_glow()
{
llSetLinkPrimitiveParams(link_set, [PRIM_GLOW, ALL_SIDES, 0.0]);
}
check_for_transition()
{
vector sun = llGetSunDirection();
integer day_night = set_daynight;
if (day_night)
day_night = sun.z > 0.0;
else
day_night = sun.z < 0.0;
if(day_night)
{
start_glow();
}
else
{
stop_glow();
}
}
default
{
state_entry()
{
llSetTimerEvent(frequency);
check_for_transition();
}
timer(){
check_for_transition();
}
}