Disabling the verb coin

Started by viddy, Yesterday at 01:31:43

Previous topic - Next topic

viddy

I feel like I have to pre-apologize for asking this, primarily because it's been either directly asked before or skimmed around, but I'm still at a loss. I swear I've come close a billion times and I'm just missing one thing. I've poured over the help and my brain is officially turned to a form of paste, so please know this ask for help was something I did not lazily dive into.
I do not wish to be asking about this.

All I want is to disable the verbcoin on a specific hotspot. Not disable it for the entire game, just on the hotspots I want to disable it on.


Threads I have read:

https://www.adventuregamestudio.co.uk/forums/beginners-technical-questions/need-assistance-map-modemap-room

https://www.adventuregamestudio.co.uk/forums/beginners-technical-questions/solved-verb-coin-template-using-hotspots-without-verb-coin/

These have helped but I'm not there yet. I'm also confused how relevant these fixes are, and wonder if they may be outdated? I've tried my best attempting to learn hotspot properties, and that method worked... Except now I cant bring back the verbcoin for other hotspots, and turning off the custom property basically turns off the hotspot instead of returning it back to being a normal hotspot.
I have used (I think) just about every disable.verbcoin option I can find in the dynamic help. I have also now probably re-read parts of that help file like a psycho, which means that in my mania to solve this I have probably glossed over something incredibly basic.
Thank you.



And again apologies.

Khris

#1
The current verbcoin template is completely new or at least a rewrite afaik. So a thread from 2013 might be about very different code altogether.

The basic idea is to edit the on_mouse_click / eMouseLeft part of the VerbCoin script.
We need to also go inside the
Code: ags
    if (GetLocationType(mouse.x, mouse.y) != eLocationNothing)
block.

Now read the property and proceed accordingly:
Code: ags
      Hotspot* h = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
      if (h != null && h.GetProperty("no_verbcoin")) { // boolean property, default value "false"
        interface.Visible = false; // turn off verb coin if it's still visible
        h.RunInteraction(eModeInteract);
        return; // end handling here
      }

edit: typo in code fixed

viddy

I knew it. I felt like I was going crazy piecing together information as far back as 2013 to 2020. In many ways AGS has a phenomenal amount of information for newcomers. At the sametime, that benefit seems to be a bit of a curse because I'm finding information from threads that existed before I graduated highschool in the early 2000's. I can't imagine the mental gymnastics someone younger than me would go through learning this for the first time. That and the information about the new version of AGS makes me pause a bit wondering if I should wait before committing myself to this current project.
 
Bit of a tangent, I'll get back on track here. Thanks, this worked perfectly. Just had to switch GetAtScreen to GetAtScreenXY because why not.
Consider this, for at least as of Tuesday April 23rd 2024 as solved.  :P
Thanks again.

SMF spam blocked by CleanTalk