IsCharachterOverHotspot, or such

Started by Abisso, Thu 24/02/2005 11:44:15

Previous topic - Next topic

Abisso

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.
Welcome back to the age of the great guilds.

Ubel

-Room Editor
Ã,  -Areas
Ã,  Ã,  -Hotspots
Ã,  Ã,  Ã,  -Interaction...

Ashen

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):
Code: ags

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

I know what you're thinking ... Don't think that.

strazer

GetHotspotAt and GetWalkableAreaAt work with screen coordinates, but character coordinates are room coordinates, so this may not work in scrolling rooms.
So do this:

Code: ags

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

Abisso

Welcome back to the age of the great guilds.

Scummbuddy

- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

SMF spam blocked by CleanTalk