Sensor calls failing to report objects consistently
needs info
Dread Hudson
Since this last server release sensor calls for objects are behaving inconsistently, can break numerous scripted systems. This issue appears to have been introduced in the most recent server rollout.
Sensor calls for SCRIPTED and PASSIVE have had their behaviour change or are failing to register objects, with no apparent consistency. One object doing a sensor call will report objects properly, another of the same object an arbitrary distance away will fail to pick up the same objects when they are moved into range.
Rez a cube, put this script in it, make multiple. Drag a scripted object or use a scripted vehicle and move into range of the various sensor boxes. Results are very inconsistent.
In one instance, a cube located at <114.43994, 61.48804, 151.37827> reported results correctly, only to then fail when moved to <114.43994, 62.48804, 151.37827>, just a single meter of difference.
"integer step=0;
default
{
state_entry()
{
llLinkParticleSystem(-1,[]);
}
touch_start(integer n)
{
if(llDetectedKey(0)==llGetOwner())
{
step=0;
llOwnerSay("Calling at "+(string)llGetPos());
llSensor("","",AGENT,14,TWO_PI);
}
}
sensor(integer n)
{
llOwnerSay("Sensor step "+(string)step);
key tgt;
while(n--)
{
if(llDetectedType(n)&0x1)
{
llOwnerSay("avatar "+llDetectedName(n));
}
else
{
llOwnerSay("object "+llDetectedName(n));
}
}
if(step==0)llSensor("","",SCRIPTED,14,TWO_PI);
if(step==1)llSensor("","",PASSIVE,14,TWO_PI);
if(step==2)
{
llSleep(1);
//llDie();
}
++step;
}
no_sensor()
{
llOwnerSay("No_sensor step "+(string)step);
if(step==0)llSensor("","",SCRIPTED,14,TWO_PI);
if(step==1)llSensor("","",PASSIVE,14,TWO_PI);
if(step==2)
{
llSleep(1);
//llDie();
}
++step;
}
}"
"[11:49:01] Object detector click 1: Calling at <114.43994, 61.00000, 151.37827>
[11:49:02] Object detector click 1: Sensor step 0
[11:49:02] Object detector click 1: avatar Dread Hudson
[11:49:02] Object detector click 1: Sensor step 1
[11:49:02] Object detector click 1: object [Chaos] Hellblade Base
[11:49:02] Object detector click 1: No_sensor step 2
[11:49:06] Object detector click 1: Calling at <114.43994, 62.00000, 151.37827>
[11:49:06] Object detector click 1: Sensor step 0
[11:49:06] Object detector click 1: avatar Dread Hudson
[11:49:06] Object detector click 1: No_sensor step 1
[11:49:06] Object detector click 1: No_sensor step 2"
Log In
Maestro Linden
marked this post as
needs info
Maestro Linden
I cleaned up the test script to have clean indentation, and added output so that it actually tells you about the llSensor() calls:
integer step=0;
default
{
state_entry()
{
llLinkParticleSystem(-1,[]);
}
touch_start(integer n)
{
if(llDetectedKey(0)==llGetOwner())
{
step=0;
llOwnerSay("Calling llSensor(\"\",\"\",AGENT,14,TWO_PI) at "+(string)llGetPos());
llSensor("","",AGENT,14,TWO_PI);
}
}
sensor(integer n)
{
llOwnerSay("Sensor step "+(string)step);
key tgt;
while(n--)
{
if(llDetectedType(n)&0x1)
{
llOwnerSay("sensor#" + (string)n + ": Detected avatar " + llDetectedName(n));
}
else
{
llOwnerSay("sensor#" + (string)n + ": Detected non-avatar " + llDetectedName(n));
}
}
if(step==0)
{
llOwnerSay("Calling llSensor(\"\",\"\",SCRIPTED,14,TWO_PI) at "+(string)llGetPos());
llSensor("","",SCRIPTED,14,TWO_PI);
}
if(step==1)
{
llOwnerSay("Calling llSensor(\"\",\"\",PASSIVE,14,TWO_PI) at "+(string)llGetPos());
llSensor("","",PASSIVE,14,TWO_PI);
}
if(step==2)
{
llOwnerSay("Calling llSleep(1) at "+(string)llGetPos());
llSleep(1);
}
++step;
}
no_sensor()
{
llOwnerSay("no_sensor() triggered step "+(string)step);
if(step==0)
{
llOwnerSay("Calling llSensor(\"\",\"\",SCRIPTED,14,TWO_PI) at "+(string)llGetPos());
llSensor("","",SCRIPTED,14,TWO_PI);
}
if(step==1)
{
llOwnerSay("Calling llSensor(\"\",\"\",PASSIVE,14,TWO_PI) at "+(string)llGetPos());
llSensor("","",PASSIVE,14,TWO_PI);
}
if(step==2)
{
llOwnerSay("Calling llSleep(1) at "+(string)llGetPos());
llSleep(1);
}
++step;
}
}
// basic active scripted object
default
{
state_entry()
{
llSetObjectName("active scripted object");
llSetTimerEvent(1);
}
timer()
{
llSetText(llGetTimestamp(), <1,1,1>, 1);
}
}
Maestro Linden
With 4 copies of that object (named "llSensor test "[1-4]) rezzed near my own avatar and an "active scripted object" (script source below), I'm seeing the following behavior:
- The llSensor() call filtering on AGENT always sees my avatar
- The llSensor() call filtering on SCRIPTED always sees "active scripted object", and any "llSensor test "[1-4] object that has executed recently
- The llSensor() call filtering on PASSIVE sees the remaining "llSensor test "[1-4] objects that were not picked up by the SCRIPTED filter. The objects discovered in this pass have notexecuted recently
Looking at the definitions of
type
in https://wiki.secondlife.com/wiki/LlSensor - AGENT: "Agents. This is also used to find agents by legacy name, and is functionally identical to AGENT_BY_LEGACY_NAME"
- PASSIVE: "Non-physical objects. Non-scripted or script is inactive and non-physical or, if physical, not moving. Thus, it is not using SL server resources now."
- SCRIPTED: "Objects containing any active script. Objects that has any script, which is doing anything in simulator just now."
The labels are a bit confusing, since SCRIPTED actually means the object must have an
active
script, but I think the results I'm seeing match the spec in the wiki:- My agent is always detected by the llSensor() call filtering on AGENT
- The test object that constantly updates itself is always detected by the llSensor() call filtering on SCRIPTED
- The "llSensor test "[1-4] objects are eitherpicked up by llSensor() call filtering on SCRIPTEDorthe llSensor() call filtering on PASSIVE. The objects which were touched within the past few seconds are detected up by the SCRIPTED filter, and the ones that have been idle recently are detected as PASSIVE. This happens because the scripts move between the active and passive categories based on their recent activity.
Now, if you're interested in detecting non-physical scripted objects whose scripts are either active or not, you'll have to filter by
SCRIPTED|PASSIVE
. That filter will also pick up non-physical objects that have 0 scripts, so you may want to use llGetObjectDetails to check OBJECT_TOTAL_SCRIPT_COUNT of a given result if you want to skip over unscripted objects.Dread Hudson If you're seeing results outside of what https://wiki.secondlife.com/wiki/LlSensor describes, can you elaborate on those specifics?
Soap Frenzy
This issue is present across multiple server versions. Confirmed on
RC Magnum 2026-05-27.26527189617
RC BlueSteel 2026-05-27.26527189617
RC LeTigre 2026-05-27.26527189617
It seems like its related to sensor range and is inconsistent because you can rez something and not detect it, then delete and re-rez it and it will detect that instance of the object
Dread Hudson
From testing the inconsistencies are mainly consistent when trying to detect an object with a seated avatar on it, whilst picking up all the other scripted objects around it.