Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: TheJBurger on Mon 25/04/2005 00:16:41

Title: Checking Regions for NPCs
Post by: TheJBurger on Mon 25/04/2005 00:16:41
I'm having a problem in a game I'm making.

The game is in top view of a building with numerous rooms. Each room is marked by a different region. There are two characters, EGO and BLUE. EGO is you of course, and BLUE is the enemy.

I want it so that every time EGO is on the same region as BLUE, BLUE starts following EGO. The problem is, I don't know how to check if BLUE is on the same region as EGO.

Any help is appreciated.
Title: Re: Checking Regions for NPCs
Post by: Ashen on Mon 25/04/2005 00:19:25
GetRegionAt (x, y);

E.g.:

if (GetRegionAt (character[BLUE].x, character[BLUE].y) == GetRegionAt (character[EGO].x, character[EGO].y)) {
  //Whatever
}
Title: Re: Checking Regions for NPCs
Post by: TheJBurger on Mon 25/04/2005 00:27:45
Thank you for the quick reply, it helped alot.