Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llAllowInventoryDrop, Detecting New Objects

Seven Shikami
Registered User
Join date: 22 Sep 2006
Posts: 82
11-24-2006 20:48
I'm making an easel that lets random people walk up, control-drag a texture into its inventory, and have it throw the thing up on its surface.

My current method is llAllowInventoryDrop, to enable random folks to add to its inventory. That fires off a changed() event when a new item's added. But I have two questions about this...

1. How do I detect exactly which object was just added to the inventory, and who added it?

2. On the wiki, it says that changed() will NOT fire...
"when inventory is added using llAllowInventoryDrop, and the user dropping the new inventory item is not the owner of the prim."
...which seems contrary to the whole purpose of inventory drops. Is it true that the event won't fire if the easel's owned by Bob, and then Joe drops an item into it?
Toneless Tomba
(Insert Witty Title Here)
Join date: 13 Oct 2004
Posts: 241
11-24-2006 21:05
The way you are trying doing would make it pretty hard to detect what is coming in. The only way I can think of doing it is by setting a long list of all inventory items.

The way I would do this is put your main program in a child prim if possible. In the main prim place a script with llAlowInventoryDrop(TRUE); and when the changed event is fired it will give everything to the child prim with the main program. (Make sure you delete the items if it's copyable)

As for keeping track of who put in what, you may have to have them touch item before they put the items in. So llAllowInventoryDrop(FALSE). Person touches it. You can get their name. llAllowInventoryDrop(TRUE); Person drops the objects in, timer timeout and llAllowInventoryDrop(FALSE);
_____________________


Seven Shikami
Registered User
Join date: 22 Sep 2006
Posts: 82
11-24-2006 21:10
Okay, I get the touch window to track ownership. But I don't follow the child/parent. Why would making them drop into one prim copy the item into the other? And how would that help me detect which item it was?

Thanks for your help!
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
11-24-2006 21:20
From: Seven Shikami
Okay, I get the touch window to track ownership. But I don't follow the child/parent. Why would making them drop into one prim copy the item into the other? And how would that help me detect which item it was?

Thanks for your help!

It's impossible to know what items have just entered inventory unless you keep a record of it, which is virtually impossible in LSL once you have any decent amount of things.
Toneless Tomba
(Insert Witty Title Here)
Join date: 13 Oct 2004
Posts: 241
11-24-2006 22:17
From: Seven Shikami
Okay, I get the touch window to track ownership. But I don't follow the child/parent. Why would making them drop into one prim copy the item into the other? And how would that help me detect which item it was?

Thanks for your help!



1. Intial
Main Prim - empty with a script Allow Inventory
Child Prim - has items that you are processing and the main script.

2. Items are placed in inventory of main prim
Main Prim - New Items (This is where you can message the child prim of each new item coming in.)
Child Prim - still has the same items.

3. Main prim moves the items to the child prim
Main Prim - empty with a script Allow Inventory
Child Prim - has the new items and old items. (New items are known because of the main prim previous message)

From: someone
It's impossible to know what items have just entered inventory unless you keep a record of it, which is virtually impossible in LSL once you have any decent amount of things.

You see it's not impossible you just have to think out of the box.
_____________________


Toneless Tomba
(Insert Witty Title Here)
Join date: 13 Oct 2004
Posts: 241
11-24-2006 22:43
BTW If it's true about the changed event not being triggered for object placed not by the owner using llAllowInventoryDrop(TRUE) use a timer to check inventory number if it changed.
_____________________


Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
11-25-2006 02:26
changed() does fire.

You get CHANGED_INVENTORY if it's the owner or someone with mod permissions, and CHANGED_ALLOWED_DROP for others as per http://lslwiki.com/lslwiki/wakka.php?wakka=llAllowInventoryDrop

And the two prims approach works very well, I've used it in a number of mailbox type things to filter for various things.
_____________________
Eloise's MiniMall
Visit Eloise's Minimall
New, smaller footprint, same great materials.

Check out the new blog
Kitty Barnett
Registered User
Join date: 10 May 2006
Posts: 5,586
11-25-2006 03:06
From: Toneless Tomba
As for keeping track of who put in what, you may have to have them touch item before they put the items in. So llAllowInventoryDrop(FALSE). Person touches it. You can get their name. llAllowInventoryDrop(TRUE); Person drops the objects in, timer timeout and llAllowInventoryDrop(FALSE);
I know it's the only way to do it, but I never liked this approach, if only because it's so easy to circumvent.

To the OP: if this is for a script you'll be selling/giving away to others, I'd personally not declare ownership with any kind of authority but indicate it as "most likely" or "apparent" owner.