In Event Add/Key Down/ I add a Chang Animation move. So that it switches to some move.
for example a punch. after i release i expect it to go back to the standby animation which is just standing and breathing.
So i thought i set it to return to the STANDBY Images in the Even Add/Key up/ and so i did that and i said Repeat DISABLED thinking that it will just do the animation once after pressed and release key. But it doesn't do that, what it does is, i press the key and release it and it keeps looping the punch(or whatever) animation. this is weird.
So how do you do it?
But it's not good to do it in EvenAdd/Key up/Change animation to Standbyimage, because i want the standbyimages to be LEFT or RIGHT depending on which side you are facing, but with Change animation you only select one set of animations...
SO I NEED TO instead add the punch and return to standby images into the script which I use for the LEFT AND RIGHT walking.
I have that in EVENT ADD/DRAWACTOR/SCRIPT
char *key = GetKeyState();
int dir = key[KEY_RIGHT] - key[KEY_LEFT];
switch( dir)
{
case 0 : //None or Both
if( animindex == 0)
{
//Change to standby images
ChangeAnimation( "Event Actor", "StandbyLeft", NO_CHANGE);
}
else if( animindex == 1)
{
//Change to standby images
ChangeAnimation( "Event Actor", "StandbyRight", NO_CHANGE);
}
break;
case -1: //LEFT
x -=5;
ChangeAnimation( "Event Actor","Left", NO_CHANGE);
break;
case 1 : //RIGHT
x +=5;
ChangeAnimation( "Event Actor", "Right", NO_CHANGE);
break;
}
*******
Where in this script do i add the code for responding to user clicking and releasing keys and
make it be so that the animation runs and once it ends it goes back to the appropriate(left or right) standby images depending on which side character is facing?
Before i tried doing putting this after the Swticth statement above, but it didn't work:
if( key[KEY_c]==1){
ChangeAnimation( "Even Actor", "Punch", NO_CHANGE);
if( key[KEY_c} == 0){ //CHANGE BACK TO Approrpriate facing standby animations
if( animindex == 0 )
ChangeAnimation( Even Actor, STANDBYLEFTT, NO CHANGE)
if( animindiex == 1)
ChangeAnimation( Even Actor, STANDBYRIGHT, NO CHANGE)
}
I mean, this did work in Responding to me pressing THE C key.
But once i pressed and released the key once, it kept looping the animation unless i click the arrow keys to move, then it would stop
How do i fix it so that, i press and relase the C key and it executes the animation only once, and then goes back to standbyright or standbyleft