Page 1 of 1

Random animations?

PostPosted: Fri Jun 02, 2006 11:24 pm
by Diana Kennedy
Well, as we know, we can make actors appear randomly.

Is there theoretically also a way to make animations happen randomly? I.e the "change animation" event not to be pointed to a special animation but to be choosen randomly among a defined series of animations contained in the actor (not all!) This would be great for fighting figures, their actions could become more unpredictable.

PostPosted: Sat Jun 03, 2006 7:49 am
by Troodon
I'm not sure if I understood right your question, but you can use random animpos.

PostPosted: Sat Jun 03, 2006 8:09 am
by Diana Kennedy
And I am not sure if I understood your answer ;) "animpos?"

The question was:

An actor can contain different animations. Normally you manage it via events which animation is played when and why. Can it be done, that as a response to an event, a random animation within the actor is played?

PostPosted: Sat Jun 03, 2006 9:40 am
by Novice
Code: Select all
int i=round(rand(your number of animations));
switch(i)
{
case(0):
Change Animation (...
break;
case(1):
Change Animation (...
break;
...
}

It can be also done with an if statement, but it's easier with a switch if there are many animations.

PostPosted: Sat Jun 03, 2006 10:32 am
by Diana Kennedy
Cool! VERY COOL! 8) 8)