Page 1 of 1

help ! animations sets to switch !

PostPosted: Sun Jun 08, 2008 9:34 pm
by naddie
HEy Hi ged peoples!!

I want to make a small program that randomize gifs animations with GE ! I already
made the script for randomizing 5 gifs but i'd like to add a function that would
permit to change between different sets of animations !
The problem is i'm really bad at code and dont have any clue how to do this =(

To be clear i got my three sets of five anims and want to create a script function
that could switch forward & backward through the 3 sets. Like press key (a) could go to the second set and
repressing key (a) could go to the third set of anims !

If someone got a script like this, would help me a lot to build my prog =)

good works on this forum, keep it up !
cheerio dudes =)

Re: help ! animations sets to switch !

PostPosted: Sun Jun 08, 2008 10:57 pm
by feral
see post viewtopic.php?f=6&t=5767
there are other examples around..probably better ones

but this one does what you need ( although for a different purpose ) it will work with what you need to

download animspeed.zip

it is meant to swap between the same 6 animations set at different speeds, but essentially all it does is change between 6 different animation of any kind..

feral

Re: help ! animations sets to switch !

PostPosted: Mon Jun 09, 2008 12:28 pm
by naddie
thanks !! basically that's it but i want to make a script that can change the animations banks (crash1, crash2, crash3) like pushing (b) goes from crash1 to crash2 to crash 3 animation bank =/ and thats where i get stuck because i dont get which function could do it and how this should work ?
For the moment the randomizing works with 3 buttons but i want to suppress that so that i can change the animation bank by one button so i can add more animations banks =/

Re: help ! animations sets to switch !

PostPosted: Mon Jun 09, 2008 1:15 pm
by DST
use a case switch.

Remove the script you've got and use this instead.
I used randomanim but you can use any variable name you want.

Code: Select all
switch(randomanim){
case 0:
ChangeAnimation("Event Actor", "011", FORWARD);
randomanim=1;
break;
case 1:
ChangeAnimation("Event Actor", "012", FORWARD);
randomanim=2;
break;
case 2:
ChangeAnimation("Event Actor", "013", FORWARD);
randomanim=0;
break;

}


Add as many cases to it as you like. Notice how the last case resets ur variable to 0 so that it loops back to the beginning.