LlGetObjectDetails
From Second Life Wiki
| LSL Portal | | | Functions | | | Events | | | Types | | | Operators | | | Constants | | | Flow Control | | | Script Library | | | Tutorials |
Function: list llGetObjectDetails( key id, list params );
| 332 | Function ID |
| 0.0 | Delay |
| 10.0 | Energy |
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.
Constants
| Flags | Description | Max Length | Return | Alternatives | |
|---|---|---|---|---|---|
| OBJECT_NAME | 1 | Gets the object's name. | 63 Characters | string | |
| OBJECT_DESC | 2 | Gets the object's description. If id is an avatar, an empty string is returned. | 127 Characters | string | |
| OBJECT_POS | 3 | Gets the object's position in region coordinates. | (36 Characters) | vector | |
| OBJECT_ROT | 4 | Gets the object's rotation. | (48 Characters) | rotation | |
| OBJECT_VELOCITY | 5 | Gets the object's velocity. | (36 Characters) | vector | |
| OBJECT_OWNER | 6 | Gets an object's owner's key. If id is group-owned or an avatar, a NULL_KEY is returned. | (36 Characters) | key | |
| 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 object's creator key. If id is an avatar, a NULL_KEY is returned. | (36 Characters) | key | Creator |
Max Lengths in parentheses represent how many characters required when it is typecast to a string.
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).
Examples
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)); } }

