Hi Folks
I am trying to set a series of lights in a corridor whihc come on when the player is close to them. I used trigger points successfully but then needed additional trigger points to switch off the light as the player moved away.
Following the ocfpscguide (or at least trying to!) I wrote this small script but don\'t understand why it doesn\'t work;
;script to automatically turn on or off a light
;depending on the distance of the player
desc=Light toggle with distance
:state=0:state=1
:state=1,plrdistwithin=100:state=2,lighton
:state=2,plrdistfurther=100:state=1,lightoff
As far as I understand it the state of the dynamic light (the Start script of the light is "lightoff.fpi" and the Main script is as above) starts off as 0. The engine checks this and changes the state to 1. With the state as 1 then if the player is within 100 units the state changes to 2 and the light goes on. Whith the state at 2 if the player moves out of the 100 unit range then the state changes back to 1 and the light goes off.
...at least that's the theory but I've obviously errored out here.
If anyone could explain what I'm doing wrong then I'd appreciate it.
Thanks and regards
Andy
Andy S, Reading, Berks