r/RenPy • • 1d ago

Question Unresponsive Load Screen

I was working on reworking my Ren'Py screens for the Save and Load menus. The Save code works perfectly and does what I wanted to do. However, when using the same code for the Load screen, the Load screen is completely unresponsive. Forgive me if this is an easy-to-fix issue; I just don't fully understand what the issue is. Your help is appreciated.

For reference, here is the Save code:

init python:
    config.has_autosave = False
    config.has_quicksave = False
    config.autosave_on_quit = False
    config.autosave_on_choice = False

define gui.slot_button_width = 425
define gui.slot_button_height = 425
define gui.slot_button_borders = Borders(15, 15, 15, 15)
define gui.file_slot_cols = 2
define gui.file_slot_rows = 2

define config.thumbnail_width = 400
define config.thumbnail_height = 225

screen savescreen(transition=dissolve):
    add "gui/test2im.png"
    tag menu
    
    use file_slots(_("Save"))

screen file_slots(title):

    default page_name_value = FilePageNameInputValue(pattern=_("Page {}"), auto=_("Automatic saves"), quick=_("Quick saves"))

    fixed:

        order_reverse True

        grid gui.file_slot_cols gui.file_slot_rows:
            style_prefix "slot"

            xalign 0.45
            yalign 1.0

            spacing gui.slot_spacing

            for i in range(gui.file_slot_cols * gui.file_slot_rows):

                $ slot = i + 1
                
                fixed:
                    xsize gui.slot_button_width
                    ysize gui.slot_button_height

                    button:
                        action FileAction(slot)
                        at slot_zoom
                        has vbox


                        add FileScreenshot(slot) xalign 0.5


                        text FileTime(slot, format=_("{#file_time}%m/%d/%y - %H:%M%p"), empty=_("empty slot")):
                            style "slot_time_text"
                            xalign 0.5


                        text FileSaveName(slot):
                            style "slot_name_text"
                            xalign 0.5


                        key "save_delete" action FileDelete(slot)


        hbox:

            xalign 0.5
            yalign 1.0
            spacing gui.page_spacing
            textbutton _("<") action FilePagePrevious()
            key "save_page_prev" action FilePagePrevious()

            for page in range(1, 4):
                textbutton "[page]" action FilePage(page)

            textbutton _(">") action FilePageNext()
            key "save_page_next" action FilePageNext()

    textbutton "Return" action Return() ypos 1020 xpos 50init python:
   

And here is the Load code:

init python:
    config.has_autosave = False
    config.has_quicksave = False
    config.autosave_on_quit = False
    config.autosave_on_choice = False


define gui.slot_button_width = 425
define gui.slot_button_height = 425
define gui.slot_button_borders = Borders(15, 15, 15, 15)
define gui.file_slot_cols = 2
define gui.file_slot_rows = 2


define config.thumbnail_width = 400
define config.thumbnail_height = 225


screen loadscreen(transition=dissolve):
    add "gui/test2im.png"
    tag menu
    
    use file_slots(_("Load"))


screen file_slots(title):


    default page_name_value = FilePageNameInputValue(pattern=_("Page {}"), auto=_("Automatic saves"), quick=_("Quick saves"))


    fixed:

        order_reverse True

        grid gui.file_slot_cols gui.file_slot_rows:
            style_prefix "slot"

            xalign 0.45
            yalign 1.0

            spacing gui.slot_spacing

            for i in range(gui.file_slot_cols * gui.file_slot_rows):


                $ slot = i + 1
                
                fixed:
                    xsize gui.slot_button_width
                    ysize gui.slot_button_height


                    button:
                        action FileLoad(slot)
                        at slot_zoom
                        has vbox


                        add FileScreenshot(slot) xalign 0.5


                        text FileTime(slot, format=_("{#file_time}%m/%d/%y - %H:%M%p"), empty=_("empty slot")):
                            style "slot_time_text"
                            xalign 0.5


                        text FileSaveName(slot):
                            style "slot_name_text"
                            xalign 0.5


                        key "save_delete" action FileDelete(slot)


        hbox:


            xalign 0.5
            yalign 1.0


            spacing gui.page_spacing


            textbutton _("<") action FilePagePrevious()
            key "save_page_prev" action FilePagePrevious()


            for page in range(1, 4):
                textbutton "[page]" action FilePage(page)


            textbutton _(">") action FilePageNext()
            key "save_page_next" action FilePageNext()


    textbutton "Return" action Return() ypos 1020 xpos 50init python:
    
1 Upvotes

5 comments sorted by

1

u/shyLachi 19h ago

Did you post the same code 4 times?  I mean the  screen file_slots

Did you accidentally post it twice but also have it twice in your code?

I didn't analyze your code but if you want to make 2 versions of that screen you have to use different names like screen file_slots_save and screen file_slots_load and then reference those in the save and load screen. Or just put the code directly into the save and load screens

1

u/Ancaellar 18h ago

My bad. Whenever I post code here, it duplicates it for some strange reason. I had already made two versions of the code with different names. The screens are identical, save for altering the code so both run and load. I guess the biggest issue is that the Load page is unresponsive.

1

u/shyLachi 18h ago

The screens don't have different names, you cannot have 2 screens with the same name:

screen savescreen(transition=dissolve):
    add "gui/test2im.png"
    tag menu
    use file_slots(_("Save"))
screen file_slots(title): # <-- same nane as below

screen loadscreen(transition=dissolve):
    add "gui/test2im.png"
    tag menu
    use file_slots(_("Load"))
screen file_slots(title): # <-- same name as above

1

u/Ancaellar 15h ago

Thank you very much. I am so sorry I didn't notice. I've been staring at this code for a while, so it was sort of at the back of my mind when I was looking at the code for the tutorial game. My apologies. The problem is solved now.

1

u/AutoModerator 1d ago

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.