User:cerise Sorbet/Menu cross reference

From Second Life Wiki
Jump to navigation Jump to search

Summary

Function: string llKey2Name( key id );
0.0 Forced Delay
10.0 Energy

Returns a string that is the legacy name of the prim or avatar specified by id.

• key id group, avatar or prim UUID that is in the same region

Caveats

  • It is difficult to tell the difference between a prim that has a name that is an empty string and a prim that is not in the sim, or because an invalid key was specified. Use llGetObjectDetails to avoid this problem.
  • To get around the "avatar must be present" limitation, you can use the llRequestAgentData function and the dataserver event to obtain the avatar's name from a key.
  • There is no opposite function (llName2Key) available. However, there are third-party websites which can be queried using the llHTTPRequest function and the http_response event.
  • If an avatar is "ghosted" (which occasionally happens due to a longstanding server bug), an empty string is returned even though the avatar is seemingly present and shows up in llSensor and the Mini-Map. This fact can be used as the basis of a Ghost Detector script.

Examples

<lsl>// Best viewed in Chat History (ctrl-h) default {

   collision_start(integer a)//Announce who collided
   {
       llSay(0, "llKey2Name: " + llKey2Name(llDetectedKey(0)) +
              "\nllDetectedName: " + llDetectedName(0));
   }
   touch_start(integer a)
   {
       llSay(0,"llKey2Name: " + llKey2Name(llDetectedKey(0)) +
              "\nllDetectedName: " + llDetectedName(0));
   }
}</lsl>

Notes

Active Name2Key Databases:

Dead Name2Key Databases:

Name2Key Libraries:

See Also

Functions

•  llGetUsername
•  llGetDisplayName
•  llGetObjectDetails
•  llRequestAgentData Uses the dataserver to request avatar information

Articles

•  Prim Attribute Overloading

Deep Notes

Signature

function string llKey2Name( key id );