Quote:
Code:
function check_visibility()
{
var screenpos[3];
while(1)
{
vec_set(screenpos.x,my.x);
if (vec_to_screen(screenpos,camera)!=0)
{
my.lightrange=0;
}
else{my.lightrange=light_range;}
wait(1);
}
}
That's a pretty nice way to turn off a light and not mess with vec_dist like in my script. I might find some way to integrate it into my Ultimate light script one day...as an option. This method would be good for lights in a multi-floor level and that are on a floor above or below the player but are still within a range that would keep them turned on. That's a pretty big flaw in my current version, but it only occurs when the multi-floor scenario is in play.