Jump to content

Finding (and following) an Avatar from it's name and UUID ?


Frankie Rockett
 Share

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

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

Recommended Posts

Hi!

I am trying to adapt a script I have that makes a little 'drone' follow me around a region, such that it will go follow a different, chosen avatar, until I recall it.

The problem I have is with the script sensor. It currently uses llDetectedPos(0); to locate and keep track of me - the owner. I find other Avatars in the region via llGetAgentList(). Now, I'd say I am of intermediate skill level with LSL so forgive me if the answer is obvious to others; it seems that the sensor wants the index value in llDetectedPos() to keep track of a new target, and yet llGetAgentList() only returns Avatar name and UUID. How can I get from name and UUID to an index value that I can feed into the sensor via llDetectedPos(index_of_identified_avatar) and have the drone latch on to another avatar and track it's position thereafter??

Or is there another way of doing this that won't require a major rewrite?

Thank you for your thoughts!

Frankie.

Link to comment
Share on other sites

7 hours ago, Frankie Rockett said:

it seems that the sensor wants the index value in llDetectedPos() to keep track of a new target, and yet llGetAgentList() only returns Avatar name and UUID. How can I get from name and UUID to an index value that I can feed into the sensor via llDetectedPos(index_of_identified_avatar)

The llDetected* functions are special, the index only works in the context of a few specific events that are able to detect something.

For example, llSensor can detect up to 16 things (not just avatars), so the index will be in the 0-15 range (never higher), based on distance and the conditions of the previous llSensor call.

Meanwhile, multiple people can touch an object at the same time, usually only one person (index 0), up to as many people as there are in the sim. But they have to be actively touching the object and you can only detect them in touch/touch_start/touch_end.

All this means that there's no index you can use to track just any avatar you want, if they aren't related to the current event.

Edited by Wulfie Reanimator
  • Like 2
Link to comment
Share on other sites

To further clarify my response yesterday ....  If you are already using llGetAgentList to find out who is on the parcel or region, you have all their UUIDs, which you can easily turn into a list of names.  That will let you construct a simple dialog menu for choosing who you want the drone to follow next.  Pick a target from that menu.  Now, since you have the target's UUID, all you need to do is feed it to the llSensorRepeat function to tell the drone where the target is at any given time. Use Tessa's suggestion to find out where the target is right now.  Move the drone to that position, and then start the repeating sensor:

llSensorRepeat(" ", NewUUID, AGENT, 10.0, PI, 0.5);

  • Like 1
Link to comment
Share on other sites

Thank you all for your input, time and knowledge!

A special thank you by the way to Rolig; it's her menu script that I found in the SL script library and have adapted for use here. Thank you so much Rolig!!

I feel I didn't really understand the sensor function before, and now I do - better at least.  I decided to abandon the use of llGetAgentList() as it feels like I'd make things easier for myself to sticking with llDetectedPos() and enjoying the relative convenience of using it's index.

Moving past that issue for now, I have run into a fresh problem on this same project, but as it's not related to the original Subject title (above) I am thinking should I open a fresh forum question? Happy to do so, but otherwise it's simply this. How does one broadcast a channel command further than the 10 meters it seems to cover? Since the llDetectedPos() function could see the drone flying at least 96 meters away, it would be nice to be able to call it back without the indignity of... running after it! :)

Edited by Frankie Rockett
Link to comment
Share on other sites

llRegionSay  or (if you know the UUID of the target)  llRegionSayTo.   They will not cross region boundaries, but that's true of all llSay type functions.

Edit: Gaah! A brain dead moment.  Thank you, Tessa. 🥴

Edited by Rolig Loon
  • Like 2
Link to comment
Share on other sites

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