Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: miguel on Fri 26/12/2003 17:24:21

Title: npc's ignore walkable areas?
Post by: miguel on Fri 26/12/2003 17:24:21
hello to all,
I have a npc that I want  him to follow EGO, but it apears that he doesn't respect walkable areas,
is that a way to check/uncheck this?
thanks
Title: Re:npc's ignore walkable areas?
Post by: Scorpiorus on Fri 26/12/2003 20:31:51
hmm, you mean he only walks on walkable areas? That was discussed in that thread: http://www.agsforums.com/yabb/index.php?board=2;action=display;threadid=10412; (http://www.agsforums.com/yabb/index.php?board=2;action=display;threadid=10412;)
CJ said it's not supported.

A way to simulate it however, as Chris pointed out, to use repeatedly execute:

at the top of the global script:
int follow_on;
int EAGERNESS = 40;
int eag;

repeatedly_execute:


if (follow_on == 1) {
if (eag<=0) {
MoveCharacter(MAN, character[EGO].x, character[EGO].y);
eag = EAGERNESS;
} else eag--;

}

so setting follow_on = 1 will make the character MAN follow character EGO assuming EAGERNESS parameter.

~Cheers
Title: Re:npc's ignore walkable areas?
Post by: miguel on Fri 26/12/2003 22:10:39
sorry for my english but I mean the oposite,
my npc walks OUTSIDE the walkable area,
I had to remove that possibility from that room because I checked everything and wasn't able to do it right, I even shorten the walkable are but with no results, the npc sprites are croped also (didn't know if that was the problem),
anyway thanks scorpioros,
miguel
Title: Re:npc's ignore walkable areas?
Post by: Scorpiorus on Fri 26/12/2003 22:36:19
Have you tried the script? It should make the char that is following to move only on walkables. :P
Title: Re:npc's ignore walkable areas?
Post by: miguel on Sat 27/12/2003 16:12:47
got it, sorry for the trouble and thank you