Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Candle on Sat 15/07/2006 07:45:10

Title: Animate character
Post by: Candle on Sat 15/07/2006 07:45:10
I use to animate character  but if you click on him to talk when he is done talking he does not start to animate I think he is going back to the standard idle view?
How can I make him start doing his animate again.
character[FAMER].Animate(0, 1,eRepeat, eNoBlock, eForwards);
Title: Re: Animate character
Post by: monkey0506 on Sat 15/07/2006 07:51:33
Hmm...is that the exact code you used?

Quote from: The ManualBefore using this command, you should use LockView in order to select the view you want to animate with and prevent any automatic animations (eg. walking or idle animations) from playing.

So try doing something like this:

cFamer.LockView(VIEW_NUM);
cFamer.Animate(0, 1, eRepeat, eNoBlock, eForwards);
Wait(80);
cFamer.UnlockView();


That would animate Famer for two seconds...just an example since I don't know the exact situation...but just make sure when you're done animating Famer you release his view with cFamer.UnlockView() (character[FAMER].UnlockView() is the same thing).
Title: Re: Animate character
Post by: Candle on Sat 15/07/2006 07:56:59
Well I want him to run all the time as he is just working a hoe in a field so when you talk to him he talks and when done he goes back to work .
Title: Re: Animate character
Post by: Ashen on Sat 15/07/2006 13:23:46
BFAQ: Having a character continuously animated in the background. (http://americangirlscouts.org/agswiki/index.php/Scripting%2C_Code_%26_Interaction#Having_a_character_continuously_animated_in_the_background)

If there's some reason you're not using the idle anim: Where are you calling Character.Animate? Perhaps you need to call it again, after talking to the character, since the speaking view is one of those 'automatic animations' (I think) that will stop any previous Animate commands.
Title: Re: Animate character
Post by: Candle on Sat 15/07/2006 17:13:51
Thanks Ashen,
QuotePerhaps you need to call it again
How do I call it again?
Title: Re: Animate character
Post by: Ashen on Sat 15/07/2006 23:04:29
Just put it in the script again, e.g.:

cFamer.Say("Goodbye, then.");
player.Say ("Yeah, bye.");
cFamer.Animate(0, 1, eRepeat, eNoBlock, eForwards);


If you're using a dialog, you're probably better calling it using run_script in the last dialog option.
Title: Re: Animate character
Post by: Candle on Sat 15/07/2006 23:21:49
Looks good thanks.
Title: Re: Animate character
Post by: Hammerite on Sun 16/07/2006 20:49:52
Quote from: Candle on Sat 15/07/2006 07:56:59
Well I want him to run all the time as he is just working a hoe in a field .

hehehehe ;)