Page 1 of 1

Making a hotspot on a background calling for a menu

Posted: Tue Oct 25, 2022 6:11 am
by ptaszek
So basically what I need is to make a few clickable images on the background which would call for a simple choice menu each. I've tried to implement one such image at first, but the game skips clicking on the hotspot and gives me the choice menu immediately at the start of the scene. I don't know coding at all so I can't even figure out what I'm doing wrong.

Also what I'm trying to do in this scene is something a bit like point-and-click in my opinion, so I would be grateful to know some other ways of doing the same thing without a hotspot or something.

Re: Making a hotspot on a background calling for a menu

Posted: Tue Oct 25, 2022 7:57 am
by Ocelot
1.) Screens are not part of the game control flow and should not be placed within labels to avoid confusion.

1a.) You should euther show screen try1 or call screen try1 (probably later) in your script depending on your needs.

2.) ShowMenu is for displaying screens in menu context. Not for anything else. You will crash if you press the hotspot.

2a.) Most likely you should use Jump action here.

3.) I strongly advise against using imagemaps. They are relic of the past. Everytime I tried to use them, I had to move to the imagebuttons later in development. Now I prefer to just use imagebuttons from the very beginning.

Re: Making a hotspot on a background calling for a menu

Posted: Tue Oct 25, 2022 8:48 am
by ptaszek
Ocelot wrote:
Tue Oct 25, 2022 7:57 am
2a.) Most likely you should use Jump action here.
I'm sorry, could you extend it please?
I listened to what you said and changed it to a button and moved screen before the first label, added show screen, and now it shows the button. However, I can't click it nor it actually does anything, plus the choice that's supposed to be showed later is on the screen with the button.
Thanks a ton for your help!


If this helps, I have this part of code before the label start:

screen whatever:
imagebutton:
xalign 0.05
yalign 0.05
idle "item1.png"
hover "item11.png"
action Jump ("choice1")

And this part after:

show screen whatever
label choice1:
menu choice:
"table":
"this is a table"
"chair":
"this is not a table"

Re: Making a hotspot on a background calling for a menu

Posted: Tue Oct 25, 2022 4:03 pm
by Ocelot
As I said, you probably want to use call screen, and, after looking at your code, I can say, that you definetly want to use call screen here. show screen works as generic show statement: it displays the screen and lets script progress further.
Then you hit menu statement, it displays in a modal screen and forces interaction, which pauses script and won't let you do anything except interacting with choice screen.
The solution is to call your screen instead, which will force an interaction and will prevent script from moving further.

Re: Making a hotspot on a background calling for a menu

Posted: Wed Oct 26, 2022 2:20 am
by ptaszek
Thank you so much! I got it now :)