Playing with inventory
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
01-17-2008 13:21
Is there any way for a script to put its host prim into another prim?
Let me sketch it out a little more. I am looking to have something that the avatar can add a notecard to, then have that notecard sent to another avatar, but inside of a "package". Once the avatar puts the notecard in the package, I cannot figure out how to get that package to another avatar without user intervention.
What I would like to happen is this . . . user puts notecard in package, then issues a command with the name of the avatar to send to. (Assuming the recipient is in one of the name2key databases) the package is then sent to the recipient. The recipient simply "wears" or "rezzes" the package, and a script in the package gives the notecard, which is then displayed on the screen.
I am assuming that I can use llGiveInventory for something containing a copy of the package to give that package to the recipient. But I cannot think of how to modify the copy of the package inside the inventory of the sending prim so that what is sent includes the notecard.
Sufficiently confused? Me, too.
Thanks for any help, even the expected "Sorry, but that is beyond the current capabilities of LSL".
Baron
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
01-17-2008 13:30
From: Baron Hauptmann "Sorry, but that is beyond the current capabilities of LSL". But you could give both the package and the notecard with two calls to llGiveInventory(). Or if it is acceptable to have the giver own the package with transfer permissions, of course you could have them stuff the notecard in and then send to the recipient manually....
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
01-17-2008 13:34
Thanks Hewee, Yeah, I had thought of that, too. If the transferred object could open up the notecard from a person's inventory, or even if it could keep the UUID of the notecard and call it from the sender's inventory, that would be fine. But as far as I know, neither of those are valid options, either.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
01-17-2008 13:48
I hate to always wind up suggesting this solution, but do you have access to an external webserver you could contact from the package via HTTP? You could have the sending object take data from the notecard, POST it to a webserver, and then have the package GET the text from the webserver for that recipient and read it in chat or "scroll" text via llSetText() or something....
You could also transmit just the UUID of the notecard this way. Maybe make sure you have the sending object keep ahold of the notecard for a time (or until delivery?) so it doesn't get garbage collected though. Note that you couldn't DELIVER the notecard this way, but you could still read off plain text to the recipient.
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
01-17-2008 17:40
That's a thought . . . I had a friend ask me if a project would be possible, and I'm not sure whether this would fit in with how she would like it to work . . . but I think I'll report back to her that this is about the only solution that comes close to what she's asking.
|
|
ElQ Homewood
Sleeps Professionally
Join date: 25 Apr 2007
Posts: 280
|
01-18-2008 18:03
Well, in the same vein, could you not have the package read the note into a string, store the string in the description field, then when the package is delivered, llSay or llSetText the string, without a web server? I'll give you, I don't know all the ins and outs of this lol I've never had to do it. Just an idea, though.
|
|
Wyatt Burton
Registered User
Join date: 11 Jan 2007
Posts: 49
|
01-18-2008 18:27
From: Baron Hauptmann Is there any way for a script to put its host prim into another prim?
Let me sketch it out a little more. I am looking to have something that the avatar can add a notecard to, then have that notecard sent to another avatar, but inside of a "package". Once the avatar puts the notecard in the package, I cannot figure out how to get that package to another avatar without user intervention.
What I would like to happen is this . . . user puts notecard in package, then issues a command with the name of the avatar to send to. (Assuming the recipient is in one of the name2key databases) the package is then sent to the recipient. The recipient simply "wears" or "rezzes" the package, and a script in the package gives the notecard, which is then displayed on the screen.
I am assuming that I can use llGiveInventory for something containing a copy of the package to give that package to the recipient. But I cannot think of how to modify the copy of the package inside the inventory of the sending prim so that what is sent includes the notecard.
Sufficiently confused? Me, too.
Thanks for any help, even the expected "Sorry, but that is beyond the current capabilities of LSL".
Baron Im confused. Does the notecard change dynamically or is it a static notecard?
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
01-19-2008 13:20
Wyatt: Notecard is static. But it is added by the user who sends the object containing it. I want for it to be sent from a script (llGiveInventory), rather than the user having to use normal procedure for sending an object to another. ElQ: Problem is, using llGiveInventory, the item that is sent has to be inside the object with the script. There is no way to add the notecard into an item that is inventory inside another item, as far as I know. And that's what would need to happen, to the best of my knowledge. Just wondering if there is such a thing as "thinking outside the box" on this one 
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
01-19-2008 13:47
Hmm. Outside the box? You could have the gift IM the recipient, letting him or her know there is a gift to pick up and including a SLURL to its own location so he/she can click to teleport and pick it up....
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
01-19-2008 13:51
This might allow the package to be owned by you or the sender or whatever, and to deliver the contents when the recipient touches it or something. Or it could be set free to copy or sell a copy for L$0, with a note and script that says only the intended recipient will get the functionality.
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
01-19-2008 13:56
Oh. Or if it fits, you could make the package no-copy, and have it tell the recipient to rez it in a certain location. When they do, turn on llAllowInventoryDrop() until your server gives the notecard to it. Then it can deliver the notecard to the user, and when the user takes it back into inventory it'll have the notecard inside still.
|