Changing hotspot description

Started by Monsieur OUXX, Sun 24/04/2016 16:07:33

Previous topic - Next topic

Monsieur OUXX

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?

 

Crimson Wizard

Use different source to get the string? Like, you already have boolean variables, add string variables (or array of ones).

Khris

Just change the label text from @OVERHOTSPOT@ to [variable] in Room_RepExec, based on Hotspot.GetAtScreenXY().

Monsieur OUXX

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.
 

Slasher

#4
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

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


SMF spam blocked by CleanTalk