Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Attaching an object to another AV

Happy Bedlam
Registered User
Join date: 15 Jan 2006
Posts: 48
12-31-2006 14:16
I have a tea drinking animation set in a chair... is it possible to rez and attach an obect (tea cup) to the hand of an AV that sits on the chair? If so, is there an available script that does something simular?
Zozo Plympton
Registered User
Join date: 26 Oct 2006
Posts: 26
12-31-2006 15:44
Accroding to my knowledge this is not possible and I would be VERY surprised if anybody would come up even with a workaround for this.

Allowing objects to be attached to other AVs would be a serious security risk...

Under the description for llAttachToAvatar() in Wiki you will find:

llAttachToAvatar(integer attachment)

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!".*******

just my 2c.
Zozo
Ruuh Cassini
Registered User
Join date: 7 Dec 2006
Posts: 8
12-31-2006 16:51
I don't have time to read wikis and the like - so I may be suggesting something already discussed elsewhere ...but anyway...

What if the chair/coffee script is deeded to a group, and hypothetically everyone sitting can be guaranteed to be a member of that group (using restrcited access or something) - would it work then?
Vares Solvang
It's all Relative
Join date: 26 Jan 2005
Posts: 2,235
12-31-2006 16:53
The only thing you can do is have it give the object to the av and then they can wear it to attach it.
_____________________
Happy Bedlam
Registered User
Join date: 15 Jan 2006
Posts: 48
12-31-2006 18:30
Zozo, thats pretty much what I was thinking, but thought to as anyway... thanks all for the responses and thoughts
Dilbert Cleanslate
Registered User
Join date: 18 Nov 2006
Posts: 9
Attaching an object to another AV
01-01-2007 14:34
Is there really no workaround to this problem? I understand the security risk, but if the AV is prompted for permission, I don't see how it's any worse than giving an object with llGiveInventory and starting a script when the avatar attaches it. There's always the possibility that a script contains a Trojan Horse, and with the paranoia about CopyBots most of the scripts seem to be nocopy these days, so you can't visually check them first.

I have been working on an application where an avatar needs to agree to have an object attached, after which an animation is run and new game features are enabled. I initially rezzed a copy of the object, and when the avatar touched it, used llGetPermissions to get permission to attach, and then tried to use llAttachToAvatar. Of course it failed because the object wasn't owned by the avatar. If I use llGiveInventory, I can give the avatar a copy of the object, but scripts will not be run, so the avatar would have to manually select that item from inventory and attach it. That really destroys the flow of the action. I'm amazed nobody has solved this problem or found a workaround, and I'd really like to hear from folks that have tried. Thanks!
Dazzo Street
Registered User
Join date: 1 Aug 2004
Posts: 71
01-01-2007 20:49
heres an idea for you. have the teacup attached to a prim below and behind the chair. use llSetPrimativeParams to rotate the cup up and down on timer events. Have the chair run an animation of the person sipping tea. Sinchronize the anim with the moving cup.
Yumi Murakami
DoIt!AttachTheEarOfACat!
Join date: 27 Sep 2005
Posts: 6,860
01-01-2007 21:30
From: Dilbert Cleanslate
Is there really no workaround to this problem? I understand the security risk, but if the AV is prompted for permission, I don't see how it's any worse than giving an object with llGiveInventory and starting a script when the avatar attaches it.


The problem is that there'd be a huge issue with permissions when it came to having an item owned by somebody else attached to your avatar, where it might stay for days or weeks afterwards.

If you detach it, does it go back to your inventory or theirs? If they had modify permission on it, do you? Can you invoke scripts on it that might modify it? When you detach it, does the other person get the modified version back? Can the other person detach it too, if they want their item back? What do they click on to do so?

The nearest thing I can see to this is the apparantly recently-discovered "Lulu Loophole" (after Lulu Ludovico, who seems to have discovered it) which allows newly rezzed objects to attach (to their owner) instantly, without needing to ask attach permission, if they're set up properly first. I've asked on Linden Answers if this is actually allowed (ie, it's not a case of "the Lindens designed it so that you have to ask for permission, therefore they do not want you to attach stuff without permission, no matter how cleverly you can script";) so as long as it's ok, this might help to speed up the flow of a game that uses attachments, although the player will have to wear something else in advance.
Samantha Fuller
Registered User
Join date: 8 Sep 2006
Posts: 15
01-01-2007 22:43
Ive thought about this problem in another context, I was going to design a frizbe and realized it woud have to be a vehicile using sit target to catch then a AO type script to control the av after catching it before throwing it with the stand up button. Probly won't work for this paticular problem though.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
01-02-2007 02:05
From: Dilbert Cleanslate
Is there really no workaround to this problem? I understand the security risk, but if the AV is prompted for permission, I don't see how it's any worse than giving an object with llGiveInventory and starting a script when the avatar attaches it. There's always the possibility that a script contains a Trojan Horse, and with the paranoia about CopyBots most of the scripts seem to be nocopy these days, so you can't visually check them first.

I have been working on an application where an avatar needs to agree to have an object attached, after which an animation is run and new game features are enabled. I initially rezzed a copy of the object, and when the avatar touched it, used llGetPermissions to get permission to attach, and then tried to use llAttachToAvatar. Of course it failed because the object wasn't owned by the avatar. If I use llGiveInventory, I can give the avatar a copy of the object, but scripts will not be run, so the avatar would have to manually select that item from inventory and attach it. That really destroys the flow of the action. I'm amazed nobody has solved this problem or found a workaround, and I'd really like to hear from folks that have tried. Thanks!


The work around is forward planning. I dont mean that to sound condescending and apologies if I do.

You create your objects such that their special abilities can be activated when required not as an add on. i.e everything is built into the base unit. If for instance the player touches some mystic rock that empowers their sword with fire then the sword hears a broadcast from the rock saying activate power Fire and makes its inbuilt flame effect work.
Peekay Semyorka
Registered User
Join date: 18 Nov 2006
Posts: 337
01-02-2007 02:21
That's not always possible. Going back to the tea cup example, suppose I wanted to script a Japanese Tea Ceremony for guests.

I could animate all participating avatars to go through the ritual motions, but there is no way currently to have a guest pick up the tea cup at the appropriate time, "pass" it to the next guest, etc.

-peekay
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
01-02-2007 02:38
Oh I agree its not always possible but somethings can be planned in. Dilbert mentioned new game features which is what I was meaning to address.

Forward planning would highlight situation where things would get tricky, like your tea ceremony. In that particualr instance I'd probably try having each guest have a tea cup and then use timers to trigger visibility of each as they are passed around.
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
01-02-2007 02:49
"touch for teacup"

teapot delevers a teacup. Each person wears it and takes a seat

Seat reads UUID of user. Teacup reads UUID of Owner. Teapot says Chair one" chair 1 runs animation one. triggers avatar to reach for visible cup. Sends command "UUID of person sitting on chair 1" into the ether. Teacup hears the UUID of it's owner, and becomes visible, Animation runs, Avatar 1 drinks, reaches over to avatar 2. Avatar 2 begins animation, reaches up to user 1's cup, and then visibility switches. User 2's cup appears and user 1's cup goes invisible.. etc.

At the end of the ceremony, a special keyword is sent out, the cups all go into a "dead" state, renames itself (empty teacup, delete)and unwears. The cup will unwear if user attempts to wear it, and delete itself if rezzed.

It's POSSIBLE.

but given varying avatar heights, uncertainty of animations loading at certain times, etc... It might take a great deal of work. WOrth it? Probably! If you want one bad enough. if you goal is to sell it.. it may not be cost effective to produce in terms of work in vs money out.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura