Provide a function to get clothing layers being worn.
needs info
nickvrtis Resident
Currently, I can get a list of all the objects attached to an AVI, and with the correct permissions, I can detach them.
I would like the same capabilities for clothing layers. Obviously, there are a few things that you don't want to remove, but since most clothing is already Mesh objects, don't see why clothing layers shouldn't get the same treatment.
Log In
Logan Elf
There are a number of ways this could be implemented, depending on if there is an associated UUID or not. Nick has given one way. A couple of other ways could be similar to the object inventory functions, or the notecard functions.
"Inventory" style:
- clothing type constants like CLOTHING_ALL, CLOTHING_ALPHA, CLOTHING_TATTOO etc.
- count function (I prefer "count" to "number"): integer llGetClothingCount(integer clothing_type)
- retrieve name: string llGetClothingName(integer index, integer clothing_type)
- remove item: void llRemoveClothing(string name, integer index, integer clothing_type)(since names are not unique, hence the qualifiers. Could not require the name, but I feel it adds an extra check to avoid accidently removing wrong item)
- if desired, make remove be permission based
- might be useful to have a CHANGED_CLOTHING added to changedevent
"Notecard" style
- similar to above, but function names use "Request" instead of "Get"
- return void, as dataserver event gives the requested data
As given, these would only be for the current wearer of the attachment the script is in. If privacy isn't a concern, could add a
key id
parameter to the above functions, or alternatively provide "ByUser" versions.A 1+ would be to allow adding clothing items from the object inventory, which coupled with the above could make implementing BoM auto-alpha a reality.
nickvrtis Resident
I was thinking something similar to llGetAttachedList (maybe llGetLayersList(key avatar)?) to get a list of the UUIDs of everything on the layers, and then llGetLayer(uuid) so we could determine which layer it is on.
Spidey Linden
needs info
Spidey Linden
Can you add some additional details on how you would like this to work? Thanks!