[solved] Save/load slots disappeared

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
Ran08
Miko-Class Veteran
Posts: 737
Joined: Tue Jun 12, 2012 1:17 am
Completed: https://ran.itch.io/
Projects: Fate's Cafe
Tumblr: otometwist
Skype: @otomeran
itch: ran
Location: Manila
Contact:

[solved] Save/load slots disappeared

#1 Post by Ran08 » Sun Mar 11, 2018 9:17 pm

Hi! I'm having a little problem with one of my projects. If you click the save/load buttons, the save/load menu pulls up, but it doesn't show any save/load file slots. It's just a blank menu. I can still save using auto-save and load using auto-load, but that's about it. What could be the problem? I'd be really grateful to anyone who can point me in the right direction. Thank you so much in advance!
Last edited by Ran08 on Wed Mar 14, 2018 9:42 am, edited 1 time in total.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1734
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question
Projects: Slumberland
Location: Brazil
Contact:

Re: Save/load slots disappeared

#2 Post by Donmai » Mon Mar 12, 2018 1:58 pm

Hi, Ran. I'd suggest you attach a zipped copy of your screens.rpy file here, so someone can check what's going wrong in your script.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
Ran08
Miko-Class Veteran
Posts: 737
Joined: Tue Jun 12, 2012 1:17 am
Completed: https://ran.itch.io/
Projects: Fate's Cafe
Tumblr: otometwist
Skype: @otomeran
itch: ran
Location: Manila
Contact:

Re: Save/load slots disappeared

#3 Post by Ran08 » Tue Mar 13, 2018 10:12 am

Thank you for the reply, Donmai! (And long time no talk, too! ^_^)

Here's the save/load part of the screens.rpy code.

Code: Select all

# Load and Save screens #######################################################
##
## These screens are responsible for letting the player save the game and load
## it again. Since they share nearly everything in common, both are implemented
## in terms of a third screen, file_slots.
##
## https://www.renpy.org/doc/html/screen_special.html#save https://
## www.renpy.org/doc/html/screen_special.html#load

screen save():
    use navigation
    use preference_background
    
    tag menu

    use file_slots("save")

screen save_alt():
    use navigation
    use preference_background
    
    tag menu

    use file_slots("save")
    
screen load():
    use navigation
    use preference_background
    
    tag menu

    use file_slots("load")
    

    
init -1 python:
    iscale = renpy.image_size("assets/gui/system/save_load/file_idle.png")
    config.thumbnail_width = iscale[0]
    config.thumbnail_height = iscale[1]
    selected_save = 1
    
    zoomInScale = 1.1
    selected_save_total = 2*5
    def select_save(save,action):
        global selected_save
        if selected_save==save:
            action.__call__()
        selected_save = save
      

transform zoomIn:
    zoom 1.0
    linear 0.2 zoom zoomInScale
transform normalZoom:
    zoom 1.0
    
transform adZoom:
    on hover:
        linear 0.2 zoom 1.2
    on idle:
        linear 0.2 zoom 1.0
        
screen file_slots(title):
    
    add "assets/gui/system/save_load/"+title+"_title.png":
        xalign titleXalign
        yalign titleYalign
    
    imagebutton auto "assets/gui/system/save_load/bin_%s.png":
        action [FileDelete(selected_save, confirm=False),Function(renpy.restart_interaction)]
        at adZoom
        yalign 0.89
        xalign 0.92
        

    vbox:
        xalign 0.18
        yalign 0.6
        spacing 22
        for i in range(1, 11):
            $isize = renpy.image_size("assets/gui/system/save_load/page_idle.png")
            button:
                if persistent._file_page == str(i) or i == 10 and persistent._file_page== "quick":
                    
                    background "assets/gui/system/save_load/page_hover.png"
                else:
                    background "assets/gui/system/save_load/page_idle.png"
                
                xysize isize
                if i == 10:
                    action FilePage("quick")
                    text "Auto/Quick":
                        xalign 0.5
                else:
                    action FilePage(i)
                    text "PAGE "+str(i):
                        xalign 0.5
                        yalign 0.5
                        font gui.name_font
                        size 32
    vbox:
        xalign 0.52
        yalign 0.25


        # The buttons at the top allow the user to pick a
        # page of files.
        hbox:
            $ columns = 2
            $ rows = 5
            $ buttonscale = renpy.image_size("assets/gui/system/save_load/filestencil.png")
            $ backgroundsacle = renpy.image_size("assets/gui/system/save_load/file_background.png")
            # Display a grid of file slots.
            grid columns rows:
                xpos 150
                ypos 115
                spacing 5
                transpose True


                # Display ten file slots, numbered 1 - 10.
                for i in range(1, columns * rows + 1):
                    $ file_name = FileSlotName(i, columns * rows)
                    $ file_time = FileTime(i, empty=_("Empty"))
                    $ save_name = FileSaveName(i)
                    # Each file slot is a button.
                    
                    frame:
                        background None
                        $iscale = (backgroundsacle[0]*zoomInScale,backgroundsacle[1]*zoomInScale)
                        xysize backgroundsacle[0]*zoomInScale,backgroundsacle[1]*zoomInScale
                        
                        frame:
                            
                            if (selected_save == i):
                                at zoomIn
                            else:
                                at normalZoom
                            background "assets/gui/system/save_load/file_background.png"
                            xysize backgroundsacle[0]*zoomInScale,backgroundsacle[1]*zoomInScale
                            
                            button:
                                if file_time == "Empty":
                                    background Frame("assets/gui/system/save_load/file_idle.png",xysize=buttonscale,yoffset=5)
                                else:
                                    background Frame(im.AlphaMask(FileScreenshot(i),"assets/gui/system/save_load/filestencil.png"),xysize=buttonscale,yoffset=5)
                                    
                                xysize int(iscale[0]),int(iscale[1])
                                if title == "save":
                                    action [Function(select_save,i,FileAction(i))]
                                else:
                                    action [Function(select_save,i,FileLoad(i,confirm=False,newest=False))]
                                key "save_delete" action FileDelete(i)
                            
                                
                                text "[file_name]. [file_time!t] [save_name!t]":
                                    xpos 205
                                    yalign 0.3
                                    font gui.name_font
                                    size 32
                            

style page_label is gui_label
style page_label_text is gui_label_text
style page_button is gui_button
style page_button_text is gui_button_text

style slot_button is gui_button
style slot_button_text is gui_button_text
style slot_time_text is slot_button_text
style slot_name_text is slot_button_text

style page_label:
    xpadding 50
    ypadding 3

style page_label_text:
    text_align 0.5
    layout "subtitle"
    hover_color gui.hover_color

style page_button:
    properties gui.button_properties("page_button")

style page_button_text:
    properties gui.button_text_properties("page_button")

style slot_button:
    properties gui.button_properties("slot_button")

style slot_button_text:
    properties gui.button_text_properties("slot_button")
Edit: I asked for help from a friend, and this is what they said, "I used the xysize variable for the scale of the frame for each of the saves, but they were floats, (43.0 and not 43) so they would stretch to infinity. Maybe a bug in ren'py idk." So basically, we just had to replace the formatting of the numbers and that solved it. Sorry for the trouble everyone!

User avatar
Donmai
Eileen-Class Veteran
Posts: 1734
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question
Projects: Slumberland
Location: Brazil
Contact:

Re: [solved] Save/load slots disappeared

#4 Post by Donmai » Wed Mar 14, 2018 9:20 pm

Glad to know you've found a solution. The (not so new now) new GUI scripts still read like Greek to me (nothing against Greeks :) ).
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Post Reply

Who is online

Users browsing this forum: JackDoe