Jump to content

Mapping out sensor type filters and their resulting llDetectedType


Fenix Eldritch
 Share

You are about to reply to a thread that has been inactive for 485 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

What started out as a sanity check snowballed into something much, much more involved. I got massively sidetracked revisiting how the llSensor type filters work together. I went and did a bunch of tests to map out as many possibilities as I could think of to see how things behave. After all that effort, I might as well share what I saw. I'll put a tl:dr chart at the very end too...

The setup: I created a number of cubes all with the name "TEST1". I then configured them with varying permutations of scripts (active, idle, stopped, unscripted), physics status (enabled, disabled), and KFM status (playing, paused). I also set each one to have a summary of this status in their description and hovertext. For the physics enabled prims I set their gravity=0.1 and restitution=0.0. This was mainly done to make doing drop tests easier (slowed falling and almost no bounce).

Here's the list of the cubes and their configurations: (by pure chance, the total came to 16)

  • KFM, active-script (playng)
  • KFM, active-script (paused)
  • KFM, idle-script (playng)
  • KFM, idle-script (paused)
  • KFM, stopped-script (playng)
  • KFM, stopped-script (paused)
  • KFM, unscripted (playng)
  • KFM, unscripted (paused)
  • nonphys, active-script
  • nonphys, idle-script
  • nonphys, stopped-script
  • nonphys, unscripted
  • phys, active-script
  • phys, idle-script
  • phys, stopped-script
  • phys, unscripted

Recall that an "active" script is one which is running and currently processing something, or otherwise using simulator resources. Having an open llListen (even without the associated listen event) is enough to flag the script as active. Meanwhile an "idle" script is one which is running but not currently executing anything. The default "Hello Avatar" script would qualify as an idle script (so long as it's not being poked at this moment in time). From the sensor's perspective, it considers anything with an active script, or anything currently in physical motion to be of the "ACTIVE" type. Similarly, things that are nonphysical with an idle/stopped/absent script, or a physical object with an idle/stopped/absent script that is not currently in motion is considered to be of the "PASSIVE" type.

Getting the KFMs without a running script to pause was annoying: deselecting the object will automatically "resume" the KFM even if it was paused prior. So I rigged up a script to start the KFM and then when touched, it would pause the KFM and then either delete the script or set the state to not running.

Here is the sensor script I used for the test. I would modify the "type" variable between each scan. I would also perform each scan twice, the first time with the physical objects at rest, and then a second time with the physical objects slowly falling.

list types = ["?", "AGENT", "ACTIVE", "ACTIVE|AGENT", "PASSIVE", "PASSIVE|AGENT", "PASSIVE|ACTIVE", "PASSIVE|ACTIVE|AGENT", "SCRIPTED", "SCRIPTED|AGENT", "SCRIPTED|ACTIVE", "SCRIPTED|ACTIVE|AGENT", "SCRIPTED|PASSIVE", "SCRIPTED|PASSIVE|AGENT", "SCRIPTED|PASSIVE|ACTIVE", "SCRIPTED|PASSIVE|ACTIVE|AGENT", "AGENT_BY_USERNAME"];

integer type;

default
{
    touch_start(integer total_number)
    {
        type = SCRIPTED;
        
        llSensor("TEST1", "",type, 5.0, PI);
    }
     
    sensor(integer i)
     {
        llOwnerSay("Scanning for type ["+llList2String(types,type)+"]...");
     
        while(~--i)
        {
            llOwnerSay((string)i+" : llDT: "+(string)llDetectedType(i)+" ["
                +llList2String(types,llDetectedType(i))+"]"
                +" '"+(string)llGetObjectDetails(llDetectedKey(i),[OBJECT_DESC])+"'");
        }
     }
      
     no_sensor()
     {
         llOwnerSay("nada.");
     }
}

 

Finally, here are my findings. I've formatted the output a little to look nicer. "llDT" is the value reported by llDetectedType in the sensor event, along with an easier to read label of which flags it represents. I've also added some comments to the far right to help clarify the results - especially in the cases of the physical and KFM objects

Scanning for type [ACTIVE]...
llDT: 10 [SCRIPTED|ACTIVE]  'KFM, active-script (playng)'
llDT: 10 [SCRIPTED|PASSIVE] 'KFM, active-script (paused)'
llDT: 10 [SCRIPTED|ACTIVE]  'KFM, stopped-script (playng)'  (only detects if KFM is playing)
llDT:  2 [ACTIVE]           'KFM, unscripted (playing)'     (only detects if KFM is playing)
llDT: 10 [SCRIPTED|ACTIVE]  'KFM, idle-script (playng)'     (only detects if KFM is playing)
llDT: 12 [SCRIPTED|PASSIVE] 'nonphys, active-script'
llDT: 10 [SCRIPTED|ACTIVE]  'phys, active-script'
llDT: 10 [SCRIPTED|ACTIVE]  'phys, stopped-script'          (only detects when moving)
llDT: 10 [SCRIPTED|ACTIVE]  'phys, idle-script'             (only detects when moving)
llDT:  2 [ACTIVE]           'phys, unscripted'              (only detects when moving)

Scanning for type [PASSIVE]...
llDT:  2 [PASSIVE]          'KFM, unscripted (paused)'      (only detects if KFM is paused)
llDT: 12 [SCRIPTED|PASSIVE] 'KFM, idle-script (paused)'     (only detects if KFM is paused)
llDT: 12 [SCRIPTED|PASSIVE] 'KFM, stopped-script (paused)'  (only detects if KFM is paused)
llDT: 12 [SCRIPTED|PASSIVE] 'nonphys, stopped-script'
llDT:  4 [PASSIVE]          'nonphys, unscripted'
llDT: 12 [SCRIPTED|PASSIVE] 'nonphys, idle-script'
llDT: 10 [SCRIPTED|ACTIVE]  'phys, stopped-script'          (only detects when NOT moving)
llDT: 10 [SCRIPTED|ACTIVE]  'phys, idle-script'             (only detects when NOT moving)
llDT:  2 [ACTIVE]           'phys, unscripted'              (only detects when NOT moving)

Scanning for type [PASSIVE|ACTIVE]...
All 16 test objects detected

Scanning for type [SCRIPTED]...
llDT: 10 [SCRIPTED|ACTIVE]  'KFM, active-script (playng)'
llDT: 10 [SCRIPTED|PASSIVE] 'KFM, active-script (paused)'
llDT: 10 [SCRIPTED|ACTIVE]  'KFM, stopped-script (playng)'  (only detects if KFM is playing)
llDT: 10 [SCRIPTED|ACTIVE]  'KFM, idle-script (playng)'     (only detects if KFM is playing)
llDT: 10 [SCRIPTED|ACTIVE]  'phys, active-script'
llDT: 12 [SCRIPTED|PASSIVE] 'nonphys, active-script'
llDT: 10 [SCRIPTED|ACTIVE]  'phys, stopped-script'          (only detects when moving)
llDT: 10 [SCRIPTED|ACTIVE]  'phys, idle-script'             (only detects when moving)

Scanning for type [SCRIPTED|ACTIVE]...
Same as [SCRIPTED]

Scanning for type [SCRIPTED|PASSIVE]...
llDT: 10 [SCRIPTED|ACTIVE]  'KFM, active-script (playng)'
llDT: 10 [SCRIPTED|PASSIVE] 'KFM, active-script (paused)'
llDT: 10 [SCRIPTED|ACTIVE]  'KFM, idle-script (playng)'
llDT: 10 [SCRIPTED|PASSIVE] 'KFM, idle-script (paused)'
llDT: 10 [SCRIPTED|ACTIVE]  'KFM, stopped-script (playng)'
llDT: 10 [SCRIPTED|PASSIVE] 'KFM, stopped-script (paused)'
llDT: 10 [SCRIPTED|ACTIVE]  'phys, stopped-script'
llDT: 10 [SCRIPTED|ACTIVE]  'phys, idle-script'
llDT: 10 [SCRIPTED|ACTIVE]  'phys, active-script'
llDT: 12 [SCRIPTED|PASSIVE] 'nonphys, idle-script'
llDT: 12 [SCRIPTED|PASSIVE] 'nonphys, stopped-script'
llDT: 12 [SCRIPTED|PASSIVE] 'nonphys, active-script'

Scanning for type [SCRIPTED|PASSIVE|ACTIVE]...
Same as [SCRIPTED|PASSIVE]

 

ACTIVE, PASSIVE, and the various AGENT types are said to be inclusive, while SCRIPTED is not. So it behaves a little differently when combining with other type flags. From the above results, a quick summary would be:

SCRIPTED Detects objects with active scripts.
Stopped/idle scripts can only be detected in running KFM or physically moving objects.
SCRIPTED|AGENT Same as SCRIPTED, meaning no agents will ever be detected.
SCRIPTED|ACTIVE Same as SCRIPTED.
SCRIPTED|PASSIVE Detects objects with scripts in any state (active/idle/stopped).
SCRIPTED|ACTIVE|PASSIVE Same as SCRIPTED|PASSIVE.

 

As for the AGENT, it will always be detected when combined with the other types - with SCRIPTED being the only exception as mentioned above.  The detected type of an agent will change depending on whether it's standing or sitting, and on what it's sat upon. Basically, an agent will be reported as ACTIVE|AGENT if it's standing, ground sitting, or sitting on a physics-enabled object. For everything else, it's reported as PASSIVE|AGENT. And for completeness sake, here's the full list:

Agent sitting on... llDetectedType reports...
nothing (standing/flying) ACTIVE|AGENT
ground (ALT+SHIFT+S) ACTIVE|AGENT
KFM, active-script (playng) PASSIVE|AGENT
KFM, active-script (paused) PASSIVE|AGENT
KFM, idle-script (playng) PASSIVE|AGENT
KFM, idle-script (paused) PASSIVE|AGENT
KFM, stopped-script (playng) PASSIVE|AGENT
KFM, stopped-script (paused) PASSIVE|AGENT
KFM, unscripted (playng) PASSIVE|AGENT
KFM, unscripted (paused) PASSIVE|AGENT
nonphys, active-script PASSIVE|AGENT
nonphys, idle-script PASSIVE|AGENT
nonphys, stopped-script PASSIVE|AGENT
nonphys, unscripted PASSIVE|AGENT
phys, active-script ACTIVE|AGENT
phys, idle-script ACTIVE|AGENT
phys, stopped-script ACTIVE|AGENT
phys, unscripted ACTIVE|AGENT

 

Too long, didn't read: The table below summarizes what you can expect to detect when using various combos of the sensor "type" filters. Note that the "type" you scan for when setting llSensor or llSensorRepeat is not necessarily the same as what llDetectedType will report (see the results sections above for that).

Target to be scanned AGENT ACTIVE PASSIVE ACTIVE|PASSIVE SCRIPTED
& SCRIPTED|ACTIVE
SCRIPTED|PASSIVE
& SCRIPTED|ACTIVE|PASSIVE
Agent* yes no no no no no
KFM, active-script (playng) no yes no yes yes yes
KFM, active-script (paused) no yes no yes yes yes
KFM, idle-script (playng) no yes no yes yes yes
KFM, idle-script (paused) no no yes yes no yes
KFM, stopped-script (playng) no yes no yes yes yes
KFM, stopped-script (paused) no no yes yes no yes
KFM, unscripted (playng) no yes no yes no no
KFM, unscripted (paused) no no yes yes no no
nonphys, active-script no yes no yes yes yes
nonphys, idle-script no no yes yes no yes
nonphys, stopped-script no no yes yes no yes
nonphys, unscripted no no yes yes no no
phys, active-script (at rest) no yes no yes yes yes
phys, idle-script (at rest) no no yes yes no yes
phys, stopped-script (at rest) no no yes yes no yes
phys, unscripted (at rest) no no yes yes no no
phys, active-script (in motion) no yes no yes yes yes
phys, idle-script (in motion) no yes no yes yes yes
phys, stopped-script (in motion) no yes no yes yes yes
phys, unscripted (in motion) no yes no yes no no

*Other AGENT combos omitted for brevity. The short answer is you can safely combine it with PASSIVE and ACTIVE without issue. But combining with SCRIPTED will result in agents not being detected.

  • Like 1
  • Thanks 3
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 485 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...