Is there a way to check (supposedly as "function repeatedly_execute_always") if the player is standing on a specific hotspot?
I don't want to do it with regions, because I can max. make 15 regions per room...
I'd say that what you need is Hotspot.GetAtScreenXY(int x, int y)
From the AGS Wiki (http://americangirlscouts.org/agswiki/Hotspot_functions_and_properties#Hotspot.GetAtScreenXY):
if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hDoor)
Display("Mouse on the door");
else if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) != hotspot[0])
Display("Mouse is on something (but not the door)!");
else
Display("Mouse not on a hotspot");
Okay, so is it reasonable to say:
function repeatedly_execute_always(){
if (Hotspot.GetAtScreenXY(player.x, player.y) == hHotspot1){
Label1.Text = "on hotspot";
}
else Label1.Text = "not on hotspot";
}
...I mean is this a problematic statement in any way?
No, that should work nicely.
I have this feeling that hHotspot1 will give out an error, I may be wrong, but it may. And question; is that repexecalways function in global script? Cause that means it will run in every room. So thing is you're going to need a if player.Room is kind of statement. I haven't tested if hHotspot1 works, I have this feeling it will give out a undefined kind of error, but hotspot
- works.
function repeatedly_execute_always(){
if (player.Room==1) {
if (Hotspot.GetAtScreenXY(player.x, player.y) == hotspot[1]){
Label1.Text = "on hotspot";
}
}
else Label1.Text = "not on hotspot";
}
I am putting this in the room script, so it's working :)