Jump to content

Transfering Inventory from Prim to Prim


Tristus Patton
 Share

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

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

Recommended Posts

Don't know where to start myself. I guess I would take a look at llGiveInventory and see if there is an option for giving it to another prim instead of an avatar.

If that won't work, I might look at llRezOjbect and just rez a copy of the prim with the inventory in it and see if I could do something with that.

Link to comment
Share on other sites

To copy inventory items betwenn the inventories of prims, you usually use llGiveInventory. If you want to copy a complete list of items, you can use llGiveInventoryList. Of course you an delete the copied items from the giving prim if required by using lRemoveInventory. Scripts stopp running when transfered between prims - if you want to copy running scripts, you have to use llRemoteLoadScriptPin and llSetRemoteScriptAccessPin.

To all these functions, there is one big limitation: Giving and receiving prims hae to be in the same region (llGiveInventory work cross region if the receiver is an avatar).

I hope this points you in the right direction.

Link to comment
Share on other sites

another big limitation... llGiveInventory can only give to prims of the same owner.

you can jumpstart scripts given with it manually by taking the receiving object to inventory then rezzing it, and using the restart all scripts in object command in the tools menu, or individually by script using llRemoteLoadScriptPin to move the dead scripts to a new child prim with start set to true.

Link to comment
Share on other sites

Nope.  Linking is not required. llGiveInventory is very straightforward. When you write

key OtherPrim = "A real UUID goes here instead of these words";

llGiveInventory(OtherPrim,"My Object");

it will give the object named "My Object" that is in its own inventory to the object whose UUID is OtherPrim.  As Darkie said, the original will remain in inventory unless "My Object" is no-copy.  If you want to be sure that it actually disappears from inventory and shows up only in the OtherPrim, you need to write something like

key OtherPrim = "A real UUID goes here instead of these words";integer perm = llGetInventoryPermMask("My Object",MASK_OWNER);llGiveInventory(OtherPrim,"My Object");if (~llGetInventoryType("My Object")) //If the object is still in inventory ....{    if(perm & PERM_COPY) // If it was no-copy, it shouldn't be here. If it is, however, don't kill it.    {        llRemoveInventory("My Object");    }    else    {        llOwnerSay("\"My Object\" failed to transfer. It is still in inventory.");    }}

 As Void says, the transfer will fail if OtherPrim doesn't belong to you, or if it's not in the same sim.

 

 

Link to comment
Share on other sites

my issue before was copying the script into the other prim, because I couldnt remember how to get the object key, after finding llGetKey(), that fixed that issue. Now I guess my problem is.. after copying the script into the other prim, I want to remove the script that was in the before. I could use the script that was in there before to kind of remove itself, but I was some kind of verification to know that the new script is in there, and my bigger issue is, getting the script that was copied into the other prim to activate. Ive been playing with the llRemoteLoadScriptPin script, and I guess Im doing it wrong because I keep getting an error.

the script to be activated has the llSetRemoteScriptAccessPin(##);

and the script that move the script I want to copy has the llRemoteLoadScriptPin(##);

Now, my understanding is probly wrong, but wouldnt the llRemoteLoadScriptPin activate the script that was copied over?

Link to comment
Share on other sites

if you want to replace scripts llRemoteLoadScriptPin is the best option.... use llRemoteLoadScriptAccessPin in the target, then ScriptPin in the sender with running set to true, and have the sent script call AccessPin again with 0 as the PIN (turns off access to live script sending)

Link to comment
Share on other sites

you don't need give inventory for this purpose, and access pin must be called first (to enable script pin to work).

 

A: (givver), B:Receiver, X:script that is transfered

 

B: calls (from any script) AccesPin with a number that is not zero

A: calls ScriptPin from any script using the same number B used with the run parameter set to TRUE

X: (now residing in B) calls AccesPin with 0 from state_entry of default state, turning off further live script transfers. (you want to do this since "pin"s are prim properties, and remain forever, leaving the item open to be exploited if someone can guess the pin)

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4633 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...