Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Random Pose / Animation Player Help

Wolfgang Zhichao
Registered User
Join date: 6 Jan 2007
Posts: 10
06-24-2007 14:43
Howdy all!

First, thanks to all for all the great help given out, i'm SLOWLY learning...

ok, here is what i am wanting to do... i want to put poses and animations in a prim and have each played for like 30 seconds or do. does not need to be in any special order, can be random.

I want to create a stand that i can have an AV stand on and will play all the poses and animations endlessly untill they stand up. all they need to do is accept the initial "were going to animate your AV" popup and it goes on from there.

Thanks a bunch!
Cryas Tokhes
Great Googley Moogley...
Join date: 8 Feb 2006
Posts: 124
06-24-2007 17:57
This one sounded quite fun, so here you go...

CODE

list poseList = ["pose1","pose2","pose3"]; // Add as many poses/animations as you want, just continue the trend of adding names
string pose;
integer gTimer = 30;
default
{
state_entry()
{
llSitTarget(<0.0, 0.0, 0.1>, ZERO_ROTATION); // You might need to change the 0.1 to the proper height for your animations... (it changes the height in the Z direction)
}

on_rez(integer iStartup)
{
llResetScript();
}

changed(integer change)
{ // something changed
if (llAvatarOnSitTarget() != NULL_KEY)
{ // somebody is sitting on me
llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);
pose = llList2String(llListRandomize(poseList,1),0);
llStartAnimation( pose );
llSetTimerEvent(gTimer);
}
}

timer()
{
llStopAnimation( pose );
pose = llList2String(llListRandomize(poseList,1),0);
llStartAnimation( pose );
}
}

Wolfgang Zhichao
Registered User
Join date: 6 Jan 2007
Posts: 10
Woot!
06-25-2007 22:17
Thanks a bunch!

works great!

now, question... could you use something like an llGetInvintory for it to just read the animations in the prim or am i just being all goofy?
Simnelia Petrichor
Registered User
Join date: 10 Feb 2006
Posts: 35
06-26-2007 01:56
From: Wolfgang Zhichao
Thanks a bunch!

works great!

now, question... could you use something like an llGetInvintory for it to just read the animations in the prim or am i just being all goofy?

Lol. Yes, and yes ;)

I'd put something like this in the state_entry:

integer animations = llGetInventoryNumber(INVENTORY_ANIMATION);
integer i;
for (i=0; i<animations; i++)
{
poselist = poselist + llGetInventoryName(INVENTORY_ANIMATION,i);
}
Cryas Tokhes
Great Googley Moogley...
Join date: 8 Feb 2006
Posts: 124
06-26-2007 19:16
From: Wolfgang Zhichao
Thanks a bunch!

works great!

now, question... could you use something like an llGetInvintory for it to just read the animations in the prim or am i just being all goofy?


It works? LOL! I was fully expecting a message like. "Err... you suck! Get off the board." I'm glad it worked out for you. Simnelia is correct with that script. If you need help implementing it into that script, just ask either on here or in SL.
Wolfgang Zhichao
Registered User
Join date: 6 Jan 2007
Posts: 10
grr
07-03-2007 19:13
well, that time out i had sucked! My internet went out:( *CRIES*

well, now that i am back, i'll try to mess with that change then... thanks a bunch!