Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Candle on Tue 16/11/2004 10:37:52

Title: Face wrong way
Post by: Candle on Tue 16/11/2004 10:37:52
I'm trying to have it when a click on a door it changes view to one that anims ego  reaching for the door knob but he is facing the wrong way when he anims ?
FaceLocation(EGO,16,121);
AnimateCharacter(EGO,3,0,0);

That must not be right ?

Edit ::
if I do a Quick Character animation it works .
But he is real big so how  do I set the size so he is the same before he clicked the hotspot ?
Or is there a better way ?
Title: Re: Face wrong way
Post by: Gilbert on Wed 17/11/2004 01:36:04
FaceLocation(EGO,16,121);
AnimateCharacter(EGO,character[EGO].loop,0,0);

That's because you fixed the character's animation to use loop 3, which may not be the correct loop after FaceLocation().
Title: Re: Face wrong way
Post by: Candle on Wed 17/11/2004 02:49:26
With this one he does a quick shuffle and then stops  not the one I want to run ?
FaceLocation(EGO,16,121);
AnimateCharacter(EGO,character[EGO].loop,3,0);
The one I want to run is View3 with 6 frames . number 0 on the frame .
Title: Re: Face wrong way
Post by: Gilbert on Wed 17/11/2004 03:02:41
You should check the function parameters carefully, in Animatecharacter(), that parameter is for loop, not view, you need to use SetCharacterView() before the animation, and ReleaseCharacterView() afterwards to restore it. So:
FaceLocation(EGO,16,121);
SetCharacterView(EGO,3);
AnimateCharacter(EGO,character[EGO].loop,0,0);
while(character[EGO].animating) Wait(1);
ReleaseCharacterView(EGO);

(If you don't want that while line, use AnimateCharacterEx() instead to make the animation blocking.)
Title: Re: Face wrong way
Post by: Candle on Wed 17/11/2004 03:21:34
Thank works really good . anyway I can set the anim sprite so it is the same size as the ego sprite . it is a little bigger so looks funny when it runs .