Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Ha Ha I am OK on Wed 14/06/2006 02:07:08

Title: i'm having some trouble with animating NPC's (SOLVED)
Post by: Ha Ha I am OK on Wed 14/06/2006 02:07:08
I don't know if this has a simple solution or not, but when I tell an NPC to move somewhere or do something he doesn't do it. the dialogs are working but not the movement.  I checked the manual and the FAQ, and couldn't find anything.
Title: Re: i'm having some trouble with animating NPC's
Post by: Khris on Wed 14/06/2006 07:08:38
Make sure that there's a walkable area for the NPC, too. Or use the Walk function's eAnywhere parameter.
When asking questions like that, it's always a good idea to post the script you've used.
Title: Re: i'm having some trouble with animating NPC's
Post by: Ha Ha I am OK on Wed 14/06/2006 21:53:19
My NPC is on a walkable area and I tried the eAnywhere parameter.  he still doesn't animate or walk. here is my script (It is a VERY basic script):
cEgo.FaceLocation(251,  161);
RunDialog(13);
cBob.ChangeView(4);
cBob.Animate(1,20,eOnce);     
cBob.UnlockView();
RunDialog(14);
cBob.Walk(292, 150);
cBob.Walk(251, 161);
RunDialog(15);
cBob.Walk(314, 145);
cEgo.FaceLocation(245, 161);
RunDialog(16);
cEgo.FaceLocation(314, 161);
cEgo.FaceLocation(240, 150);
RunDialog(17);

If anyone finds anything, please tell me.
Title: Re: i'm having some trouble with animating NPC's
Post by: Khris on Thu 15/06/2006 00:18:09
I've found this:
Quote from: manualRunDialog (int topic)

Starts a conversation using topic number TOPIC. This is identical to the "Run dialog topic VAL" room interaction command.

NOTE: The conversation will not start immediately; instead, it will be run when the current script function finishes executing.

Use several RunScript interactions, and split the code so that every interaction ends with a RunDialog(x); command.
Title: Re: i'm having some trouble with animating NPC's
Post by: Ashen on Thu 15/06/2006 00:43:46
Also, as far as I can see all those actions are non-blocking, meaning they won't be completed before the next one starts. Try adding the eBlock parameter to the Animate, Walk, and FaceLocations. (As well as splitting them at the RunDialogs, as Khris says.)
Title: Re: i'm having some trouble with animating NPC's
Post by: strazer on Thu 15/06/2006 01:55:23
Btw, you don't need to set up dialogs to let characters say something. Just use cBob.Say("Hello!"); for example.
Title: Re: i'm having some trouble with animating NPC's
Post by: Ha Ha I am OK on Thu 15/06/2006 02:50:01
Thanx people! I divide the scripts into parts and it works now!  ;D

thanx again!!