Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Monsieur OUXX on Sun 24/04/2016 16:07:33

Title: Changing hotspot description
Post by: Monsieur OUXX on Sun 24/04/2016 16:07:33
Here's the scenario : we have a room that's used as some sort of mini-map (let's call it : "Map room"). It has a few places where the player can walk to. When he walks there, he's transported to the corresponding room of the location (let's call them : "Room1", "Room2", etc.).

On the mini-map, the interesting locations are indicated to the player using hotspots. When the mouse hovers over them, the player gets the description ("Room1", "Room2", etc.)

What we want is that BEFORE the player has visited any of these rooms, the description of the hotspot on the mini-map is "?". AFTER he's visited for the first time, it becomes "Room1", "Room2", etc.

Our problem is NOT to remember which rooms he has visited. We have nice little boolean flags for that. Easy peasy.

Our problem is that hotspot descriptions can't be changed. So how would you implement the description change?

Title: Re: Changing hotspot description
Post by: Crimson Wizard on Sun 24/04/2016 16:12:47
Use different source to get the string? Like, you already have boolean variables, add string variables (or array of ones).
Title: Re: Changing hotspot description
Post by: Khris on Sun 24/04/2016 23:42:29
Just change the label text from @OVERHOTSPOT@ to [variable] in Room_RepExec, based on Hotspot.GetAtScreenXY().
Title: Re: Changing hotspot description
Post by: Monsieur OUXX on Fri 29/04/2016 10:24:12
Quote from: Khris on Sun 24/04/2016 23:42:29
Just change the label text from @OVERHOTSPOT@ to [variable] in Room_RepExec, based on Hotspot.GetAtScreenXY().
Yes. That sounds obvious but I didn't think about it.
Title: Re: Changing hotspot description
Post by: Slasher on Fri 29/04/2016 10:45:30
As Khris pointed out don't use @OVERHOTSPOT@ for stuff where its description changes. Leave the description blank. This description can be added to / changed with Hotspot.GetAtScreenXY() along with a boolean.

Something like this
Code (ags) Select

if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) ==hotspot[1] && bool==false) // bool is the bool name you gave it and use its hotspot i.d. and even add the players room so it only applies in that room (if global.)

// Describe as this
else
// Describe as this


hope this is helpful