Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

NULL_KEY in llSensor() ?

Erik Goff
Registered User
Join date: 26 Mar 2006
Posts: 4
09-06-2006 02:32
Hello,
Does anyone know why i detect a NULL_KEY when i search agents with llSensor()?

i use :
llSensor("", NULL_KEY, AGENT, sensorrange, TWO_PI);

and it returns, among the avatars, also a null key.

any ideas would be very welcome.

Cheers
Laukosargas Svarog
Angel ?
Join date: 18 Aug 2004
Posts: 1,304
09-06-2006 02:40
If it's only occasionally it could be a Linden or a LL employee, I seem to remember they used to return null keys, ( or not show up at all ).

If it does it all the time, is the null always in the same place, ie at the end of the list ?
Make sure you're not reading too many items back from the list ;)

Also PI will give you a full directional search, 2 X PI maybe confusing it ? ( i expect it's clamped though ). see the diagrams here .. http://secondlife.com/badgeo/wakka.php?wakka=llSensor
_____________________
Geometry is music frozen...
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
09-06-2006 05:37
I had something similar happen when I removed a sensor set up by llSensorRepeat before processing the list....

The following code returned NULL_KEY for every entry
CODE

sensor(integer total_number)
{
llSensorRemove();
for(i = 0;i < total_number;i++)
{
key id = llDetectedKey(i);
string name = llKey2Name(id);
......
}
}

Where as this version worked
CODE

sensor(integer total_number)
{
for(i = 0;i < total_number;i++)
{
key id = llDetectedKey(i);
string name = llKey2Name(id);
......
}
llSensorRemove();
}
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
09-06-2006 07:55
Lindens can choose if they show up in a Sensor or not, and if not they simply don't show up. I make a HUD radar for sale, and one time was talking to a Linden and had them show up on my radar, then he seemed to do something in the menu and suddenly wasn't on the radar anymore :)

As for the NULL_KEY thing, make sure you're not checking past the total_number variable, and as Newgate said you're not removing a SensorRepeat during the checks. Can you post your code, or snippets, to help track it down if you can't figure it out?
_____________________