Difference between revisions of "LlGetObjectDetails"

From Second Life Wiki
Jump to navigation Jump to search
(New page: {{LSL_Function/object|id|object|sim=*}} {{LSL_Function |func_id=332|func_sleep=0.0|func_energy=10.0 |func=llGetObjectDetails |p1_type=key|p1_name=id |p2_type=list|p2_name=params|p2_desc=OB...)
 
Line 1: Line 1:
{{LSL_Function/object|id|object|sim=*}}
{{LSL_Function/object|id|prim or avatar|sim=*}}
{{LSL_Function
{{LSL_Function
|func_id=332|func_sleep=0.0|func_energy=10.0
|func_id=332|func_sleep=0.0|func_energy=10.0
Line 5: Line 5:
|p1_type=key|p1_name=id
|p1_type=key|p1_name=id
|p2_type=list|p2_name=params|p2_desc=OBJECT_* flags
|p2_type=list|p2_name=params|p2_desc=OBJECT_* flags
|func_desc=Gets the object details specified in '''params''' for the object with key '''id'''.
|func_desc=Gets the details specified in '''params''' for the object with key '''id'''.
|func_footnote={{LSL Const|OBJECT_UNKNOWN_DETAIL|integer|-1|c=}} is returned when passed an invalid object parameter type.
|func_footnote={{LSL Const|OBJECT_UNKNOWN_DETAIL|integer|-1|c=}} is returned when passed an invalid integer parameter.
|caveats=*The result of calling this function on an object that does not exist or a non-root prim is undefined.
If '''id''' is not in the sim an empty list is returned.
|caveats=*Items in '''param''' that are not integers are silently ignored, {{LSL Const|OBJECT_UNKNOWN_DETAIL|integer|-1|c=}} is not returned.
|examples=
|examples=
<pre>
<pre>
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]));
        llSetText("Name: " + 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), <1.0, 1.0, 1.0>, 1.0);
    }
}
</pre>
</pre>
|spec
|spec
Line 25: Line 44:
{{!}}{{LSL Const|OBJECT_DESC|integer|2|c=Gets an object's description.}}
{{!}}{{LSL Const|OBJECT_DESC|integer|2|c=Gets an object's description.}}
{{!}}{{#var:value}}
{{!}}{{#var:value}}
{{!}}{{#var:comment}}
{{!}}{{#var:comment}} If '''id''' is an avatar, an empty string is returned.
{{!}}-
{{!}}-
{{!}}{{LSL Const|OBJECT_POS|integer|3|c=Gets an object's position.}}
{{!}}{{LSL Const|OBJECT_POS|integer|3|c=Gets an object's position.}}
Line 39: Line 58:
{{!}}{{#var:comment}}
{{!}}{{#var:comment}}
{{!}}-
{{!}}-
{{!}}{{LSL Const|OBJECT_OWNER|integer|6|c=Gets an object's owner's key. Will be NULL_KEY if group owned.}}
{{!}}{{LSL Const|OBJECT_OWNER|integer|6|c=Gets an object's owner's key.}}
{{!}}{{#var:value}}
{{!}}{{#var:value}}
{{!}}Gets an object's owner's key. Will be {{LSL Const|NULL_KEY|key|"00000000-0000-0000-0000-000000000000"|c=Evaluates to false in conditionals just like invalid keys.}} if group owned.
{{!}}Gets an object's owner's key. If '''id''' is group owned, a {{LSL Const|NULL_KEY|key|"00000000-0000-0000-0000-000000000000"|c=Evaluates to false in conditionals just like invalid keys.}} is returned.
{{!}}-
{{!}}-
{{!}}{{LSL Const|OBJECT_GROUP|integer|7|c=Gets an object's group's key.}}
{{!}}{{LSL Const|OBJECT_GROUP|integer|7|c=Gets an prims's group's key.}}
{{!}}{{#var:value}}
{{!}}{{#var:value}}
{{!}}{{#var:comment}}
{{!}}{{#var:comment}} If '''id''' is an avatar, a {{LSL Const|NULL_KEY|key|"00000000-0000-0000-0000-000000000000"|c=Evaluates to false in conditionals just like invalid keys.}} is returned.
{{!}}-
{{!}}-
{{!}}{{LSL Const|OBJECT_CREATOR|integer|8|c=Gets an object's creator's key.}}
{{!}}{{LSL Const|OBJECT_CREATOR|integer|8|c=Gets an object's creator's key.}}
{{!}}{{#var:value}}
{{!}}{{#var:value}}
{{!}}{{#var:comment}}
{{!}}{{#var:comment}} If '''id''' is an avatar, a {{LSL Const|NULL_KEY|key|"00000000-0000-0000-0000-000000000000"|c=Evaluates to false in conditionals just like invalid keys.}} is returned.
{{!}}}
{{!}}}
|helpers
|helpers
Line 57: Line 76:
|also_articles
|also_articles
|notes
|notes
|history=Introduced in version 1.18.3.2
|cat1=Object
|cat1=Object
|cat2
|cat2

Revision as of 19:02, 29 August 2007

Deletion Requested
The deletion of this article was requested for the following reason:

Template is no longer used and it's creator thinks it does not function properly.

If there is a need to discuss the deletion of this article, please add your comment(s) here.

Summary

Function: llGetObjectDetails( key id, list params );
0.0 Forced Delay
10.0 Energy

Gets the details specified in params for the object with key id.

• key id
• list params OBJECT_* flags

OBJECT_UNKNOWN_DETAIL is returned when passed an invalid integer parameter. If id is not in the sim an empty list is returned.

Constant Description
OBJECT_NAME 1 Gets an object's name.
OBJECT_DESC 2 Gets an object's description. If id is an avatar, an empty string is returned.
OBJECT_POS 3 Gets an object's position.
OBJECT_ROT 4 Gets an object's rotation.
OBJECT_VELOCITY 5 Gets an object's velocity.
OBJECT_OWNER 6 Gets an object's owner's key. If id is group owned, a NULL_KEY is returned.
OBJECT_GROUP 7 Gets an prims's group's key. If id is an avatar, a NULL_KEY is returned.
OBJECT_CREATOR 8 Gets an object's creator's key. If id is an avatar, a NULL_KEY is returned.

Caveats

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]));
        llSetText("Name: " + 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), <1.0, 1.0, 1.0>, 1.0);
    }
}

Deep Notes

History

Introduced in version 1.18.3.2

Signature

function void llGetObjectDetails( key id, list params );