Difference between revisions of "LlGetObjectName"
Jump to navigation
Jump to search
All Issues ~ Search JIRA for related Bugs
Kireji Haiku (talk | contribs) m (side-by-side comparison between llGetObjectName and llGetLinkName(LINK_ROOT)) |
Kireji Haiku (talk | contribs) m (removed double instances of information and page is now easier to read on narrow screens (<1080p, mobile, ...)) |
||
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. | ||
*This function '''does not''' get the name of the object's rootprim, as the name would imply. See examples below on how to do that. | |||
|constants | |constants | ||
|examples= | |examples= | ||
Line 15: | Line 15: | ||
{{!}}- {{Hl2}} | {{!}}- {{Hl2}} | ||
! '''Get this prim's name''' | ! '''Get this prim's name''' | ||
{{!}}- | {{!}}- | ||
{{!!}}<lsl> | {{!!}}<lsl> | ||
Line 22: | Line 21: | ||
state_entry() | state_entry() | ||
{ | { | ||
llSay(PUBLIC_CHANNEL, "This prim's name: " + llGetObjectName() ); | llSay(PUBLIC_CHANNEL, "This prim's name: " + llGetObjectName() ); | ||
} | } | ||
} | } | ||
</lsl> | </lsl> | ||
{{!}}} | |||
{{{!}} class="sortable" width="100%" {{Prettytable}} | |||
{{!}}- {{Hl2}} | |||
! '''Get the root prim's name''' | |||
{{!}}- | |||
{{!!}} | {{!!}} | ||
<lsl> | <lsl> | ||
Line 33: | Line 36: | ||
state_entry() | state_entry() | ||
{ | { | ||
llSay(PUBLIC_CHANNEL, "Root prim's name: " | llSay(PUBLIC_CHANNEL, "Root prim's name: " | ||
+ llGetLinkName(LINK_ROOT)); | + llGetLinkName(LINK_ROOT)); |
Revision as of 08:05, 2 January 2014
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: string llGetObjectName( );202 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
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.
- This function does not get the name of the object's rootprim, as the name would imply. See examples below on how to do that.
Examples
Get this prim's name |
---|
<lsl>
default { state_entry() { llSay(PUBLIC_CHANNEL, "This prim's name: " + llGetObjectName() ); } } </lsl> |
Get the root prim's name |
---|
<lsl> default { state_entry() { llSay(PUBLIC_CHANNEL, "Root prim's name: " + llGetLinkName(LINK_ROOT)); } } </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 |