LlGetObjectName: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
Undo revision 1186176 by Kireji Haiku (Talk)
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 4: Line 4:
|func=llGetObjectName
|func=llGetObjectName
|return_type=string
|return_type=string
|func_footnote
|func_footnote={{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.}}
|func_desc
|func_desc
|return_text=that is the name of the prim the script is attached to.
|return_text=that is the name of the ''prim'' the script is attached to.
|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 [[llGetLinkName]]([[LINK_ROOT]]); instead.}}
*This function may return "(Waiting)" sometimes. See: [[#Notes]]
|constants
|constants
|examples=
|examples=
Line 17: Line 17:
! '''Get the root prim's name'''
! '''Get the root prim's name'''
{{!}}-
{{!}}-
{{!!}}<lsl>
{{!!}}<source lang="lsl2">
default
default
{
{
Line 26: Line 26:
     }
     }
}
}
</lsl>
</source>
{{!!}}
{{!!}}
<lsl>
<source lang="lsl2">
default
default
{
{
Line 38: Line 38:
     }
     }
}
}
</lsl>
</source>
{{!}}}
{{!}}}
|helpers
|helpers
Line 51: Line 51:
|also_articles=
|also_articles=
{{LSL DefineRow||[[Prim Attribute Overloading]]}}
{{LSL DefineRow||[[Prim Attribute Overloading]]}}
|notes=*This function may return "(Waiting)" sometimes.
|notes=
==== Erroneous "(Waiting)" ====
Presumably the function queries the asset server for a predetermined time and returns "(Waiting)" if that elapses.
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.
It then silently proceeds to the next instruction.

Latest revision as of 02:20, 22 January 2015

Summary

Function: string llGetObjectName( );
0.0 Forced Delay
10.0 Energy

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

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.

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.
  • This function may return "(Waiting)" sometimes. See: #Notes

Examples

Get this prim's name Get the root prim's name
default
{
    state_entry()
    {
    //  PUBLIC_CHANNEL has the integer value 0
        llSay(PUBLIC_CHANNEL, "This prim's name: " + llGetObjectName() );
    }
}
default
{
    state_entry()
    {
    //  PUBLIC_CHANNEL has the integer value 0
        llSay(PUBLIC_CHANNEL, "Root prim's name: "
            + llGetLinkName(LINK_ROOT));
    }
}

Notes

Erroneous "(Waiting)"

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

Signature

function string llGetObjectName();