Jump to content

LlGetObjectDetails

From OSgrid Wiki

Function: list llGetObjectDetails( key id, list params );

Returns a list of the details specified in params for the object with key id.
• key id – prim or avatar UUID that is in the same region
• list params – OBJECT_* flags

OBJECT_UNKNOWN_DETAIL is returned when passed an invalid integer parameter.

Flags Description Max Length Return Alternatives
OBJECT_NAME 1 Gets the prim's name. 63 Characters string • llKey2Name
• llDetectedName
OBJECT_DESC 2 Gets the prim's description.
If id is an avatar, an empty string is returned.
127 Characters string
OBJECT_POS 3 Gets the prim's position in region_coordinates region coordinates. (36 Characters) vector • llDetectedPos
OBJECT_ROT 4 Gets the prim's rotation. (48 Characters) rotation • llDetectedRot
OBJECT_VELOCITY 5 Gets the object's velocity. (36 Characters) vector • llDetectedVel
OBJECT_OWNER 6 Gets an object's owner key.

If id is an avatar, that avatar's key is returned (which is the same as id).
If id is group-owned, a NULL_KEY is returned.
(36 Characters) key • llDetectedOwner
• llGetOwnerKey
OBJECT_GROUP 7 Gets the prims's group key.
If id is an avatar, a NULL_KEY is returned.
(36 Characters) key group
OBJECT_CREATOR 8 Gets the prims's creator key.
If id is an avatar, a NULL_KEY is returned.
(36 Characters) key creator


Caveats
• Items in params that are not integers are silently ignored, OBJECT_UNKNOWN_DETAIL is not returned.
• If an object represented by id is not in the sim an empty list is returned.
• An empty list is also returned if the key given was an item in inventory (object or agent).
• If id represents an agent, this function will continue to return information for approximately 45 seconds after they have left the sim (but the information is not updated).
• llTargetOmega will only effect the return of OBJECT_ROT if the object is physical. If the object is not physical then the original start rotation is returned, llTargetOmega is a client side effect.

Examples

<source lang="lsl">

default {

   collision_start(integer i)
   {
       list a = llGetObjectDetails(llDetectedKey(0), ([OBJECT_NAME, 
                   OBJECT_DESC, OBJECT_POS, OBJECT_ROT, OBJECT_VELOCITY,
                   OBJECT_OWNER, OBJECT_GROUP, OBJECT_CREATOR]));
       llWhisper(0,"UUID: "         + (string)llDetectedKey(0) +
                 "\nName: \""       + llList2String(a,0) + "\"" +
                 "\nDecription: \"" + llList2String(a,1) + "\"" +
                 "\nPosition: "     + llList2String(a,2) +
                 "\nRotation: "     + llList2String(a,3) +
                 "\nVelocity: "     + llList2String(a,4) +
                 "\nOwner: "        + llList2String(a,5) +
                 "\nGroup: "        + llList2String(a,6) +
                 "\nCreator: "      + llList2String(a,7));
   }

} </source>


Useful Snippets
See Link/Get for some link related helper functions. Since there is no function to get linked prim parameters, this can be useful if you need to get the position and rotation of a linked prim.
See Also
Functions
• llKey2Name
• llGetPrimitiveParams
• llSetLinkPrimitiveParams
• llSetPrimitiveParams
• llGetParcelDetails
Deep Notes
History
Introduced in SL 1.18.3(2)