Label ignores screen and automatically selects imagemap options [Solved]

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
oatnoodles
Regular
Posts: 71
Joined: Tue Aug 03, 2021 6:26 pm
Projects: Samuda Interval
Organization: Tomuwa Entertainment
Deviantart: oatnoodles
Github: oatnoodles
itch: oatnoodles
Discord: oatnoodles
Contact:

Label ignores screen and automatically selects imagemap options [Solved]

#1 Post 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
Last edited by oatnoodles on Thu Aug 19, 2021 7:58 pm, edited 1 time in total.

User avatar
emz911
Regular
Posts: 103
Joined: Fri Jun 23, 2017 2:23 pm
Contact:

Re: Label ignores screen and automatically selects imagemap options

#2 Post 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.

User avatar
oatnoodles
Regular
Posts: 71
Joined: Tue Aug 03, 2021 6:26 pm
Projects: Samuda Interval
Organization: Tomuwa Entertainment
Deviantart: oatnoodles
Github: oatnoodles
itch: oatnoodles
Discord: oatnoodles
Contact:

Re: Label ignores screen and automatically selects imagemap options

#3 Post by oatnoodles »

Such an easy fix omg. Thank you so much!
Ren'py amateur looking to learn as much as possible! Please be patient with me.

Post Reply

Who is online

Users browsing this forum: No registered users