Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Inventory Type Scripting Stuff

Joachim Caldera
The Programmer
Join date: 4 Jun 2004
Posts: 5
07-11-2004 19:09
Unless I'm missing something very sneaky, there's no library function to have an object put another object into its inventory, and there's no library function to have an object put itself into an object's inventory. Am I missing a library function, or perhaps, am I missing a workaround that should be obvious? (Since, as long as the object being put into the inventory and the object taking the object will both be scripted by me, the two methods of doing this process are basically the same, I would be happy with a workaround for either.)

As an addendum, the object that needs to be put in inventory is no-copy, so having it contain itself, give that to the receiving object, then kill itself won't work, as that would only be an acceptable solution once.
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
Re: Inventory Type Scripting Stuff
07-11-2004 20:20
From: someone
Originally posted by Joachim Caldera
U<snip> and there's no library function to have an object put itself into an object's inventory.<snip>


Im afraid the only way to do this is to already have a copy of the object (I'll call it "A" and the copy "B";) in its own inventory. Then, if you rez B (Ill call this rezzed B "C";) you can call in A llGiveInventory giving B to C. This process can continue indefinitely.


----HOWEVER----

Its a total pain in the arse to manage something like that, espicially if A updates alot, B wont be up to date.

This is another feature we want but dont have, here's the link to a post on it in the Feature Suggestions forum:

/13/6d/12950/1.html
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
Re: Inventory Type Scripting Stuff
07-11-2004 20:27
From: someone
Originally posted by Joachim Caldera
object put another object into its inventory


This would be a bit of a security risk... what if someone gave you a virus prim, that immediately when you rezzed it, scanned for prims owned by you around it, put as many as it could in its inventory, and then killed itself. In theory you could quickly loose up to 255 objects this way.

I wouldnt really like this, unless LL implemented a security feature like what llRemoteLoadScriptPin has.
Joachim Caldera
The Programmer
Join date: 4 Jun 2004
Posts: 5
07-11-2004 20:31
Figures.

Well, how about this one: Is there any way to add something to the inventory of an object in another object's inventory? To clarify, let's take some object A. A contains a copy of itself, which I'll call B. A rezzes B. We'll call the rezed copy C. So we've got B inside A and an empty C. Now, I have A give a copy of B to C, creating an object D. Is there any way to now give another copy of B to D, so that C will contain D, which will in turn contain E? If I can, at this point, C would give D to the container, and that would have enough of a blueprint to start the process over again if it needs to rez D as a new A.
Ezhar Fairlight
professional slacker
Join date: 30 Jun 2003
Posts: 310
07-12-2004 06:56
llGiveInventory + llAllowInventoryDrop

One object rezzes the copy of itself that is in it's inventory, then hands that same copy to the newly rezzed object.
_____________________
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
07-12-2004 09:46
From: someone
Originally posted by Joachim Caldera
Now, I have A give a copy of B to C, creating an object D. Is there any way to now give another copy of B to D, so that C will contain D, which will in turn contain E?


Im afraid not. Objects within another object's inventory are in a sort of "limbo", freeze-dried state.
Not only that, but llGiveInventory requires that the target object be rezzed in the simulator that llGiveInventory is called in, or it will fail silently.

The only way you can get B to D, is by having C rez D.

==Chris

And... actually Ezhar, object's you own dont need llAllowInventoryDrop permission to give inventory to other objects you own
Joachim Caldera
The Programmer
Join date: 4 Jun 2004
Posts: 5
07-12-2004 12:39
Well that's certainly unfortunate.

The plan proposed by Ezhar would not accomplish the task at hand, as these objects need to be towed around in a container type object when they're not in use. In order for that to work, the container would need to contain an object that contains itself; that can only happen through another object giving the object that contains itself, which, as we've seen, can't happen.

But I think I've got a suitable workaround. It'll just bring this particular aspect of my project from "relatively simple" to "extraordinarily messy."

And, on second thought, the method I had previously conceived won't work, either. Damn the limitations of this language.