Leave a gift?
|
|
Lilliput Boshops
Registered User
Join date: 25 Oct 2006
Posts: 89
|
11-23-2006 00:10
I purchased an item which has transfer permissions, and I'd like to leave the package in my friend's home, so she will find it when she returns. IOW, I would like it to be a surprise that she will find when she enters her home, rather than something I drop on her profile and she is notified it's there. I can figure out how to place the packaged item in her house, but I can't figure out how to make it so that she will be able to unpack it (since it's still under my ownership). Is there a way to do this? Thanks.
|
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
11-23-2006 00:40
*moves to scripting tips*
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|
|
Lilliput Boshops
Registered User
Join date: 25 Oct 2006
Posts: 89
|
11-23-2006 00:57
From: Strife Onizuka *moves to scripting tips* Well, ok, you're the moderator. I'm not really sure this is a scripting question, but scripters are smart, so, hey, I'm all for it. Maybe this is simpler than I thought. I just realized that she has permission to modify my objects. So she should be able to open the package when she finds it, right?
|
|
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
|
11-23-2006 00:58
string friend_name = "Friend's Name"; default { touch_start(integer n) { if( llDetectedName(0) == friend_name ) { key target = llDetectedKey(0); integer i; integer inv = llGetInventoryNumber(INVENTORY_ALL); for (i=inv - 1; i>=0; i--) { string inv_name = llGetInventoryName(INVENTORY_ALL, i); if ( llGetScriptName() != inv_name) { llGiveInventory(target, inv_name); } } } } } I do believe that will work. I'm not able to get in to SL right now to check my work.
|
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
11-23-2006 01:03
Hmm. Stick it in a "present box" which has a script running to give its contents (sans the script, of course) to her and her only. Something like: default { touch_start(integer piCount) { if (llDetectedName(0) == "My Friend's Name") { // put your friend's name in here llGiveInventory(llDetectedKey(0),"The Gift"); // change the name to the object's name llSay(0,"Here's a gift from me!"); // change the message to whatever you like } } }
|
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
11-23-2006 01:15
From: Lilliput Boshops Maybe this is simpler than I thought. I just realized that she has permission to modify my objects. So she should be able to open the package when she finds it, right? Thats absolutely true ^^ she should be able to edit it. The script above should work to (nothing jumps out, maybe "inv-1" should be replaced with "inv - 1" but they might have fixed that compiler bug). You could also use a click dialog to say it's a gift string name = "Friends name"; string message = "Hello my dear friend, I hope you like this gift I got you, just right click on it and 'Open' it ^_^";
default { touch_start(integer a) { if(llToLower(llDetectedName(0)) == llToLower(name)) llDialog(llDetectedKey(0), message, ["Ok"], -1); } }
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|
|
Lilliput Boshops
Registered User
Join date: 25 Oct 2006
Posts: 89
|
11-23-2006 01:40
Well, I'm very thankful for the help, but I'm afraid I have no idea what any of this means. Sorry.
|
|
Osprey Therian
I want capslocklock
Join date: 6 Jul 2004
Posts: 5,049
|
11-23-2006 01:51
Go to Fairchang's in Gignano or elsewhere and buy Pituca's gift bag for 10L or so - comes in many patterns/styles.
|
|
Lilliput Boshops
Registered User
Join date: 25 Oct 2006
Posts: 89
|
11-23-2006 10:51
From: Osprey Therian Go to Fairchang's in Gignano or elsewhere and buy Pituca's gift bag for 10L or so - comes in many patterns/styles. Got it. Thank you. This is why division of labor works. While I may become interested in learning how to script at some point, there are too many other things calling for my attention in SL at the moment. Thanks again!
|
|
Vares Solvang
It's all Relative
Join date: 26 Jan 2005
Posts: 2,235
|
11-23-2006 11:50
What a coincidence, I just modified a "give inventory" script like two days ago so that you can tell it a specific person, and it will only give it's contents to them (when they touch it.) Originally this script would give it's contents to only it's owner, but now you can leave a box for someone to find when they log in. =) Here it is: // Copyright 2004, Trimming Hedges. Released to the public domain. // Modified on 20Nov2006 by Vares Solvang to allow you to specify a specific person to give the contents too, insead of // just the owner. // This way you can leave a nicely wrapped present for someone to find when they log in, instead of just dropping // items on them (which they might not even notice). // The box will delete itself after giving the person it's contents. (unless you comment out the last line of the script.)
// This is a simple script that gives everything in a box to the person who clicked.
// I wrote this because of all the texture bundles that are given out. It's really a PAIN // to move a lot of textures or other contents out of a box. This speeds that up.
// This is NOT a vending script. You can use this script to give everything in a box to someone, by changing 'owneronly' to be 0. BUT: //
// THIS IS NOT A VENDING SCRIPT. It gives items away, it does NOT SELL THEM. (You don't need a script for most vending anyway.) // This script doesn't give itself away. If you want it to, put it in the box, and set it to not running. // Then rename a copy and put that in the box too. The renamed copy should be the running one. // Rename it FIRST, I had weird issues with renaming it when it was already in // the box. (version 1.2.12 of SL.)
integer owneronly = 1; string owner; integer Bob;
default { on_rez (integer blahlbah) { llResetScript(); } state_entry() { Bob = llListen(0,"",llGetOwner(),""); llSay(0,"Say the EXACT full name of the person you wish to give the contents too."); } listen(integer channel, string name, key id, string message) { owner = message; llSay(0, "I will now give my contents to only "+owner+" when they touch me."); llListenRemove (Bob); }
touch_start(integer total_number) { integer i; for (i=0;i<total_number;i++) { key target = llDetectedKey(i); if ( (llDetectedName(i) != owner) && (owneronly == 1) ) // person clicking isn't owner and owneronly is set; { llInstantMessage(target,"Sorry, only "+owner+" is allowed to get my contents."); return; } llSay(0, "Giving my contents to "+owner+" now, this might take a moment, please wait while I access the database."); list inventory_types = [INVENTORY_BODYPART,INVENTORY_CLOTHING,INVENTORY_LANDMARK,INVENTORY_NOTECARD,INVENTORY_OBJECT,INVENTORY_SCRIPT,INVENTORY_SOUND,INVENTORY_TEXTURE]; integer inventory_count = llGetListLength(inventory_types); integer j; integer k; integer l; integer type; integer typecount; string myname = llGetScriptName(); string objectname; for (j=0; j<inventory_count;j++) { type = llList2Integer(inventory_types,j); // get the next inventory type from the list typecount = llGetInventoryNumber(type); // how many of that kind of inventory is in the box? if (typecount > 0) { for (k=0; k<typecount;k++) { objectname = llGetInventoryName(type,k); if (objectname != myname) // don't give self out so the user doesn't get fifty thousand copies. { llGiveInventory(target,objectname); l=++l; if (l == typecount) { llSay(0,"That's everything, enjoy!"); llDie(); // comment out this line if you don't want the box to delete itself. } } } } } } } }
|