Random animations?

Game Editor comments and discussion.

Random animations?

Postby Diana Kennedy » Fri Jun 02, 2006 11:24 pm

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.
User avatar
Diana Kennedy
 
Posts: 257
Joined: Wed Dec 07, 2005 12:34 am
Location: France, where Presidents who got shot in Texas do exile ;-)
Score: 0 Give a positive score

Postby Troodon » Sat Jun 03, 2006 7:49 am

I'm not sure if I understood right your question, but you can use random animpos.
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Diana Kennedy » Sat Jun 03, 2006 8:09 am

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?
User avatar
Diana Kennedy
 
Posts: 257
Joined: Wed Dec 07, 2005 12:34 am
Location: France, where Presidents who got shot in Texas do exile ;-)
Score: 0 Give a positive score

Postby Novice » Sat Jun 03, 2006 9:40 am

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.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby Diana Kennedy » Sat Jun 03, 2006 10:32 am

Cool! VERY COOL! 8) 8)
User avatar
Diana Kennedy
 
Posts: 257
Joined: Wed Dec 07, 2005 12:34 am
Location: France, where Presidents who got shot in Texas do exile ;-)
Score: 0 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest