Adventure Game Studio

AGS Support => Modules, Plugins & Tools => Topic started by: artium on Sat 15/09/2018 20:48:32

Title: MODULE: Hint Highlighting
Post by: artium on Sat 15/09/2018 20:48:32
Documentation and code (https://github.com/alkhimey/HintsHighlight)

Download scm file (https://github.com/alkhimey/HintsHighlight/releases)

Did you ever play an adventure game and got frustrated by not being able to find the next clue of a puzzle?

You try every item and click on every location, but there is no success...

So you open the walk-through and what is written there disappoints you.

It turns out that it was not something clever that you missed, but you did not notice that little pixel sized, not so outstanding, brick at the corner of the screen.

No more frustration for you players!

As part of learning to work with AGS, I developed a module that allows displaying hints.

After the easy integration (simply download and add it into your game), pressing an "SPACE" key (actually this is configurable) will highlight all the enabled hotspots/characters/objects on the screen.

(https://raw.githubusercontent.com/alkhimey/HintsHighlight/master/screenshots/demo.gif)

It has several other configurable options that are explained in the "asc" file. Of course you can modify it as you wish, for example making the highlight visual style fit you game's theme.

If you find bugs or have suggestions or improvement requests, feel free to write me :)
Title: Re: MODULE: Hint Highlighting
Post by: Danvzare on Sun 16/09/2018 15:20:25
I remember something like this called "ShowInteractiveAreas" by Billbis.
I wonder how yours differs though, and which is better. :-D
Title: Re: MODULE: Hint Highlighting
Post by: VampireWombat on Sun 16/09/2018 15:26:05
I just checked and confirmed that something similar is part of the Extended ALARCOST template. But that makes green dots over the hotspots.
Dunno if I'd say any of them is better. Just slightly different.
Title: Re: MODULE: Hint Highlighting
Post by: Danvzare on Sun 16/09/2018 17:48:08
I've been messing about with your new module, and I've improved it a tiny bit. Firstly by drastically increasing the speed in which it calculates everything, although now a hotspot has to be at least 2x2 to be detected. Secondly, by making the various rectangles more identifiable from each other.

Here's my version of your module, incase you want to incorporate any of those changes: LINK (https://sta.sh/0sqy0dj6f4i).
I don't know how to use GitHub, hence why I'm putting it here.

A few things to note though, that you need to improve on your module yourself.
Firstly, it only points out hotspots. What about objects and characters?
Secondly, you really need to make it pause the game when it's being used, because if you hold in the H key while walking in a scrolling room, the drawn rectangles follow the screen.
Thirdly, consider changing the default key to the spacebar, since that's usually what most games set this kind of hint thing to.
Title: Re: MODULE: Hint Highlighting
Post by: artium on Mon 17/09/2018 21:45:50
I was not aware that there is already a module doing this. We have mostly the same functionality but there small differences I can see. It is not really important because this is a project for helping me learn AGS.

Quote from: Danvzare on Sun 16/09/2018 17:48:08
Firstly by drastically increasing the speed in which it calculates everything, although now a hotspot has to be at least 2x2 to be detected.

Great idea. Requiring the hotspots to be at least 2x2 is reasonable.
Nevertheless, currently, the overlay is calculated only when a button is pressed, not every cycle and even not while it is held. Therefore there is little requirement for speedup.

Quote from: Danvzare on Sun 16/09/2018 17:48:08
Secondly, by making the various rectangles more identifiable from each other.

This is a great addition as well!

Quote
I don't know how to use GitHub, hence why I'm putting it here.

I really loved your changes and want to incorporate them. But maybe this is an opportunity for you to learn git, and to make a name for yourself in somebody's else repository. I can send you a link to an interactive git tutorial and to guide how to work with github. PM me if you are interested.

Quote
Firstly, it only points out hotspots. What about objects and characters?

That is on my TODO list.

Quote
Secondly, you really need to make it pause the game when it's being used, because if you hold in the H key while walking in a scrolling room, the drawn rectangles follow the screen.

Agree, I will add it.

Quote
Thirdly, consider changing the default key to the spacebar, since that's usually what most games set this kind of hint thing to.

Agree a well.
Title: Re: MODULE: Hint Highlighting
Post by: Monsieur OUXX on Wed 19/09/2018 10:54:38
did you host your source code online, on github or similar? It would be nice to always adopt that practice nowadays.
Title: Re: MODULE: Hint Highlighting
Post by: artium on Wed 19/09/2018 19:02:25
Quote from: Monsieur OUXX on Wed 19/09/2018 10:54:38
did you host your source code online, on github or similar? It would be nice to always adopt that practice nowadays.

Yes I did. It is hosted on Github: https://github.com/alkhimey/HintsHighlight
Title: Re: MODULE: Hint Highlighting
Post by: Monsieur OUXX on Thu 20/09/2018 09:24:12
Quote from: artium on Wed 19/09/2018 19:02:25
It is hosted on Github: https://github.com/alkhimey/HintsHighlight

EXCELLENT!
(https://cdn.tinybuddha.com/wp-content/uploads/2010/02/Jumping-for-Joy.jpg)

EDIT : Was- Was the github address at the top of the first post the whole time? :X
Title: Re: MODULE: Hint Highlighting
Post by: Crimson Wizard on Thu 20/09/2018 10:13:44
Quote from: Monsieur OUXX on Thu 20/09/2018 09:24:12
EDIT : Was- Was the github address at the top of the first post the whole time? :X

Yes...
Title: Re: MODULE: Hint Highlighting
Post by: artium on Fri 23/11/2018 21:33:22
Updates to the module are available:

Additionaly, it is possible now to download (https://github.com/alkhimey/HintsHighlight/releases) an scm file.
Title: Re: MODULE: Hint Highlighting
Post by: CaptainD on Sun 19/11/2023 20:48:15
Apologies for digging up such an old thread, but I've given it a try and I'm getting an error, not sure if it's something I've done (or not done), or possibly related to the game's resolution (1280x720)?

Error running function "repeatedly_execute": Error (line 331): Script appears to be hung (a while loop ran 150001 times). The problem may be in a calling function; check the call stack.

The line number corresponds to the middle of static function HintsHighlighter::CalculateHintsForRoom().

I haven't changed any of the imported script (I realise this may be the problem).
Title: Re: MODULE: Hint Highlighting
Post by: Crimson Wizard on Sun 19/11/2023 21:16:55
Quote from: CaptainD on Sun 19/11/2023 20:48:15Error running function "repeatedly_execute": Error (line 331): Script appears to be hung (a while loop ran 150001 times). The problem may be in a calling function; check the call stack.

The line number corresponds to the middle of static function HintsHighlighter::CalculateHintsForRoom().

This is fixed by adding a "noloopcheck" to the function's definition:

Code (ags) Select
static function noloopcheck HintsHighlighter::CalculateHintsForRoom()
Title: Re: MODULE: Hint Highlighting
Post by: CaptainD on Sun 19/11/2023 21:27:07
CW, you are a hero!!