Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: plebeo on Thu 08/03/2007 19:29:49

Title: WalkableAreas-characters question
Post by: plebeo on Thu 08/03/2007 19:29:49


There's two characters in the same room: c1 and c2.

c1 can walk to specific area (and not beyond) and c2 to other area.
c1 area is included in c2 area.

How I can obtain this?
Title: Re: WalkableAreas-characters question
Post by: Khris on Thu 08/03/2007 20:11:53
So one can switch the playable character? Or do they walk around at random?

If both of them are playable, just RestoreWalkableArea(x); (http://www.adventuregamestudio.co.uk/manual/RestoreWalkableArea.htm) respectively RemoveWalkableArea(x); (http://www.adventuregamestudio.co.uk/manual/RemoveWalkableArea.htm) when switching the player char.

Forgive me for asking again, but did you try to find a solution yourself?
Or do you just open another topic here every time the solution to a problem isn't bleeding obvious?

(If the characters are supposed to walk by themselves, restore/remove the area just before calling their Walk-command, this way the path finding will disregard the "forbidden" area.)
Title: Re: WalkableAreas-characters question
Post by: plebeo on Thu 08/03/2007 20:18:06
I have tried to find a solution but I didn't find it!!
I'll try this solution!
Thanks for the patience ;)
Title: Re: WalkableAreas-characters question
Post by: Ashen on Thu 08/03/2007 20:18:55
This has been brought up before, I think, and there's no easy way to do it. There's been a couple of suggestions in the past, but the closest I can find right now is this one (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=17610.msg215631#msg215631) that I made. Update to Region.GetAtRoomXY instead of GetRegionAt, and it should work for you if Khris's suggestion doesn't.