Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: barefoot on Fri 18/03/2011 06:59:30

Title: SOLVED: Animate character whatever View Loop the character is in
Post by: barefoot on Fri 18/03/2011 06:59:30
Hi

I have set up the below script that works in the global after clicking a button:


}
 
if (player.Room== 28) {
    cwizard.FaceLocation(264, 70);
    cwizard.Walk(260, 138, eBlock);
     cwizard.ChangeView(85);
    cwizard.Animate(3, 14, 0, eBlock);
 
    cwizard.ChangeView(3);
    cwizard.Say("My lightning bolt does'nt have any effect on him!!");

}
   }


As you can see, the character faces then walks to a location and then changes animation view to 85, does a simple animation and then reverts back to normal view (3) with a Say dialog.

What I am trying to achieve is to not have the character walk but to have the animation run whatever his frame view is.. that is: up, down,left,right. But using the animate character i am having to put a view loop in..  

Is the a good way around this?

I'm looking into while player is at x at the moment if that's any solution?

Ideally to be able to auto walk near to object and change animation view to face object and then fire at object...

Hope my question is understandable.

cheers

barefoot






Title: Re: Animate character whatever View Loop the character is in when using animate..
Post by: Creator on Fri 18/03/2011 07:20:52
I'm positive that


cwizard.Animate(cwizard.Loop, 14, 0, eBlock);


will do what you're asking.
Title: Re: Animate character whatever View Loop the character is in when using animate..
Post by: barefoot on Fri 18/03/2011 07:34:11
Yes Creator.. brilliant, works.. many thanks..

just need to get char to face object..

UPDATE: Job now done.. :=

cheers

barefoot
Title: Re: Animate character whatever View Loop the character is in when using animate..
Post by: Creator on Fri 18/03/2011 07:38:44
Quote from: barefoot on Fri 18/03/2011 07:34:11just need to get char to face object..

From this sentence, I can't tell if you know how to or not.
Just in case


cwizard.FaceLocation(oObject.X, oObject.Y);
Title: Re: SOLVED: Animate character whatever View Loop the character is in
Post by: barefoot on Fri 18/03/2011 07:44:44
I actually used:


player.FaceObject(object[1]);


I will note what you put.

cheers again

barefoot