Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Menu Animation

Dragos Zaoh
Registered User
Join date: 11 Dec 2006
Posts: 58
06-28-2007 12:31
Name your animations : animation1, animation2,animation3,animation4,animation5.


CODE

vector offset=<0.2,0,0.1>;
key avatar;
integer is_sitting;

default
{
state_entry()
{
llSitTarget(offset,ZERO_ROTATION);
llListen(789789, "", "", "");
avatar = llGetKey();
is_sitting = 0;
}

touch_start(integer num)
{
llDialog(llDetectedKey(0), "Choose your position:", ["animation1", "animation2", "animation3", "animation4", "animation5"], 789789);
}

listen( integer channel, string name, key id, string message )
{
if( message == "animation1" )
{ if (llAvatarOnSitTarget() != NULL_KEY) {
llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);
llSetLinkPrimitiveParams(2, [ PRIM_POSITION,<0,0,0.25>, PRIM_ROTATION,<0,-0.02,0,1> ] );

llStartAnimation("animation1");
}}

if( message == "animation2" )
{if (llAvatarOnSitTarget() != NULL_KEY) {
llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);
llSetLinkPrimitiveParams(2, [ PRIM_POSITION,<0,0,0.5> ,PRIM_ROTATION,<0,-0.03,0,1>] );
llStartAnimation("animation2");
}}
if( message == "animation3" )
{if (llAvatarOnSitTarget() != NULL_KEY) {
llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);
llSetLinkPrimitiveParams(2, [ PRIM_POSITION,<0.3,0,0.42> ] );
llStartAnimation("animation3");
}}
if( message == "animation4" )
{if (llAvatarOnSitTarget() != NULL_KEY) {

llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);
llSetLinkPrimitiveParams(2, [ PRIM_POSITION,<0,0,1.4>,PRIM_ROTATION,<0,0,0,1> ] );
llStartAnimation("animation4"); }}
if( message == "animation5" )
{
if (llAvatarOnSitTarget() != NULL_KEY) {
llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);
llSetLinkPrimitiveParams(2, [ PRIM_POSITION,<0,0,0.41> ] );
llStartAnimation("animation5");
}}


}

changed(integer change)
{
if(change & CHANGED_LINK)
{
key avatar = llAvatarOnSitTarget();

if(avatar != NULL_KEY)
{
llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION);
llSetLinkPrimitiveParams(2, [ PRIM_POSITION,<0,0,0.25>, PRIM_ROTATION,<0,-0.02,0,1> ] );

llStartAnimation("animation1");
}
else
{
if((llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) && is_sitting)
{
is_sitting = 0;
llStopAnimation("animation1");
llStopAnimation("animation2");
llStopAnimation("animation3");
llStopAnimation("animation4");
llStopAnimation("animation5");



}
}

}

}

run_time_permissions(integer a)
{
if (a & PERMISSION_TRIGGER_ANIMATION)
{
string null=(string)NULL_KEY;
list a=llGetAnimationList(avatar);
integer b;
for (b;b<llGetListLength(a);b++)
{
if (llList2String(a,b)!= null )
{
if(llList2String(a,b) != "2408fe9e-df1d-1d7d-f4ff-1384fa7b350f")
{
llStopAnimation(llList2String(a,b));
}
}
}

}

}

on_rez(integer start_param)
{
llResetScript();
}

}
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion Thread
06-29-2007 00:23
/54/e1/194141/1.html
_____________________
i've got nothing. ;)
Irsa Dabu
Registered User
Join date: 16 Jan 2007
Posts: 6
Ty!
07-05-2007 09:35
Thank you Dragos for this script. I can't wait to try it...
;)

Irsa
Bizcut Vanbrugh
Registered User
Join date: 23 Jul 2006
Posts: 99
07-07-2007 18:40
yes i tried it out as i thought that this would be the answer to a thing i have been looking for BUT. for some reason i keep getting turned upside down when i sit on the object and it reall doesnt do the anims or at least not after the first one is chosen. i must be doing something wrong
Bizcut Vanbrugh
Registered User
Join date: 23 Jul 2006
Posts: 99
07-09-2007 20:37
i used this script and it keeps turning me upsdie down and it seems to not cycle thru the anims correctly am i doing somehing wrong ?
Rhiannon Arkin
Registered User
Join date: 7 Jan 2007
Posts: 9
07-10-2007 05:40
Hi.
i am trying to use this script but with no real success. While it starts my animation i can't switch to the next. Seems like it doesn't stop the previous animation before starting the new one.

There is one part of the script that i don't understand.
what is that key doing in here, and who's key is that ?

any help greatly appreciated.


CODE


run_time_permissions(integer a)
{
if (a & PERMISSION_TRIGGER_ANIMATION)
{
string null=(string)NULL_KEY;
list a=llGetAnimationList(avatar);
integer b;
for (b;b<llGetListLength(a);b++)
{
if (llList2String(a,b)!= null )
{
if(llList2String(a,b) != "2408fe9e-df1d-1d7d-f4ff-1384fa7b350f")
{
llStopAnimation(llList2String(a,b));

[end code]
jefferey Heart
Registered User
Join date: 25 Jan 2006
Posts: 45
Nice idea
07-11-2007 15:41
Would be even better if someone could merge this with the Adjustable Rotation and Position script that was in Database here a while back. Storing the rotation for the anim's in the script seem to be a hard way to deal with the variables that one encounters with differing sizes of AVIES and the method listed a while back seems to be a GREAT way to deal with that but detecting Size and Base rotation and then allowing user to adjust from there.