Difference between revisions of "LlGetObjectName"

From Second Life Wiki
Jump to navigation Jump to search
m (aded LSL Tip with reference to llList2String(llGetLinkPrimitiveParams(LINK_ROOT, [ PRIM_NAME ]), 0);)
m
Line 9: Line 9:
|spec
|spec
|caveats=*The prim name is limited to 63 bytes, any string longer than that will be truncated. This truncation does not always happen when the attribute is set or read.
|caveats=*The prim name is limited to 63 bytes, any string longer than that will be truncated. This truncation does not always happen when the attribute is set or read.
{{LSL Tip|This function '''does not''' get the name of the object's rootprim, but the name of the prim containing the script. Please use [[llList2String]]([[llGetLinkPrimitiveParams]]([[LINK_ROOT]], [ [[PRIM_NAME]] ]), 0); instead.}}
{{LSL Tip|This function '''does not''' get the name of the object's rootprim, but the name of the prim containing the script. Please use [[llGetLinkName]]([[LINK_ROOT]]); instead.}}
|constants
|constants
|examples=
|examples=

Revision as of 11:16, 1 November 2012

Summary

Function: string llGetObjectName( );

Returns a string that is the name of the prim the script is attached to.

Caveats

  • The prim name is limited to 63 bytes, any string longer than that will be truncated. This truncation does not always happen when the attribute is set or read.
KBcaution.png Important: This function does not get the name of the object's rootprim, but the name of the prim containing the script. Please use llGetLinkName(LINK_ROOT); instead.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl> default {

   state_entry()
   {
       // PUBLIC_CHANNEL has the integer value 0
       llSay(PUBLIC_CHANNEL, "This prim's name: " + llGetObjectName() );
   }

}

</lsl>

Notes

  • This function may return "(Waiting)" sometimes.

Presumably the function queries the asset server for a predetermined time and returns "(Waiting)" if that elapses. It then silently proceeds to the next instruction. A work around therefore, might be to test object name is not "(Waiting)" after calling llGetObjectName.

See Also

Functions

•  llSetObjectName Set the prims name
•  llGetLinkName Get a linked prims name
•  llGetObjectDesc Get the prims description
•  llSetObjectDesc Sets the prims description
•  llGetObjectDetails

Articles

•  Limits SL limits and constrictions
•  Prim Attribute Overloading

Deep Notes

Search JIRA for related Issues

Signature

function string llGetObjectName();