Jump to content

llDetectedType is broken or incredibly misleading


Tactical UwU
 Share

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

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

Recommended Posts

For reference, http://wiki.secondlife.com/wiki/LlDetectedType
 

SCRIPTED

Previously, returned all objects containing a running script.

Currently, is not returned if the script is not actively processing an event or has an active timer/loop.

 

ACTIVE

Previously, turned objects that had "Physical" enabled in build.
Currently, returns objects with a running script, including NON-PHYSICAL. It also EXCLUDES physical objects that lack a script or is otherwise not moving.

PASSIVE

Previously, returned all objects that were not physics enabled, regardless of if they were scripted or not.

Currently, returns non-moving physical objects or objects with idle scripting.

----
Started noticing this about 2 months ago, and it has made Sensor events incredibly unoptimized as a result as we can no longer filter returns as thoroughly which means more time and code is dedicated to checking each return - draining more region performance from an event that in and of itself can be rather region intensive.
I have been unable to find any information as to if this was done deliberately or not, nor have I found any up to date information covering details of how these changes affect sensor, touch, and collision events.

In addition to the issue mentioned above, combinations like (PASSIVE|SCRIPTED) [12] can inherit combinations like (ACTIVE|SCRIPTED) [10]. This behavior is frustrating to work with and its beginning to make llDetectedType virtually worthless.

Link to comment
Share on other sites

5 hours ago, Secondary Lionheart said:

For reference, http://wiki.secondlife.com/wiki/LlDetectedType
 

SCRIPTED

Previously, returned all objects containing a running script.

Currently, is not returned if the script is not actively processing an event or has an active timer/loop.

It s wrong : lldetectedtype returns all objects containing a script  with the mask-bit SCRIPTED  set to TRUE

Notice  this script can contain anything ( no listener , no loops etc ..)

In addition , even if the script is flagged as not-running ,  lldetectedtype will return with the mask SCRIPTED

 

My opinion , is that you use llSensor to detect some objects  , and you guess that the parameter used by  llSensor/llSensorRepeat  should be the same . 

In fact it s wrong 

 

For instance , you have an object non-physical  who contains the basic defult script ( "hello avatar " script )

You have a second object who use llSensor to detect the first object 

a)  you use 

 llSensorRepeat("", NULL_KEY, SCRIPTED, SCAN_RANGE, PI, SCAN_INTERVAL); // SCRIPTED = 8

=> no_sensor event will be triggered

b) you use

 llSensorRepeat("", NULL_KEY, PASSIVE, SCAN_RANGE, PI, SCAN_INTERVAL) ; // ACTIVE = 4

=> sensor event will be triggered .

If you print the value from llDetectedType , it will return12 = 4 + 8 = PASSIVE | SCRIPTED

 

Even if your object ,  contains script flagged not-running , llDetectedType will return with the mask SCRIPTED  . An object who contains scripts who don t run , will have a value from llDetectecdtpe with the bit  SCRIPTED of the the bitmask set to true

 

 

In the wiki , http://wiki.secondlife.com/wiki/Lldetectedtype "Objects that has any script, which is doing anything in simulator just now" is a false sentence .

In fact , this sentence is correct  to use with llSensor , but not with llDetectedType . llSensor with the value 8 ( SCRIPTED )  as parameter don t return all objects who contain some scripts but only some objects who contain some specific scripts ( running , and active ). llDetectedtype value doesn t change . If you prefer , llDetectedtype returns as OUTPUT the bit SCRIPTED at TRUE for any object who contains some scripts in their content ( even nont -running , even not active ) , while llsensor with the bit SCRIPTED as INPUT don t filter all the  objects scripted but nly a subset from this

It s probably because , this sentence is inside "wiki template" array , , and it has caused confusion between the two pages llSensor and llDetectedtype , when the array / table has merged . It s a bit ugly to use the same terminology and causes mess and confusion

 

Try to detect with a collision , and not by a sensor ,  if you are not sure

Edited by Miranda Umino
  • Thanks 1
Link to comment
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...