Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Play gesture with attachment?

Jenee Marten
Registered User
Join date: 9 May 2004
Posts: 16
02-08-2006 23:11
I'm trying to get a gesture to play when I attach something to my avatar. At the moment I can get the animation to do it but haven't been able to get the sound to play as well. Also, a HUGE bonus would be to get the attachment to detach after the gesture is done playing.
Help please? Anyone who could solve this problem will get a copy of the avatar I'm making.

Thank you!

Jenee
Hugsy Penguin
Sky Junkie
Join date: 20 Jun 2005
Posts: 851
02-09-2006 00:13
Perhaps the following script will work.

1) place this script in the root prim of the attachment
2) place the animation in the root prim of the attachment
3) set the value of ANIMATION_NAME
4) place the sound in the root prim of the attachment
5) set the value of SOUND_NAME
6) set the value of SOUND_VOLUME
7) set the value of GESTURE_DURATION

When the object is attached, it should simultaneously start playing the animation and the sound. After the gesture duration expires, it should detach itself.

HTH,

HP

CODE

string ANIMATION_NAME = "ENTER ANIMATION NAME HERE";
string SOUND_NAME = "ENTER SOUND NAME HERE";
float SOUND_VOLUME = 1; //min = 0.0; max = 1.0
float GESTURE_DURATION = 5; //seconds

default
{
on_rez(integer start_param)
{
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
llSetTimerEvent(GESTURE_DURATION);
}

timer()
{
llSetTimerEvent(0);
llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
}

run_time_permissions(integer perm)
{
if (perm & PERMISSION_TRIGGER_ANIMATION)
{
llStartAnimation(ANIMATION_NAME);
llPlaySound(SOUND_NAME, SOUND_VOLUME);
}
else if (perm & PERMISSION_ATTACH)
{
llDetachFromAvatar();
}
}
}

Keiki Lemieux
I make HUDDLES
Join date: 8 Jul 2005
Posts: 1,490
02-09-2006 00:37
From: Jenee Marten
I'm trying to get a gesture to play when I attach something to my avatar. At the moment I can get the animation to do it but haven't been able to get the sound to play as well. Also, a HUGE bonus would be to get the attachment to detach after the gesture is done playing.
Help please? Anyone who could solve this problem will get a copy of the avatar I'm making.

Thank you!

Jenee

As might be deduced from the other post, you can mimic gestures with a script, but you cannot play a gesture from a script. There is no function like llStartGesture, which is a shame.
_____________________
imakehuddles.com/wordpress/
Jenee Marten
Registered User
Join date: 9 May 2004
Posts: 16
02-09-2006 01:08
Hugsy YOU ROCK!

Worked PERFECTLY! Give me a bit of time to make a few adjustments and I will send the avie to you!

*big big big big smile*

Jenee