LlSetInventoryName: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
New page: {{LSL Function/negative_index|false|number}} {{LSL_Function |mode=request |func_id=??? |func_sleep=0.0 |func_energy=10.0 |func=llSetInventoryName |p1_type=integer|p1_name=type|p1_desc=INVE...
 
Strife Onizuka (talk | contribs)
No edit summary
Line 1: Line 1:
{{LSL Function/negative_index|false|number}}
{{LSL Function/inventory|old}}{{LSL_Function
{{LSL_Function
|mode=request
|mode=request
|func_id=???
|func_id=???
Line 6: Line 5:
|func_energy=10.0
|func_energy=10.0
|func=llSetInventoryName
|func=llSetInventoryName
|p1_type=integer|p1_name=type|p1_desc=INVENTORY_* flag
|p1_type=string|p1_name=old|p1_desc
|p2_type=integer|p2_name=number|p2_desc=Beginning from 0
|p2_type=string|p2_name=new|p2_desc=desired inventory name
|p3_type=string|p3_name=name|p3_desc=Desired name for inventory object
|func_desc=Tries to renames the inventory object '''old''' to '''new'''.  Useful for vendors wishing to hand out customized versions of objects.
|func_desc=Sets the name of the inventory object '''number''' of '''type'''.  Useful for vendors wishing to hand out customized versions of objects.
|func_footnote
|func_footnote=Inventory items are sorted in alphabetical order (not chronological order).
|spec
|spec
|caveats
|caveats
|constants={{LSL Constants Inventory}}
|constants
|examples=
|examples=
|helpers
|helpers
Line 24: Line 22:
|also_articles
|also_articles
|notes
|notes
|comments=
A few things that came to mind:
*What happens with a name collision?
*When used in a vendor it would be more useful to change the name of the item when giving, this would avoid the name collision problem (and having to change the name back after giving it).
*A better name for this function would be llRenameInventory (for which there is at least one JIRA).
P.S. I changed the syntax, using inventory numbering to access items is hazardous, names are less prone to change.
-- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 19:03, 21 March 2009 (UTC)
|cat1
|cat1
|cat2
|cat2

Revision as of 12:03, 21 March 2009

LSL Feature Request
The described function does not exist. This article is a feature request.

Summary

Function: llSetInventoryName( string old, string new );
0.0 Forced Delay
10.0 Energy

Tries to renames the inventory object old to new. Useful for vendors wishing to hand out customized versions of objects.

• string old an item in the inventory of the prim this script is in
• string new desired inventory name

Caveats

  • If old is missing from the prim's inventory then an error is shouted on DEBUG_CHANNEL.

Examples

See Also

Deep Notes

Signature

//function void llSetInventoryName( string old, string new );

Comments

A few things that came to mind:

  • What happens with a name collision?
  • When used in a vendor it would be more useful to change the name of the item when giving, this would avoid the name collision problem (and having to change the name back after giving it).
  • A better name for this function would be llRenameInventory (for which there is at least one JIRA).

P.S. I changed the syntax, using inventory numbering to access items is hazardous, names are less prone to change. -- Strife (talk