Here's another solution I found to work pretty well. Since turning the lights off can sometimes cause the lightrange to turn off while still in view, you need to make sure the range isn't visible...
Create a spherical model for your dynamic light. Scale this model to adjust it's range. Then in the code, have the lightrange meet the radius of the model:
Code:
// ACTION: dLight
// Skill1: Red 128
// Skill2: Green 128
// Skill3: Blue 128
ACTION dLight
{
my.invisible = on;
my.passable = on;
my.red = my.skill1;
my.green = my.skill2;
my.blue = my.skill3;
//
wait(1);
c_setMinMax(my);
my.skill10 = (my.max_x - my.min_x)/2;
//
while(my)
{
if (my.clipped)
{my.lightrange = 0;}
else
{my.lightrange = my.skill10;}
//
wait(1);
}
}
EDIT: Might help to make it passable