Page 1 of 1

Label ignores screen and automatically selects imagemap options [Solved]

Posted: Thu Aug 19, 2021 11:34 am
by oatnoodles
I have a label that shows a room. It displays an imagemap of the room with objects you can click. However, when loading the screen, instead of pausing and allowing the user to click somewhere on the imagemap, it automatically "selects" the first label and the continues to go through all the others.

So it goes from label desk, to label minifridge, etc. until they're all "done" and goes to the next time period (morning, in this case.) However, previously, the imagemap was functioning correctly in that you could select an object by clicking. I changed something, I don't remember what exactly. I think I wanted to make it so the screen wouldn't advance without the user selecting an object.

Here's my code:

Code: Select all

label bedroom:

    $ location = "Bedroom"

    show dorm room with dissolve
    show screen datebox
    show screen free_controls
    show screen bedroom

#This is the map for your bedroom.
screen bedroom:
    modal True

    imagemap:
        idle "images/dorm room.png"

        hotspot (727, 459, 177, 209) action Jump("mini_fridge")
        hotspot (149, 503, 442, 361) action Jump("bed")
        hotspot (1167, 503, 492, 396) action Jump("desk")
        hotspot (951, 81, 201, 574) action Jump("shelf")

label desk:

    hide screen bedroom
    hide screen free_controls

    window auto
    menu:
        n "> You should study."

        "Yes":
            n "> You decide to study."
            n "> ..."
            n "> ......"
            n "> ........."
            n "> Your knowledge has increased!"
            $ knowledge_points += 5
            n "> ..."
            n "> You have studied enough for now."
            jump morning

        "No":
            n "> You decide not to study right now."
            show screen bedroom

screen desk_help:
    add "gui/help.png"
    hbox:
        ypos 575
        xalign 0.5
        yalign 0.5
        xmaximum 800
        text "{color=#D1CCC9}You can study at your desk. Once you're finished, time will pass.{/color}" size 55

    #PS4 Controls
    imagebutton:
        xpos 1750
        ypos 1000
        idle "gui/ok_x_idle.png"
        action Hide("desk")

#_______________________________________________________________________________

label mini_fridge:

    hide screen bedroom

    window auto
    n "> It's a mini-fridge. You can keep some snacks in here."

    show screen bedroom

label bed:

    hide screen bedroom

    window auto
    n "> It's your bed. It's not time to sleep right now."

    show screen bedroom

label shelf:

    hide screen bedroom

    window auto
    n "> Your shelf is empty."

    show screen bedroom

Re: Label ignores screen and automatically selects imagemap options

Posted: Thu Aug 19, 2021 2:38 pm
by emz911
You need to

Code: Select all

call screen bedroom
instead of

Code: Select all

show screen bedroom
Use call if you want to force an interaction (pause the game at the screen). Show allows it to appear while continuing to the next line, you don't have a next line after show screen therefore it continues out of the label.

Re: Label ignores screen and automatically selects imagemap options

Posted: Thu Aug 19, 2021 7:58 pm
by oatnoodles
Such an easy fix omg. Thank you so much!