Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: stranger on Fri 09/04/2004 01:10:22

Title: Character pathing
Post by: stranger on Fri 09/04/2004 01:10:22
I have a character where I want it so you walk into the room and this character is walking back and forth, just have a set path to walk back and forth from until youwalk up and talk to this character. How can I do this?

If possible, explain how using the interaction menu, i dont know a lot about scripting.
Title: Re:Character pathing
Post by: Scorpiorus on Sat 10/04/2004 18:13:25
That's kinda advanced thing to achieve with the interaction editor only. Using of scripting makes it easier.

interaction: Room - Repeatedly execute
action -> Run Script

if (character[NPC].walking == 0) { //if NPC isn't walking
Ã, Ã, Ã, MoveCharacterPath(NPC,  50, 100);
Ã, Ã, Ã, MoveCharacterPath(NPC, 270, 100);
}

That will make NPC walk back and forth
Title: Re:Character pathing
Post by: Bryan on Sun 11/04/2004 08:37:33
stanger, I'd just like to encourage you not to be afraid of scripting.  Once you get the basics you'll probably find that "Run Script" is the only useful option on the interaction drop-down.

Anyway, with Scorpiorus's example you've got the NPC walking back and forth, and you can use a variable in the room script for when you are talking to it.  Just set the variable when the dialog starts, and zero it when the conversation ends, and add that condition to the if()  in the repeatedly execute method.