Jump to content

(UUID) AV vs Object


Mia Puddles
 Share

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

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

Recommended Posts

is there a way to know if its a AV or object talking. Working on a script that I need to send messages on to other commands based off its a av or object talking? Basically skipping commands on objects sending select commands being I have no reason to run more than one listener. 

Link to comment
Share on other sites

Avatar UUIDs (mostly) follow RFC-4122 for Version 4 UUIDs - so you can test if a given key is an avatar if the first character in the 3rd block is the number 4.

Example:

Quote

b8ddae03-525a-4993-97ff-c7a39d6a222b - Jenna Huntsman
36c12da3-3e75-ef54-d88f-23497832349c - Random in-world object
a4c8e920-db28-40a7-ab0d-6dc5c178b095 - Mia Puddles

There are some exceptions to this however (I believe older avatar UUIDs do not follow this pattern - pre 2006 (?)):

Quote

3d6181b0-6a4b-97ef-18d8-722652995cf1 - Governor Linden

Another way to test is to pass the key off to a function like llRequestUsername to see if a value is returned (key is an avatar); or if it times out (key is any other asset type).

Edited by Jenna Huntsman
Link to comment
Share on other sites

1 hour ago, Lucia Nightfire said:

I recommend llGetAgentSize() for agents and llGetOwnerKey() for objects if the source is in the same region.

I.E.

key thing = llDetectedKey(n); // for example.
if(llGetOwnerKey(thing)!=thing)
{ // is an object, and is in same region, (or the key was not a valid key)
  /*
  if(thing)
  { // gratuitous check that thing was actually a valid key, probably unneccessary.
  }else
  { // thing wasn't actually a key, probably a scripting error.
  } */
}else if(llGetAgentSize(thing))
{ // is an avatar, and is in the same region.
}else
{ // is not in the same region.
}

If I'm reading the caveats correctly, then

if(llList2Integer(llGetObjectDetails(thing,[OBJECT_BODY_SHAPE_TYPE]),0)==-1)
{ // (assuming a valid key) thing is an object and may or may not be in the current region.
  // or possibly an avatar shouting from over 34 feet on the other side of the region border.
}
// alternatively 
if(llList2Key(llGetObjectDetails(thing,[OBJECT_CREATOR]),0))
{ // (assuming a valid key) thing is an object and may or may not be in the current region.
  // or possibly an avatar shouting from over 34 feet on the other side of the region border.
}
Edited by Quistess Alpha
  • Like 1
Link to comment
Share on other sites

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