Difference between revisions of "LlSetObjectName"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 12: Line 12:
|caveats=
|caveats=
* The name is limited to 63 characters. Longer prim names are cut short.
* The name is limited to 63 characters. Longer prim names are cut short.
* Names can only consist of the 95 printable characters found in the [http://en.wikipedia.org/wiki/ASCII ASCII-7] (non-extended) character set.
* Names can only consist of the 95 printable characters found in the {{wikipedia|ASCII|ASCII-7}} (non-extended) character set.
** Non-ASCII characters will be replaced with two question marks ("??").
** Non-ASCII characters will be replaced with two question marks ("??").
* While an object is attached, the script cannot change the name of the object as it appears in the user's inventory. This behavior [http://forums-archive.secondlife.com/255/ab/84853/1.html was a bug], but it [https://jira.secondlife.com/browse/SVC-3429?focusedCommentId=267372&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-267372 remained long enough to become permanent].
* While an object is attached, the script cannot change the name of the object as it appears in the user's inventory. This behavior [http://forums-archive.secondlife.com/255/ab/84853/1.html was a bug], but it [https://jira.secondlife.com/browse/SVC-3429?focusedCommentId=267372&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-267372 remained long enough to become permanent].

Revision as of 19:27, 24 March 2012

Summary

Function: llSetObjectName( string name );
0.0 Forced Delay
10.0 Energy

Sets the prim's name according to the name parameter.

• string name

If this function is called from a child prim in a linked set, it will change the name of the child prim and not the root prim.

Caveats

  • The name is limited to 63 characters. Longer prim names are cut short.
  • Names can only consist of the 95 printable characters found in the "Wikipedia logo"ASCII-7 (non-extended) character set.
    • Non-ASCII characters will be replaced with two question marks ("??").
  • While an object is attached, the script cannot change the name of the object as it appears in the user's inventory. This behavior was a bug, but it remained long enough to become permanent.
    • Changes to the name of the root prim (with llSetObjectName for example) will not be saved to inventory; when the attachment is detached (to inventory, not dropped) this name change is discarded and the name in inventory is used instead.
    • Dropping an attachment (to the ground) and taking it into inventory will cause the inventory name of the attachment to be the changed name.
  • Changes to the names of child prims will be saved back to inventory when the object is detached to inventory. They survive detachment.

Examples

<lsl>default {

   state_entry()
   {
       string yyyy1mm1dd = llGetDate();
       string name = yyyy1mm1dd + " " + llGetObjectName();
       llOwnerSay("llSetObjectName(\"" + name + "\")");
       llSetObjectName(name);
   }
}</lsl>

See Also

Functions

•  llGetObjectName Get the prims name
•  llGetLinkName Get a linked prims name
•  llGetObjectDesc Get the prims description
•  llSetObjectDesc Set the prims description
•  llGetObjectDetails Get a list of object details

Articles

•  Limits SL limits and constrictions

Deep Notes

Signature

function void llSetObjectName( string name );