Greets,
I am (finally) a registered Extra version owner. I am creating my first level with A6, and am having a little problem with Dynamic Lights. All I want is to setup a simple on/off for lights in a corridor as the player approaches or leaves the light's range.

I guess the first question is does 6.40 Extra support dynamic lights?
Second, why would this not work?
Code:
  
<include My_Lights.wdl>;
...
entity* dynamiclight_1;

[in main]
Switch();

[in My_Lights.wdl]
function Switch
{
while(dynamiclight_1 == null){wait(1);} // wait until light exists!
while(1)
{
if(vec_dist (dynamiclight_1.x, Player.x) < 500) // check distance from the player
{
dynamiclight_1.light = on;
dynamiclight_1.lightrange = 500; // light on
wait(1);
}
}
}

action light_1 // attached to an invisible model
{
dynamiclight_1 = me;
my.light = off;
my.lightrange = 0;
my.red = 0;
my.green = 255;
my.blue = 255;
}




I've searched the entire forums for two days and can't figure this one out. I know there used to be a piece of code in here that does this, because I had it working in an old A5 script back in my "stumbling through demo version" days.

Anyone?

Mark


People who live in glass houses shouldn't vacuum naked.