Difference between revisions of "LlSetObjectDesc"

From Second Life Wiki
Jump to navigation Jump to search
m (Replaced old <LSL> block with <source lang="lsl2">)
(23 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|inject-2={{Issues/VWR-437}}{{Issues/SVC-3429}}{{Issues/VWR-8761}}{{LSL_Function/prim-desc|set}}
|func=llSetObjectDesc
|func=llSetObjectDesc
|sort=SetObjectDesc
|func_id=271|func_sleep=0.0|func_energy=10.0
|func_id=271|func_sleep=0.0|func_energy=10.0
|func=llSetObjectDesc
|p1_type=string|p1_name=description
|p1_type=string|p1_name=desc
|func_footnote
|func_footnote
|func_desc=Sets the prims description
|func_desc=Sets the prims description
|return_text
|return_text
|spec
|spec
|caveats=*The object description is limited to 127 bytes, any string longer then that will be truncated. This truncation does not always happen when the attribute is set or read.
|caveats
*According to [http://jira.secondlife.com/browse/VWR-437 VWR-437] if you set the description to longer then 256 bytes the object may no longer be rezzable. Use caution if using this field to store data.
|constants
|constants
|examples=<pre>
|examples=
//store the owner's name in the prim description
{{{!}} class="sortable" width="100%" {{Prettytable}}
touch_start(integer total_number)
{{!}}- {{Hl2}}
! '''Set this prim's description'''
! '''Set the root prim's description'''
{{!}}-
{{!!}}<source lang="lsl2">
default
{
    state_entry()
    {
        llSetObjectDesc("NEW PRIM DESCRIPTION");
    }
}
</source>
{{!!}}
<source lang="lsl2">
default
{
    state_entry()
     {
     {
         string temp;
         llSetLinkPrimitiveParamsFast(LINK_ROOT,
 
            [PRIM_DESC, "NEW ROOT PRIM DESCRIPTION"]);
        temp = llKey2Name(llGetOwner());
 
        llSetObjectDesc(temp);
     }
     }
 
}
</pre>
</source>
{{!}}}
|helpers
|helpers
|also_functions=
|also_functions=
{{LSL DefineRow||{{LSLG|llGetObjectDesc}}|Returns the object description.}}
{{LSL DefineRow||[[llGetObjectDesc]]|Gets the prim description.}}
{{LSL DefineRow||{{LSLG|llGetObjectName}}|Gets the object name.}}
{{LSL DefineRow||[[llGetObjectName]]|Gets the prim name.}}
{{LSL DefineRow||{{LSLG|llSetObjectName}}|Sets the object name.}}
{{LSL DefineRow||[[llSetObjectName]]|Sets the prim name.}}
|also_tests
|also_tests
|also_events
|also_events

Revision as of 14:23, 22 January 2015

Summary

Function: llSetObjectDesc( string description );

Sets the prims description

• string description

Caveats

  • The prim description is limited to 127 bytes; any string longer then that will be truncated. This truncation does not always happen when the attribute is set or read.
  • The pipe character '|' and the newline character '\n' are not legal in a prim's description. They will be replaced with '?'.[1]
  • Note that when people have "Hover Tips on All Objects" selected in the viewer's "View" menu, they'll see the object description pop-up for any object under their mouse pointer. For that reason, it is good practice to only set human-friendly information in the description, e.g. keys and such.
  • When an attached object is detached, changes made by script to the name and description (of the root prim) of the attachment will be lost. While the object is attached the name and description can be changed but it will not be reflected in inventory. This caveat does not apply to child prims.

Important Issues

~ All Issues ~ Search JIRA for related Bugs
   Name or description change, of an attached object, is rolled back when object is detached

Examples

Set this prim's description Set the root prim's description
default
{
    state_entry()
    {
        llSetObjectDesc("NEW PRIM DESCRIPTION");
    }
}
default
{
    state_entry()
    {
        llSetLinkPrimitiveParamsFast(LINK_ROOT,
            [PRIM_DESC, "NEW ROOT PRIM DESCRIPTION"]);
    }
}

See Also

Functions

•  llGetObjectDesc Gets the prim description.
•  llGetObjectName Gets the prim name.
•  llSetObjectName Sets the prim name.

Articles

•  Limits SL limits and constrictions
•  Prim Attribute Overloading

Deep Notes

All Issues

~ Search JIRA for related Issues
   llSetObjectDesc and editor panel have different description string length limits
   Name or description change, of an attached object, is rolled back when object is detached
   Cannot delete object description.

Footnotes

  1. ^ The pipe character historically has been used to separate fields in the serialized version of inventory. The field is not multi-line so the newline character holds no meaning in this context.

Signature

function void llSetObjectDesc( string description );