Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Mr. Mozzarella on Sat 05/11/2005 16:54:33

Title: NPC won't move
Post by: Mr. Mozzarella on Sat 05/11/2005 16:54:33
This problem kept me busy the whole evening and I still don't see the mistake.

when you enter room 38, the following things should happen:


if (GetGlobalInt(21!=){
  DisplaySpeech(MAN,"Hey!");
  MoveCharacter(MAN,130,160);
  walkingwait();
  DisplaySpeech(MAN,"speech speech speech");
  DisplaySpeech(EGO,"speech speech speech");
  }


The speech is displayed but the NPC MAN won't move from his position (130,120) to 130,160.

I've checked that he is standing on a Walkable area and that 130,160 is on a Walkable area as well. His down loop has got 11 different frames.
walkingwait() is a function of my own, but it can't be the problem since I also checked that (I left it out and it still didn't work).

Where else could be the problem?  ???
I would be glad if someone could help me with that.

Edit: Solved. Sorry ...
Title: Re: NPC won't move
Post by: Janik on Sat 05/11/2005 17:30:00
I'm assuming that your Walkingwait() function blocks the script from running until MAN has stopped - but there is a simpler way:

MoveCharacterBlocking(MAN,130,160);

or in the new version 2.71 (highly recommended:) )

cMan.Walk(130,160, eBlock);


That would only help if your Walkingwait() function did not work as intended. Other than that, are you sure that there is a path with sufficient width between the start and end position? About 4 pixels are needed for the path-finding to work.
Title: Re: NPC won't move
Post by: Mr. Mozzarella on Sat 05/11/2005 17:36:57
Thanks for your answer, Janik.

Yes, the walkingwait function stops the script. I used MoveCharacterBlocking before but at some point I prefered to write my own function, I don't remember why ...
This function has always worked, only now I found out that it was only written for EGO ...  :-[

I'm using version 2.62. Is it possible to change to 2.71 without having to rewrite any part of the script?
Title: Re: NPC won't move
Post by: Barbarian on Sat 05/11/2005 17:43:31
I see Janik beat me to the replyÃ,  ;) I was basically suggesting the same thing.

regarding newer/recent version(s) of AGS: I think that the newer version is mostly compatible with the old script commands, but I think from the "General" options you might need to Un-Check the "Enforce object-based scripting" to allow it to be more compatible with the older commands.

Remember, it's a good idea to make a backup of your game files first before attempting to upgrade or load your game into a newer or different version of the AGS editor.