One of my silly projects I have is a "Christmas Wrapper Machine" which is basically a vendor that puts the desired object inside a package with the christmas wrapper of your choice (instead of a "default" box).
So basically the vendor object will have two types of objects inside: the ones for sale (say, listed in a notecard as usually - there are so many good vendor scripts around, there is no need for me to write my own one from scratch - AGAIN [since I have done one some months ago before adapting one of the freebies lol]), and the "wrapped boxes" (which, for the sake of arguments, let's assume they are a bit more complex than simple texture changes).
The vendor, beyond the usual next/prev buttons and a display, will also have, say, 4 buttons to select the "wrappers". Let's assume we have a "current wrapper" selected, and someone buys one set of clothes.
What I want to give them is one "wrapped box" and put inside that that set of clothes, and finally this wrapped box goes into the buyer's inventory.
My first approach (not tested) would be to rez the correct box outside the vendor, set it to accept inventory, send to it the clothes, and have the buyer pick it from the ground. But I would like to have it sent immediately to the buyer. What I next thought was to send it a small script that is activated remotely with llRemoteLoadScriptPin and that "gives itself".
Alas, the LSL Wiki is clear on this point:
Q: Is there a way to have an object give itself?
A: No, but it's possible to put a copy of the object into itself that it can then give
A: No, but it's possible to put a copy of the object into itself that it can then give
and refers to this 6-month old thread where people asked for the feature of self-giving objects.
I have thought of other ways to give the object away while at the same time pass parameters to it - say, through the object's description, for instance. But I can't affect the object's name or description when it is NOT rezzed (and after giving it away, it's too late).
One way would be to have a two-step process, rezzing a "temporary vendor" object with some information on the proper wrapping to select, and encode this information either in the object's description or a notecard inside, and give the object to the buyer, and llDie() afterwards. When the buyer rezzes the object, it will read the information and apply all changes/transformations to itself (ie. getting textures via their keys, or, if the wrapper is more complex, rez in the necessary prims).
Anybody has a better solution to this crazy problem?
