lsl best / fastest / least lag inducing way to determine if a given UUID is an avatar or anything else?

Lance Corrimal

New member
Joined
Sep 21, 2018
Messages
24
Hi gang,

lets say i have a UUID. I know the UUID is either an avatar or something else, and it's with a certain distance because it's been the result of a LLCastRay, and in the llCastRay I'm rejecting land, physical objects and nonphysical objects, but still sometimes a llGetUsername() comes back as "".... Why could that be? Is there anything else I'd better reject in llCastRay(), or is that basically "data lag"...?

Related, what's the fastest and least laggy way to determine if any given UUID is actually an avatar? When I can safely assume that the object/avatar is within a certain range (see above)? I'm thinking that (llGetObjectDetails(target,OBJECT_ATTACHED_SLOTS_AVAILABLE) >0) should do it?

Cheers
LC

edit: partial answer, if(llGetAgentSize(target==ZERO_VECTOR) needs less list processing but the agent has to be in the same regions - does llCastRay work across sim borders?
 
Last edited:

Soen Eber

Vatican mole
VVO Supporter 🍦🎈👾❤
Joined
Sep 20, 2018
Messages
451
If I remember right avatars have bounding boxes. Check various avatar and uuid functions in the lsl portal, it's mentioned there. Also, Builders Brewery chat usually has some pretty sharp regulars on scripting.
 

Innula Zenovka

Nasty Brit
VVO Supporter 🍦🎈👾❤
Joined
Sep 20, 2018
Messages
3,171
SLU Posts
18459
Hi gang,

lets say i have a UUID. I know the UUID is either an avatar or something else, and it's with a certain distance because it's been the result of a LLCastRay, and in the llCastRay I'm rejecting land, physical objects and nonphysical objects, but still sometimes a llGetUsername() comes back as "".... Why could that be? Is there anything else I'd better reject in llCastRay(), or is that basically "data lag"...?

Related, what's the fastest and least laggy way to determine if any given UUID is actually an avatar? When I can safely assume that the object/avatar is within a certain range (see above)? I'm thinking that (llGetObjectDetails(target,OBJECT_ATTACHED_SLOTS_AVAILABLE) >0) should do it?

Cheers
LC

edit: partial answer, if(llGetAgentSize(target==ZERO_VECTOR) needs less list processing but the agent has to be in the same regions - does llCastRay work across sim borders?
If the uuid is that of someone/something on the same region, then
Code:
if(llGetAgentSize(id) !=ZERO_VECTOR) {
    //then it's an avatar
}
is a good test.

Could the avs whose usernames you're not able to read be on a different region?

Alternatively, using llRequestDisplayName(id) should tell you what you need, no matter where the av is, but do please be aware of the caveats and give some thought to error handling if the dataserver doesn't reply in a timely manner.
 

Grandma Bates

Only mostly banned....
Joined
Sep 20, 2018
Messages
110
Location
Airport
Joined SLU
Yes
SLU Posts
-1000
I check to see if the owner of the UUID is the UUID.

Code:
if(llGetOwnerKey(id)==id)
    {
           // do terrible things here.
    }
The only side effect is that if the key is for a prim and the prim is not in the region then llGetOwnerKey returns the argument. Usually, in the context I use this, it is not an issue, but you have to be careful.

LlGetOwnerKey - Second Life Wiki
 

Innula Zenovka

Nasty Brit
VVO Supporter 🍦🎈👾❤
Joined
Sep 20, 2018
Messages
3,171
SLU Posts
18459
I suppose, too, you could build a list of agents on the region with LlGetAgentList - Second Life Wiki and then loop through the list of uuids detected by the raycast, discarding any that didn't also appear in the list returned by llGetAgentList.

If there's a good reason, though, actually to do it that way, it completely escapes me. I mention it only because it occurred to me as a possible method.
 
  • 1Like
Reactions: Grandma Bates