Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: 6674576456786548678 on Sat 22/09/2018 14:11:22

Title: Map Markers With Overlays
Post by: 6674576456786548678 on Sat 22/09/2018 14:11:22
.
Title: Re: Map Markers With Overlays
Post by: Cassiebsg on Sat 22/09/2018 15:03:47
I'm no expert in using Overlays, in fact never even tried then yet. But aren't you making a simple problem more complicated than needed?
Unless you have more than 30 locations to travel to, why don't you just use an object in the map room instead? When the player enters the Field Room for the first time, all you would need was turning your variable to 1 (or in case you just need 0 and 1 or use a bool like hasPlayerVisitedFieldRoom and turn it to true) then on the Map room you just have to check before fade in if the variable is set to true and turn the object.visible=true... I would also add a Game.DoOnceOnly so it only runs that once and not every time you access the room.
Title: Re: Map Markers With Overlays
Post by: Khris on Sat 22/09/2018 15:19:18
A hotspot's status is retained when you leave and re-enter the room, but an Overlay has to be re-created.
Which means when you go to the map room from some other room, MapField isn't 1, and the code you showed doesn't run.

Which brings me to my next question: you *do* have a separate global variable for each hotspot, right?
Title: Re: Map Markers With Overlays
Post by: 6674576456786548678 on Sat 22/09/2018 16:08:00
.
Title: Re: Map Markers With Overlays
Post by: Khris on Sun 23/09/2018 18:49:21
In order to solve this problem, just use Objects instead of Hotspots.

If the overlay doesn't appear, it's because MapField isn't 1 when the map room is loaded. It's the only possibility I can see.
If you upload your game files, I can take a look.