Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Thu 10/06/2004 23:32:04

Title: How can I make a NPC move across the screen?
Post by: on Thu 10/06/2004 23:32:04
Maybe that's a silly question for most of you, but I'm new in this.

I have done a room where there's a NPC that must move from one place to another continuously.
I tried it, but the NPC doesn't seem to want to move, it just stays in its place.

I'm qetting mad! Please, any one can explain me how to make NPCs to move step by step!

I looked for it in the Knowledge Base, but the answer is not there.
Title: Re: How can I make a NPC move across the screen?
Post by: Ashen on Thu 10/06/2004 23:54:03
What did you try? If you used a series of MoveCharacter commands, I don't think it would work as they'll all try to run at once.
Try:
if (character[NPC].walking != 1) {
  //runs whenever NPC stops, for continuous movement
  MoveCharacter (NPC, X1, Y1);
  MoveCharacterPath (NPC, X2, Y2);
  MoveCharacterPath (NPC, X3, Y3);
  // for as many points as you want on the characters path
}

(The important command being MoveCharacterPath)
Title: Re: How can I make a NPC move across the screen?
Post by: on Fri 11/06/2004 00:10:29
Thank you Ashen.

That was just as you said.