Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

attaching multiple objects at once

Brendan Etzel
Registered User
Join date: 22 Jul 2007
Posts: 33
04-05-2009 06:44
I have a bottle and a glass, the glass has a drinking animation, so far so good.
There is also a bottle that will be worn in the other hand.

Is it possible to make the bottle load from the glass's contents and then be attached to the other hand?
Any pointers would be helpfull

Thanks,
Keira Wells
Blender Sculptor
Join date: 16 Mar 2008
Posts: 2,371
04-05-2009 07:39
From: Brendan Etzel
I have a bottle and a glass, the glass has a drinking animation, so far so good.
There is also a bottle that will be worn in the other hand.

Is it possible to make the bottle load from the glass's contents and then be attached to the other hand?
Any pointers would be helpfull

Thanks,

It would have to rez onto the ground using llRezObject, THEN attach, by first asking permission to with llRequestPermissions(llOwner, PERMISSION_ATTACH), and if it has permission, attaching with llAttachToAvatar().

Something like this would work, I think.

For the glass (This is just for creating the bottle, does not include the drink script)
CODE

touch_start(integer number)
{
llRezObject("bottle",llGetPos()+<1,1,0);
}


And for the bottle to attach,
CODE

integer perm=llGetPermissions()
on_rez(integer start_param)
{
if(perm & PERMISSION_ATTACH)
{
llAttachToAvatar(5);
}
else
{
llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
}
}
run_time_permissions(integer perm)
{
if(perm == 32)
{
llAttachToAvatar(5);
}
}
_____________________
Tutorials for Sculpties using Blender!
Http://www.youtube.com/user/BlenderSL
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
04-05-2009 11:49
but if both objects are in the same folder in inventory, wearing the folder (or dragging it to your av) will attach multiple items with different attach points.

that's how most people quickly change their entire av, (replace outfit), but works just as well to augment (add to outfit)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
04-06-2009 06:38
You can have the glass rez the bottle and have the bottle then attach to your other hand -- I've just tried this, and it works -- by using the "Lulu Loophole" as described at /54/b4/210611/1.html
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
04-06-2009 10:35
note, I don't believe any method other than foldering is going to work on no-build land, so be warned.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Brendan Etzel
Registered User
Join date: 22 Jul 2007
Posts: 33
04-07-2009 11:56
that's what is puzzling me...


I put this script in the bottle which work if you have right to rezz an object on the land:

default
{
//state_entry()
on_rez(integer start_param)

{
llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
}
run_time_permissions(integer perm)
{
if(PERMISSION_ATTACH & perm)
{
llAttachToAvatar(5); // attach to left hand
}
}
}



But what if you don't have rights? Is there a workaround for this ?


Thanks
Keira Wells
Blender Sculptor
Join date: 16 Mar 2008
Posts: 2,371
04-07-2009 19:38
From: Brendan Etzel
that's what is puzzling me...


I put this script in the bottle which work if you have right to rezz an object on the land:

default
{
//state_entry()
on_rez(integer start_param)

{
llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
}
run_time_permissions(integer perm)
{
if(PERMISSION_ATTACH & perm)
{
llAttachToAvatar(5); // attach to left hand
}
}
}



But what if you don't have rights? Is there a workaround for this ?


Thanks

Nope, unfortunately no workaround. There's no way to attach something by script without first rezzing it, and if you don't have rez rights there's no way to rez it. Simple as that.

HOWEVER, as said before, you could simply attach both from inventory, as this is possible without build rights.

Also, I feel it should be noted, every time that the bottle is attached by script, it's also put into the avatar's inventory, and over time they may accumulate many bottles.
_____________________
Tutorials for Sculpties using Blender!
Http://www.youtube.com/user/BlenderSL
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
04-07-2009 21:50
why not just have the bottle always worn, and listen for a command from the glass to show/hide?
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369