Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

StartAnimation Question

Arken Soothsayer
Reaver
Join date: 23 Oct 2005
Posts: 152
08-11-2009 07:31
I just need to know how to make something play one animation or another, or another.
For example, I have something that when I hit DOWN an animation plays. How can I get that same key to trigger a different animation either at random or every other time the key is pressed?
_____________________
Elm he do brood and Oak he do hate, but the Willow Man goes a walkin', if you stays out too late.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
08-11-2009 08:04
Just use llStartAnimation. See . If you are planning to offer users a choice of animations, one of the best ways is to load the animation names in a list and then use the list to key choices in a llDialog call, from which you trigger the chosen animation. See . There are short examples on each of the two pages I referenced, so you can get an idea of how to do the job.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Arken Soothsayer
Reaver
Join date: 23 Oct 2005
Posts: 152
08-11-2009 08:27
I know how to make it play one animation, I'm no tlooking for anyone to have choices, no clicking, no choosing.

Example again, I hit PgDn, animation one plays, I hit PgDn again, animation 2 plays and so on.

I already have it working with just one animation.

Thanks for the reply tho.
_____________________
Elm he do brood and Oak he do hate, but the Willow Man goes a walkin', if you stays out too late.
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
08-11-2009 09:08
list animations = ["animation1", "animation 2"];
integer animation;


Now, instead of calling llStartAnimation("Animation1";), call llStartAnimation(llList2String(animations, animation)), and then at the end of the touch_start() event add "animation = !animation".
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Arken Soothsayer
Reaver
Join date: 23 Oct 2005
Posts: 152
08-11-2009 19:21
Thanks, I almost got it, I think. My script uses on_rez(integer start). I'm guessing that's where I add the "animation = !animation". but I'm getting syntax errors. So exactly where do I put "animation = !animation", in what way after the start or am I just in the wrong spot in the script?

I'm not sure if this is worth mentioning, but the script saves if I leave out "animation = !animation" but animation 1 plays every time.
_____________________
Elm he do brood and Oak he do hate, but the Willow Man goes a walkin', if you stays out too late.
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
08-11-2009 20:42
You need to make it a whole statement. "animation = !animation;" with a semicolon at the end.
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Arken Soothsayer
Reaver
Join date: 23 Oct 2005
Posts: 152
08-11-2009 20:59
Ok, but again the script does not have any touch_start in it.

on_rez(integer start)
animation = !animation;

The above does not work. "animation = !animation;" will save in other places, but then again only one animation will play.

I could show you the script if you like, I'd rather send it to you in world but here. But either way, is there some other place you'd know for sure the "animation = !animation;" is supposed to go?

Thanks!
_____________________
Elm he do brood and Oak he do hate, but the Willow Man goes a walkin', if you stays out too late.
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
08-12-2009 02:52
From: Arken Soothsayer
Ok, but again the script does not have any touch_start in it.
OK, in whatever event you have the animation playing, change the animation you play (by toggling the "animation" variable with "animation = !animation;";) at the _end_ of that event.

The code listed in your message does not compile because an event must be a block.
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Arken Soothsayer
Reaver
Join date: 23 Oct 2005
Posts: 152
08-12-2009 03:41
Working perfect now, thank you Argent for your help!
_____________________
Elm he do brood and Oak he do hate, but the Willow Man goes a walkin', if you stays out too late.