Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

No Modify sounds in scripts

Slayd Lemieux
Registered User
Join date: 9 Jul 2005
Posts: 29
09-04-2005 09:34
Been working on this script for a bit, and ran into either a bug or.. I dunno, lol. I think I can work around it, but it's an annoyance.

In my script I have a line that checks the items inventroy for a sound file specified by the user. Works fine if the sound has full perms... but if it's No Modify, it returns a file not found.

I could still make it add the info for it anyway and continue.. but the whole point was to avoid mispellings or missing files that the user specified.

Is this some sort of feature the Lindens put in to prevent scripts from messing with no modify sounds? And does anyone know a better work around for it?

Thanks!
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
09-04-2005 15:12
Most (all?) of the inventory functions require the things that they refer to to be full-perms.

This would explain your script's behavior.
Slayd Lemieux
Registered User
Join date: 9 Jul 2005
Posts: 29
09-04-2005 16:41
Gah, was afraid of that, hehehe. Thanks Kenehv! Any sort of workaround for it?
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
09-04-2005 17:02
Keknehv. Yes, use the UUID of the sound instead of the inventory name. Then you can have a no-mod, no-copy, no-transfer object that still works. Plus, you don't have to have the sound in the inventory.
a lost user
Join date: ?
Posts: ?
09-05-2005 00:35
Ahh yes..

Use llGetInventoryPermMask() instead of llGetInventoryKey() when determining if the sound exists. Since you are using lists for the names of the sounds so you can math them up with words in another list, you need to have some kind of error checking.

From: LSL Wiki

integer llGetInventoryPermMask(string item, integer mask)

Returns the requested permission mask for the inventory item defined by item. If item is not in the object's inventory, llGetInventoryPermMask returns 0 and causes the object to say "No item named '<item>'" where "<item>" is item. This can be used to quickly determine whether or not an inventory item exists within the object, though it does have the side effect of spamming chat.
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
09-05-2005 09:23
Also, functions like llLoopSound or llSetTexture don't require UUIDs. They'll automagically use an inventory item, if it exists.
Slayd Lemieux
Registered User
Join date: 9 Jul 2005
Posts: 29
09-05-2005 11:50
Perfect! Thanks a ton to the both of you! I am now a happy camper, lol.