Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llAllowInventoryDrop not working

Anthony Hocken
Registered User
Join date: 16 Apr 2006
Posts: 121
02-22-2007 19:18
I'm having some trouble getting llAllowInventoryDrop() to work.

I create a fresh prim, and a fresh script which just does a llAllowInventoryDrop(TRUE). However I'm not able to drag (for example) a photo onto the prim while holding down the CTRL key. I get the no-entry symbol when I hover the cursor over the prim.

I ask a friend to try dragging a photo onto the same prim and it works! (I check the prim's inventory and the photo is there). So I try again with the same prim and it still prevents me (remember, I'm the creator and owner of this prim). Then after a couple of minutes, I'm suddenly able to drop photos into the prim no problem.

Am I missing something obvious or is this a bug?

Here's the script I wrote to test this.

CODE

integer gOn = FALSE;

default
{
state_entry()
{
llSay(0, "touch to enable/disable drag & drop.");
}

touch_start(integer total_number)
{
gOn = !gOn; //toggle
if (gOn)
{
llAllowInventoryDrop(TRUE);
llSay(0, "Drag and drop enabled.");
}
else
{
llAllowInventoryDrop(FALSE);
llSay(0, "Drag and drop disabled.");
}
}

changed(integer mask)
{
if(mask & (CHANGED_ALLOWED_DROP | CHANGED_INVENTORY))
llSay(0, "Inventory has changed");
}
}
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
02-22-2007 19:33
Hmm, try:
if(mask & (CHANGED_ALLOWED_DROP || CHANGED_INVENTORY))
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
02-22-2007 19:41
No no.. you don't want the boolean OR operator (||) when combining flag values. What he had was correct.

Remember, all llAllowInventoryDrop affects is OTHER people's ability to drop items into a prim's inventory (ie, people who don't have modify permission to the object in question); it has no effect on the owner's (or anyone else who has modify permission) ability to do so. Chances are, the problem with you not being able to drop inv into the prim was due to grid/asset server/sim lag of some kind.
Anthony Hocken
Registered User
Join date: 16 Apr 2006
Posts: 121
02-22-2007 20:09
Thanks Talarus. Yes you're right. My script seems to be working okay.

I just tried putting the test script in a prim and left it rezzed, then logged into my alt account and it worked fine, enabling and disabling drag and drop each time i clicked the prim.

I even put the test script in a no-edit prim and sent it to my alt, and it enabled/disabled drag and drop just fine even though I was the owner of the prim.

What's bizarre is that if I create a fresh prim and drop that test script in, I'm *not* able to drag and drop items into the prim, which is where my logic went a little off earlier. I dont think the script is having any influence at all in this situation and it's like you say, there's server issues at play.

At least this means my product wont be temperamental for customers like it has been for me during developing it.