Dispense, Attach, Die ... ?
|
|
Sue Stonebender
Piano Craftsman
Join date: 7 Jan 2005
Posts: 219
|
10-15-2005 21:02
Here's what I understand to be true:- I can have an object rez another object;
- I can automatically attach this new object to an avatar ONLY if they are the owner of the dispensing object (and therefore the owner of the newly rezzed object);
- I cannot automate the detachment of this object using a script inside the object, nor can I cause it to die after a certain amount of time after it's been attached.
Correct? Want someone to tell me I'm wrong, or that an update makes these things possible. Guessing it's like hoping there's really a Santa Claus, right? ... LOL Sue.
|
|
Sue Stonebender
Piano Craftsman
Join date: 7 Jan 2005
Posts: 219
|
And ...
10-15-2005 21:06
Banging my head against the desk trying to find a workaround ...
I'm curious about something: sometimes when you purchase a box of clothes, it will automatically put them on you unelss you uncheck the wear box. It recognizes that they're wearable objects, and when you buy them, you become the owner. You don't have to drag them out of your inventory. It just puts them on you. How does that happen?
Following the logic of this example, would it not make sense that an object designed to attach to a certain body part could automatically be worn when dispensed from the parent object too?
Is this merely a function of "buy" where it is showing you the contents of what you're purchasing? ... and therefore not available for something like onrez?
|
|
Zapoteth Zaius
Is back
Join date: 14 Feb 2004
Posts: 5,634
|
10-16-2005 03:51
From: Sue Stonebender Banging my head against the desk trying to find a workaround ...
I'm curious about something: sometimes when you purchase a box of clothes, it will automatically put them on you unelss you uncheck the wear box. It recognizes that they're wearable objects, and when you buy them, you become the owner. You don't have to drag them out of your inventory. It just puts them on you. How does that happen?
Following the logic of this example, would it not make sense that an object designed to attach to a certain body part could automatically be worn when dispensed from the parent object too?
Is this merely a function of "buy" where it is showing you the contents of what you're purchasing? ... and therefore not available for something like onrez? As far as I know what you said in your first post is true. As for the purchasing a box of clothes, the wear now function is built into SL, not a script. It happens when you set an object to sell the "contents" of the object you're marking for sale. You can put the items you want to sell in the "contents" tab of a box, put a picture of whatever it is on the box, set it to sale for however much and check the contents box. --Zap Edit  S: You wouldn't be trying to make a try before you buy type script would you? There are lots of reasons this won't work other than script functioning..
_____________________
I have the right to remain silent. Anything I say will be misquoted and used against me.--------------- Zapoteth Designs, Temotu (100,50)--------------- 
|
|
Sue Stonebender
Piano Craftsman
Join date: 7 Jan 2005
Posts: 219
|
An Example
10-16-2005 06:37
Thanks a bunch, Zapoteth No, what I'm trying to do is not about clothes. I'm trying to create interactive learning stations. One of the simpler ones is a coffee dispenser with "Fair Trade" information. I was hoping to have the coffee machine in the café dispense a cup that would then attach to the hand of the person that touched the machine. (The cup then has a "say" function that offers some simple information via the chat channel, and offers the person a notecard with more detailed information). I can do this (get the coffee machine to give the person a cup and attach it to their hand) as long as the avatar who touches the coffee machine is the owner, but it doesn't work for anyone else who touches it. There are other objects that are a bit more complex, including animations, but this example should give you the basic gist of what I'm up to.
|
|
Zapoteth Zaius
Is back
Join date: 14 Feb 2004
Posts: 5,634
|
10-16-2005 06:44
From: Sue Stonebender Thanks a bunch, Zapoteth No, what I'm trying to do is not about clothes. I'm trying to create interactive learning stations. One of the simpler ones is a coffee dispenser with "Fair Trade" information. I was hoping to have the coffee machine in the café dispense a cup that would then attach to the hand of the person that touched the machine. (The cup then has a "say" function that offers some simple information via the chat channel, and offers the person a notecard with more detailed information). I can do this (get the coffee machine to give the person a cup and attach it to their hand) as long as the avatar who touches the coffee machine is the owner, but it doesn't work for anyone else who touches it. There are other objects that are a bit more complex, including animations, but this example should give you the basic gist of what I'm up to. Hmm.. I'm not a scripter, but I can't think of a way to do it the way you want.. I would just get the coffee machine to send them the cup of coffee when you click it, and make sure the name was something like "Coffee (attach me)". But theres a fair chance someone cleverer than me will come along when the US wakes up and tell you how to do it, it wouldn't be the first time 
_____________________
I have the right to remain silent. Anything I say will be misquoted and used against me.--------------- Zapoteth Designs, Temotu (100,50)--------------- 
|
|
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
10-16-2005 07:58
From the WIKI From: someone Attaches the scripted object at the specified attachment point to the avatar it has PERMISSION_ATTACH for. Even though users other than the owner can grant this permission, attaching to them will fail with the message "Script trying to attach to someone other than owner!".
So...basically...yea...you'll just have to give any non-owner a cup of coffee in their inventory (at which point they become the owner of the coffee and can "wear" it on their own).
|
|
Zeno Concord
To infinity, and beyond!
Join date: 28 Mar 2005
Posts: 51
|
10-16-2005 11:21
I agree that it is not nice to make the person dig through their inventory for an object they were just given in order to attach it. Here is an idea that might have a better user experience - I don't know if it is possible, but it seems plausible.
How about if the vendor rezzes a copy of the object into the world, and then the buyer/receiver can attach it from there using right-click attach? This might work fine for free objects which anyone is allowed to pick up. It doesnt sound much harder to prevent anyone but the buyer from actually doing the attach.
This might be a key requirement: Can an object transfer its ownership to someone else without going through the buy or give-inventory process?
|
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
10-16-2005 16:05
From: Zeno Concord This might be a key requirement: Can an object transfer its ownership to someone else without going through the buy or give-inventory process?
This is the big stumbling block in terms of what we're talking about here. Right now there is no way for an object to change owner without user interaction. There is a way to change owner whilst remaing rezzed, however. Have the previous owner set the object to "For Sale - Original". The new owner can then buy the object, this triggers a changed event. The object could then request PERMISSION_ATTACH from the new owner and attach itself. Here's something that might help with this: // Where should it attach on the new owner. integer ATTACH_POINT = ATTACH_RHAND;
// Props to LL for implementing this in the LSL compiler. integer CHANGED_OWNER = 128; default { changed(integer change) { if (change & CHANGED_OWNER) { llRequestPermissions(llGetOwner(), PERMISSION_ATTACH); } } run_time_permissions(integer perms) { if (perms & PERMISSION_ATTACH) { // New owner will let me attach. llAttachToAvatar(ATTACH_POINT); } else { // New owner wont let me attach. // IM new owner, die, do stuff? } } }
==Chris
|