Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Virgil on Mon 28/09/2009 03:27:52

Title: Default to Pose When Not Walking (Solved)
Post by: Virgil on Mon 28/09/2009 03:27:52
Okay, so, say in a side scroller, when my characters stops walking, I want him to stand in a specific pose, so he's not midstep.

I have this in..

function room_AfterFadeIn(){
 
 if(!IsKeyPressed(eKeyLeftArrow) || !IsKeyPressed(eKeyRightArrow)){
   cCharacter.Say("Done.");
  }
}


Just to check if the character was moving or not. After that I would just do an Animate with one frame in it, until the character decided to move again. However, when I load up my room, the character says 'Done.' When I move around and stop, it doesn't respond. If I have it on Repeatedly Execute, I can't move at all, and the character just says 'Done."

I know there's a way to go about this, but I can't figure it out.. thanks for any help.
Title: Re: Default to Pose When Not Walking
Post by: Tijne on Mon 28/09/2009 05:05:58
Ex. Code:

bool DidAction = true;

function repeatedly_execute()
{
  if( !IsKeyPressed(eKeyLeftArrow) && !IsKeyPressed(eKeyRightArrow) && DidAction == false)
{
   DidAction = true;
   cCharacter.Say("Done.");
}
else { DidAction = false; }
}


Hope that helps! 
Title: Re: Default to Pose When Not Walking
Post by: Virgil on Mon 28/09/2009 13:42:37
Beautiful, thanks a lot.
Title: Re: Default to Pose When Not Walking (Solved)
Post by: TerranRich on Mon 28/09/2009 18:08:36
Am I missing something, or isn't the first frame of a walking animation supposed to be the standing-still pose?
Title: Re: Default to Pose When Not Walking (Solved)
Post by: Virgil on Mon 28/09/2009 18:16:11
You're right. Maybe I was over thinking things.. I suppose I never noticed.