Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Is llSensor really limited to 16 objects?

Jeffronius Batra
Registered User
Join date: 27 Apr 2006
Posts: 18
02-03-2007 20:59
I'm trying to use llSensor to scan an area for some objects, with the goal of updating the scripts in the objects.

Even in an area dense with objects, it seems that it will detect at most 16 objects of a given type.

Is this a known limitation?

I'm not doing anything fancy yet; here's my code:

touch_start(integer total_number)
{
// Look all around for active objects
llSay(0, "Scanning for active objects...";);
llSensor("", NULL_KEY, ACTIVE, 90, PI);

// Look all around for passive objects
llSay(0, "Scanning for passive objects...";);
llSensor("", NULL_KEY, SCRIPTED, 90, PI);

// Look all around for scripted objects
llSay(0, "Scanning for scripted objects...";);
llSensor("", NULL_KEY, PASSIVE, 90, PI);
}

If this is a true limitation, does anyone have any ideas for a better way to update scripts in lots of objects? I don't want to have thousands of objects listening (due to efficiency concerns).
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
02-03-2007 23:14
Yep. Sensor only returns the first 16 closest objects.

If the script update caused the objects names to change, maybe you could scan by name ("yadda yadda version 1.2" or whatever) and keep scanning/updating until you get a no_sensor event. If the objects to be updated are scattered around, maybe have the updater move through a search grid..
Travis Lambert
White dog, red collar
Join date: 3 Jun 2004
Posts: 2,819
02-03-2007 23:21
Sadly, llSensor() can indeed only return data on 16 agents or objects.

You can sometimes get around this by using multiple sensors (note that each sensor must reside in its own prim), by manipulating the arc. For detecting a bunch of objects densely packed in one area, however, you can try llVolumeDetect().... otherwise you're probably SOL. :(

The reason for the restriction is because of all of the Detected(*) data that gets returned along with an llSensor() call. Keep in mind that its not just returning the key for each object/agent detected, but also its Group, Link Number, Name, Owner, Position, Rotation, Type, and Velocity.

Linden really, really needs to provide us some new Sensor-type functions that are optimized for specific uses, like detecting keys or names - that don't have this 16 object/name limitation.
_____________________
------------------
The Shelter

The Shelter is a non-profit recreation center for new residents, and supporters of new residents. Our goal is to provide a positive & supportive social environment for those looking for one in our overwhelming world.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
02-04-2007 02:24
Unfortunately llVolumeDetetc is limited to the same 16 objects as it uses the same return system.

What you need is a rotating sensor with a smaller arc.
Malachi Petunia
Gentle Miscreant
Join date: 21 Sep 2003
Posts: 3,414
02-04-2007 04:49
From: someone
Yep. Sensor only returns the first 16 closest objects.
The "closest" is only mostly true as you'll sometimes get non-moving objects which are not amongst the closest.

And rotating arcs is the only workaround, as Newgate said.
_____________________