help ! animations sets to switch !

Non-platform specific questions.

help ! animations sets to switch !

Postby naddie » Sun Jun 08, 2008 9:34 pm

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 =)
User avatar
naddie
 
Posts: 6
Joined: Fri Dec 28, 2007 5:07 pm
Score: 0 Give a positive score

Re: help ! animations sets to switch !

Postby feral » Sun Jun 08, 2008 10:57 pm

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
User avatar
feral
 
Posts: 308
Joined: Sun Mar 16, 2008 6:27 am
Score: 47 Give a positive score

Re: help ! animations sets to switch !

Postby naddie » Mon Jun 09, 2008 12:28 pm

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 =/
Attachments
animchange.zip
the program
(25.75 KiB) Downloaded 91 times
User avatar
naddie
 
Posts: 6
Joined: Fri Dec 28, 2007 5:07 pm
Score: 0 Give a positive score

Re: help ! animations sets to switch !

Postby DST » Mon Jun 09, 2008 1:15 pm

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.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron