Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Fri 30/09/2005 14:14:25

Title: NPC problem.
Post by: on Fri 30/09/2005 14:14:25
How can I let NPC players say something while the main player is doing something else. I mean if I am not talking to NPC I still want the npc player to say something.  ???

Like "Fish in sale come and get it. It's brand new and fresh."  And when I am near him I want the NPC to say "Do you want' to buy my fish, yes?"

And I want NPC to say this words repeatatly until I buy the fish.
Title: Re: NPC problem.
Post by: Ashen on Fri 30/09/2005 14:27:15
Read the Manual, specifically Character.SayBackground

So:
cNpc.SayBackground("Do you want' to buy my fish, yes?");

This Module (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=21715.0) allows you to run the NPC's speech anim, too.

You'll probably also want to use the Character.x and Character.y variables to check if the player is near enough to the NPC - or you could use Regions.