Jump to content

[Solved] How to sense more than 16 avatars


Vladan Highwater
 Share

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

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

Recommended Posts

After calling llSensor, the sensor event returns only the 16 closest avatars. How can I detect more than 16 avatars with one prim?

An idea would be sensing 16 in front of me, and 16 behind me and so on. But sensing behind me I couldn't do, I've tried putting negative range, or negative arc but nothing. Rotating the prim wouldn't work either I think, because I want to use it as a HUD.

I've tried searching the forum but didn't find anything.

Link to comment
Share on other sites

Thanks, I've read the wiki page abou tllSensor already.

llGetAgentList would be good, but I would like to get only avatars nearby, say 20 or 30 meters range. Getting all avatars in the sim and checking their distance would be slower and would waste script memory as well. (And more work for me.)

Link to comment
Share on other sites

There are several ways to sense more than 16 avatars, but they won't work in a HUD.  Basically, you need to either rotate the scanner in place or send it out as a scanning drone, to cover overlapping areas.  Even making a multi-prim scanner won't work in a HUD, since all sensors will look in the direction that you are facing. If you need to keep your script in a HUD, using llGetAgentList is probably your best bet.  I know it seems wasteful, but unless you have a gigantic number of avatars in the sim it shouldn't take long (or a lot of script memory) to filter the list.  If you're only interested in people within 20 m, you may be able to scan only for avatars in the parcel, too, instead of the whole sim.

Link to comment
Share on other sites

It may seem messy but in my testing calling llGetAgentList and then filtering on distance  was just as efficient on script time as doing a sensor scan at a specific distance.  In my testing each method was slightly (very slightly) faster than the other 50% time.  Number of avatars in the region did not seem to change that percentage either.   There were several very plausible likely reasons presented for that in the thread about it, but bottom line, llGetAgentList seems to be the better choice for agent scanning now.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4377 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...