Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

timer causes a no_sensor event?

Anya Ristow
Vengeance Studio
Join date: 21 Sep 2006
Posts: 1,243
10-07-2007 08:26
So, my avatar is standing well within the detection range of a sensor I've set up and I'm getting continuous sensor events. Then a timer goes off and as an extra bonus I get a single no_sensor event. Then the sensor events continue.

Is this supposed to happen this way?
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
10-07-2007 08:29
From: Anya Ristow
So, my avatar is standing well within the detection range of a sensor I've set up and I'm getting continuous sensor events. Then a timer goes off and as an extra bonus I get a single no_sensor event. Then the sensor events continue.

Is this supposed to happen this way?


If you are using llSensorRepeat, it will.

Maybe you want just a single llSensor, then process the event, before calling llSensor again?

Or post the code and we could look at it more closely?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
10-07-2007 10:36
interesting, hadn't run into this, because if I use llSensorRepeat I just add the timer code to sensor event....

if I need the timer at a larger interval than the sensor repeat I just use a coule of variables like thus

//-- globals
TimerCount;
TimerInterval;

//-- goes in sensor & no_sensor
if ((TimerCount += SensorRepeat) > TimerPop){
TimerCount = 0;
//--do timer stuff
}
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
10-07-2007 17:39
Can you explain that, RJ?

I have a script that uses sensor and timer independently and never noticed any interaction.

If this is happening, I'd have a problem, and LSL would have a bug. You shouldn't get a "no_sensor" if the searched-for item is in range.

(There's another issue about "no_sensor" that I think is an LSL bug but not a problem: you can't use a "no_sensor" without a "sensor". If you try, the event either happens right away or never -- i forget which, I just know I needed a "sensor" event even though it's ignored in my script.)
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
10-07-2007 18:15
My comment wasn't about the no-sensor: just that, depending on the code, you could wind up processing repeating sensor events. But I'd need to see the code to really tell what was going on.
Anya Ristow
Vengeance Studio
Join date: 21 Sep 2006
Posts: 1,243
10-07-2007 19:36
Oops :)

Turns out it wasn't the timer, afterall. I have some complex code to adjust the detection range as the scripted object moves, and then compensate within the sensor event so that the effective center of detection doesn't move. I had two conditions reversed and...I really was out of detection range.

All better now, thanks.