Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Abisso on Thu 24/02/2005 11:44:15

Title: IsCharachterOverHotspot, or such
Post by: Abisso on Thu 24/02/2005 11:44:15
I wonder if there was a function like this, or maybe one about Walkable Areas. I tried (and tired) to search it in the manual, with no results.
I need it to change some interaction when the player is on an hotspot (or w.area) instead of another.
Title: Re: IsCharachterOverHotspot, or such
Post by: Ubel on Thu 24/02/2005 13:18:33
-Room Editor
Ã,  -Areas
Ã,  Ã,  -Hotspots
Ã,  Ã,  Ã,  -Interaction...
Title: Re: IsCharachterOverHotspot, or such
Post by: Ashen on Thu 24/02/2005 14:26:21
I don't know if you can do it through the Interaction Editor, you probably have to use scripting. Look these up:
GetHotspotAt (character[CHARID].x, character[CHARID].y);
GetWalkableAreaAt (character[CHARID].x, character[CHARID].y);


e.g. (in repeatedly_execute):

if (GetHotspotAt (player.x, player.y) == 1) {
  //Do something
}
else if (GetHotspotAt (player.x, player.y) == 2) {
  //Do something else
}

Title: Re: IsCharachterOverHotspot, or such
Post by: strazer on Thu 24/02/2005 15:18:15
GetHotspotAt and GetWalkableAreaAt work with screen coordinates, but character coordinates are room coordinates, so this may not work in scrolling rooms.
So do this:


if (GetHotspotAt (player.x - GetViewPortX(), player.y - GetViewPortY()) == 1) {
  //Do something
}
else if (GetHotspotAt (player.x - GetViewPortX(), player.y - GetViewPortY()) == 2) {
  //Do something else
}
Title: Re: IsCharachterOverHotspot, or such
Post by: Abisso on Thu 24/02/2005 16:02:21
Sure! Thanks a lot!
Title: Re: IsCharachterOverHotspot, or such
Post by: Scummbuddy on Thu 24/02/2005 16:37:19
Shouldn't you be using Regions?