Is this possible in LSL?
|
|
Zaplok Riggles
Registered User
Join date: 25 Feb 2008
Posts: 119
|
03-05-2008 14:04
I have an object with an inventory item in it. I allow people to click it to get a copy of that inventory item. But, I keep a list of what avatars have gotten one and don't allow them a second (the item I want to give them is no copy). Is this doable or do I need to put a no copy item in my inventory and then, when I do the llGiveInventory it removes it because it is no copy? Maybe I can put a copiable version of the object in my inventory, give another copy to the object, and then set the new copies name and permissions so it's no copy and give that? In a nutshell, I want a no copy object dispenser. Ideas?
|
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
03-05-2008 14:12
You have a few options. You could keep a list of the people who've picked up the item. This list can't be large enough to store every av in SL, because the script will run out of memory. You may be able to hold, say, the 20 most recent people. Or 50, or whatever. And then you hope that when someone clicks it a 2nd time and they get a "Sorry, you already have this item" message, they won't come back and try again in a couple of weeks.
Or, you need some place to store a potentially large list of names. I use a database on my webserver, so then the script talks to the server to see if the person's name is in the database or not. This of course requires a database somewhere... some people have provided this as a free service, so using those would be one option. Or write an in-world database... some people are working on this as well.
|
|
Tecak Oyen
Registered User
Join date: 13 Jun 2007
Posts: 18
|
03-05-2008 14:14
Yes, this is doable. In the touch_start event, check to see if llDetectedKey is in a list, if it isn't, add it to the list and give the inventory item.
The only problem with this approach is eventually you'll run out of space for the keys of the avatars who've touched the object.
|
|
Zaplok Riggles
Registered User
Join date: 25 Feb 2008
Posts: 119
|
03-05-2008 14:48
It's not the list part I am questioning: I want an object with a no copy inventory item in it. I want to give it out to someone. But, doesn't the inventory item leave the object if I give it out and it is no copy? 2 scenarios: 1. I own an object that contains inventory items that I also own. They are set as no copy. Can I llGiveInventory them without them leaving my object? 2. I give someone an object that has inventory items that I own. They are set as no copy. If the object does an llGiveInventory, does it remove the inventory item? In other words, what are the restrictions for an object using llGiveInventory when the object I am giving is no copy.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
03-05-2008 15:14
If YOU have copy permissions, the object will disappear after being given. If YOU have copy permissions, but you deny copy permissions to the NEXT OWNER, you can continue giving it out as much as you want.
|
|
Anthony Hocken
Registered User
Join date: 16 Apr 2006
Posts: 121
|
03-05-2008 15:17
If you're the creator of the object being transferred then the next owner permissions dont kick in until the item is transfered to another avatar. It's the recipients who have to deal with the next-owner restrictions - they don't apply to the creator.
The only scenario where it would apply to the creator if it got transferred to another avatar and then transferred back.
|
|
Zaplok Riggles
Registered User
Join date: 25 Feb 2008
Posts: 119
|
03-05-2008 16:46
Here's what I found: a non copyable inventory item is removed from the object's inventory if you llGiveInventory it. As far as I can see, there's no way for an object to llGiveInventory a non copyable object more then once. If anyone has any ideas of a way to do this, let me know. If the llSetPermMask stuff was implemented, I could do it, but that's not in (wonder why? I don't see how it would be a problem).
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
03-05-2008 20:22
From: Zaplok Riggles Here's what I found: a non copyable inventory item is removed from the object's inventory if you llGiveInventory it. As far as I can see, there's no way for an object to llGiveInventory a non copyable object more then once. If anyone has any ideas of a way to do this, let me know. If the llSetPermMask stuff was implemented, I could do it, but that's not in (wonder why? I don't see how it would be a problem). That is true only on object for which the CURRENT owner (you) doesn't have copy permissions. But the permissions of the current owner are independent of the permissions of the NEXT owner (except that you can't grant permissions you don't have yourself, so next owner permissions are a subset). The permissions you can set are the permissions for the next owner. They do not, and--in some cases unfortunately--cannot, change whether or not YOU (and by extension objects owned by you) can copy the object. In other words, this: From: Zaplok Riggles Maybe I can put a copiable version of the object in my inventory, give another copy to the object, and then set the new copies name and permissions so it's no copy and give that? ...WILL work.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
03-05-2008 20:29
Oh. I should point out that, if the dispenser is group deeded, you'll have to stuff the items into it with copy permissions for next owner ENABLED. Then, once the items are in the group-deeded dispenser (and have thus been given into the group's--i.e. next owner's--possession themselves) you should be able to set the permissions for the next next owner (the resident the group object gives to). Make sure you can trust other group members who have the ability to modify group objects though, because I believe in this scenario they'll be able to snag copyable, transferable copies themselves.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
03-05-2008 20:30
Oh. I should point out that, if the dispenser is group deeded, you'll have to stuff the items into it with copy permissions for next owner ENABLED. Then, once the items are in the group-deeded dispenser (and have thus been given into the group's--i.e. next owner's--possession themselves) you should be able to set the permissions for the next next owner (the owner the group object gives to). Make sure you can trust other group members who have the ability to modify group objects though, because I believe in this scenario they'll be able to snag copyable, transferable copies themselves.
|