Hello :) I have another question.
Is it possible to use the global script to change the cursor mode (cursor image) on all hotspots 5 and 6 in the game? I'd like this to apply automatically to all rooms where I draw a hotspot 5 or 6.
It works perfectly in a room but I don't know how to apply it to all hotspots 5 & 6 in the game.
function hHotspot6_MouseMove(Hotspot *theHotspot)
{
Mouse.SaveCursorUntilItLeaves();
Mouse.Mode = eModeCursD;
}
function hHotspot5_MouseMove(Hotspot *theHotspot)
{
Mouse.SaveCursorUntilItLeaves();
Mouse.Mode = eModeCursbas;
}
Something like this:
int prevHotspotId;
function repeatedly_execute() {
Hotspot* h = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
int currHotspotId = h.ID;
if (currHotspotId == 5 && prevHotspotId != 5) {
Mouse.SaveCursorUntilItLeaves();
Mouse.Mode = eModeCursD;
}
if (currHotspotId == 6 && prevHotspotId != 6) {
Mouse.SaveCursorUntilItLeaves();
Mouse.Mode = eModeCursbas;
}
prevHotspotId = currHotspotId;
}
I also recommend looking into Custom Properties that let add values to hotspots and other things. This is often better than relying on hotspot/object's number:
https://adventuregamestudio.github.io/ags-manual/CustomProperties.html
Ok thanks. I'm starting to understand how it works.