Jump to content

Get number of agents in a parcel


KT Kingsley
 Share

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

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

Recommended Posts

Is there a clever way of getting the number of agents in a parcel, other than getting the list length returned by llGetAgentList (AGENT_LIST_PARCEL, []);? I want to do this in an existing script that's already using near the full memory capacity without causing a stack-heap collision.

 

Link to comment
Share on other sites

So you basically want to avoid the overhead of a potentially lengthy list returned by llGetAgentList... I suppose you could circumvent that by using a sensor event, since the num_detected parameter can be used as an index to all targets sensed within the sensor sweep. You would need to iterate over num_detected and for each one, pull out the uuid with llDetectedKey and perform some operations on that single user to determine if they're over your land. If the target is over your land, increment a counter.

As for how to determine if an individual avatar is over you land, one approach is to extract the target's position and check that position against llGetLandOwnerAt.

Edit: I forgot that sensors only return the first 16 hits, so this may not be the most robust solution...

Edited by Fenix Eldritch
  • Thanks 1
Link to comment
Share on other sites

In the days before llGetAgentList (really not that long ago) , we had to do rather clunky things with drones to gather the information.  I still have a couple of devices in my MP shop that use a drone to scamper around, making overlapping sensor sweeps to gather certain types of information that llGetAgentList cannot.  It's all rather cumbersome, but it works.  You have to make all sorts of allowances for eliminating redundant entries, avoiding no-script areas, watching out for obstacles, and a host of other hazards.  Still, for some applications a drone is a workable solution.

  • Like 1
Link to comment
Share on other sites

Thanks, everybody. It seems there isn't a clever trick that can be used for this, so brute force it is.

And, Rolig, I remember the time before llSetRegionPos and before llGetAgentList when those drones had to scamper around in ten metre steps and you had to check the conditions for each step if you wanted to be safe.

  • Like 1
Link to comment
Share on other sites

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