Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Giving multiple non copy items solution wanted

Lisbeth Cohen
Registered User
Join date: 4 Jul 2004
Posts: 53
04-11-2006 00:48
Please delete this message.
Nepenthes Ixchel
Broadly Offended.
Join date: 6 Dec 2005
Posts: 696
04-11-2006 01:15
To clarify; you have items that YOU don't have copy permission for? Seems a little odd to me if that's the case.

If you have copy/trans permissions you can just set the item to no-copy/trans for next owner.
Lisbeth Cohen
Registered User
Join date: 4 Jul 2004
Posts: 53
04-11-2006 01:30
No, I have copy permissions for those, cause I made them. But I haven't set copy permission for next owner on them.

I created a box, put the items into it, created a script in the object, then gave the object to my alt. Used the sample script from the lsl wiki llGiveInventoryList() btw.

Using my alt for testing, the script complained it could not give items because owner have no copy permissions (which is correct, cause my alt should not have copy permissions). But still, the items should be moved from object to my alt's inventory, rigtht? So that the box is empty after transferring to her inventory. I find this very odd...


Edit: Tried now to set both the container to copyable as well as the script. Still got the same error. But when I gave everything in contents copy permission, it worked. I just don't want to use copy permission, cause I want people to be able to purchase my products as gifts - so they should be transferable.


Lis
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
04-12-2006 09:15
Ah, it's a unpacker for a box. I thought at first (as did Nepenthes it seems) that you owned the container. For unpacking nocopy objects, the only way I know is to use llGiveInventory() for each item seperately. Unfortunately, this means the receiver gets a request transfer dialog for each item, and they end up in their Objects folder.
CODE
//Nocopy item unpacker
//by Kayla Stonecutter
//Gives everything in contents to whoever touches, with an owneronly option.
//Slow, but works with nocopy objects.
//Items are given one at a time, and end up in the recievers Object folder.


integer OwnerOnly = 1; //Set to 1 so only the owner can unpack, or 0 for anyone

default
{
touch_start(integer total_number)
{
integer x;
for(x = 0; x < total_number; ++x)
{
key toucher = llDetectedKey(x);
if((toucher == llGetOwner()) || (OwnerOnly == 0))
{
string InvenName;
integer InvenNumber = llGetInventoryNumber(INVENTORY_ALL);
list InvenList = [];
integer y;
string ScriptName = llGetScriptName();
for(y = 0; y < InvenNumber; ++y)
{
InvenName = llGetInventoryName(INVENTORY_ALL, y);
if(InvenName != ScriptName) InvenList += [InvenName];
}
for(y = 0; y < (InvenNumber - 1); ++y)
{
llGiveInventory(toucher, llList2String(InvenList,y));
}
}
}
}
}
_____________________
Tre Giles
Registered User
Join date: 16 Dec 2005
Posts: 294
Cool
04-12-2006 10:52
Thx I needed one of these.
Lisbeth Cohen
Registered User
Join date: 4 Jul 2004
Posts: 53
04-12-2006 15:34
From: Kayla Stonecutter
Ah, it's a unpacker for a box. I thought at first (as did Nepenthes it seems) that you owned the container. For unpacking nocopy objects, the only way I know is to use llGiveInventory() for each item seperately. Unfortunately, this means the receiver gets a request transfer dialog for each item, and they end up in their Objects folder.
Sorry for being so unclear. I thought about what you do with your script as well, but it is simply not user friendly. It's much better to have customer make a folder and then move contents in box over to inventory manually, than to answer 40 annoying requestors - and then have to find items in standard folders.

I wish llGiveInventoryList() didn't have that idiotic limitation that items have to be copyable. If they aren't copyable, the items could just be moved from the box to inventory instead of copied. Hope some LL developer sees this and rethink the whole thing, cause it's too limited as it is now.

Thanks for sharing the script Kayla - I'm sure it will be of much use for many people :)


Lis