Jump to content

Question on dropping Items on Prims


You are about to reply to a thread that has been inactive for 3610 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi All!

 

I have a question, that I am afraid I know the answer to, but I thought I'd ask just in case. I have a linkset of Prims, and I would like to allow users to drop certai items onto it. I understand all about llAllowInventoryDrop and the like, but my 'problem' is that I would like this drop to occur on a prim that is not Root ... but anything that gets dropped, goes to the root, not the child prim that I want it to go to.

Is there anyway to 'fix' this, other than coding something up that moves the item from the root to the child prim?

 

Thanks in advance!

 

Wanda Soulstar

Link to comment
Share on other sites

No, there isn't, but code to make the transfer is easy enough.

default{    changed(integer change)    {        if (change & CHANGED_INVENTORY)        {            integer i =llGetInventoryNumber(INVENTORY_OBJECT) ;            while (i)            {                --i;                string Name = llGetInventoryName(INVENTORY_OBJECT,i);                llGiveInventory(llGetLinkKey(2),Name);  //Move object to link 2                llRemoveInventory(Name);  //Delete object from root inventory            }        }    }}

 Well, easy except that it won't move no-copy items.  You'll have to raise a flag to remind you to move those manually.  I think no-trans items are OK, though.  I can't pop in world to test right now.

Link to comment
Share on other sites

Here's a version that includes the "no-copy" flag I mentioned above.

default{    changed(integer change)    {        if (change & CHANGED_INVENTORY)        {            integer i =llGetInventoryNumber(INVENTORY_OBJECT) ;            while (i)            {                --i;                string Name = llGetInventoryName(INVENTORY_OBJECT,i);                integer OPerms = llGetInventoryPermMask(Name,MASK_OWNER);                if ((OPerms & PERM_COPY) == PERM_COPY)                {                    llGiveInventory(llGetLinkKey(2),Name);  //Move object to link 2                    llRemoveInventory(Name);  //Delete object from root inventory                }                else                {                    llOwnerSay("The object named " + Name + " cannot be copied. You will need to move it manually.");                }            }        }    }}
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3610 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...