Overwrite Save Took Wrong Screenshot (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
Shad12ow
Regular
Posts: 168
Joined: Tue Nov 15, 2011 9:20 pm
Projects: Kage's Room
Location: Indonesia
Contact:

Overwrite Save Took Wrong Screenshot (SOLVED)

#1 Post by Shad12ow » Wed Mar 06, 2013 12:13 pm

Hello there!
Just as the title stated, I was making a save load menu. It has positioned quite nicely, only a little bit of editing. And it worked fine when I was loading the game and saving the game onto a blank save slot. But here's the problem. When I save over one of the existing save slot, the Screenshot is the image of the save load menu, not the game menu.
I have used this code once and it worked fine. But somehow, this time it didn't.
Have anyone ever encountered this? And here's the code.

Code: Select all

screen load_save_slot:
    $ file_text = "%2s. %s\n  %s" % (
                        FileSlotName(number, 5),
                        FileTime(number, empty=_("Empty Slot.")),
                        FileSaveName(number))

    add FileScreenshot(number) xpos 10 ypos 10 
    text file_text xpos 10 ypos 90 size 13 color "#FFFFFF"

screen file_picker:
    imagemap:
            ground "GUI/SL_Ground.png"
            idle "GUI/SL_Ground.png"
            hover "GUI/SL_Hover.png"
            selected_idle "GUI/SL_Hover.png"

            hotspot (58, 72, 64, 61) clicked FilePage(1)
            hotspot (122, 72, 70, 61) clicked FilePage(2)
            hotspot (192, 72, 70, 61) clicked FilePage(3)
            hotspot (262, 72, 70, 61) clicked FilePage(4)
            hotspot (332, 72, 71, 61) clicked FilePage(5)
            hotspot (403, 72, 70, 61) clicked FilePage(6)
            hotspot (473, 72, 70, 61) clicked FilePage(7)
            hotspot (543, 72, 69, 61) clicked FilePage(8)
            hotspot (612, 72, 70, 61) clicked FilePage(9)
            hotspot (682, 72, 70, 61) clicked FilePage(10)

            hotspot (123, 233, 122, 118) clicked FileAction(1):
                use load_save_slot(number=1)
            hotspot (215, 357, 129, 121) clicked FileAction(2):
                use load_save_slot(number=2)
            hotspot (344, 260, 129, 123) clicked FileAction(3):
                use load_save_slot(number=3)
            hotspot (474, 355, 120, 122) clicked FileAction(4):
                use load_save_slot(number=4)
            hotspot (564, 229, 124, 126) clicked FileAction(5):
                use load_save_slot(number=5)
                
    imagemap:
            ground "GUI/QMenu_Misc_Ground.png"
            idle "GUI/QMenu_Misc_Idle.png"
            hover "GUI/QMenu_Misc_Hover.png"
            
            hotspot (175, 519, 62, 63) action ShowMenu("preferences")
            hotspot (237, 519, 67, 63) action ShowMenu("load")
            hotspot (304, 519, 66, 63) action ShowMenu("save")
            hotspot (370, 519, 66, 63) action Help()
            hotspot (436, 519, 66, 63) action MainMenu()
            hotspot (504, 519, 68, 63) action Return()
            hotspot (572, 519, 68, 63) action Quit()
            
screen save:

    # This ensures that any other menu screen is replaced.
    tag menu

    #use navigation
    use file_picker

screen load:

    # This ensures that any other menu screen is replaced.
    tag menu

    #use navigation
    use file_picker

init -2 python:
    style.file_picker_frame = Style(style.menu_frame)

    style.file_picker_nav_button = Style(style.small_button)
    style.file_picker_nav_button_text = Style(style.small_button_text)

    style.file_picker_button = Style(style.large_button)
    style.file_picker_text = Style(style.large_button_text)
    config.thumbnail_width = 110
    config.thumbnail_height =110
Thank you for the help! :mrgreen:
Oh yeah, one more thing. I've been here quite often the couple of days so I just want to say thank you for the help all of you have been giving! I hope my questions can also help someone in one or another. :mrgreen:

Edit :
Add more info. Found the cause of the problem. It is the yesno prompt.
Here's the code :

Code: Select all

init -2 python:    
    layout.imagemap_yesno_prompt(
        "GUI/YN_Ground.jpg",
        "GUI/YN_Idle.jpg",
        "GUI/YN_Hovered.jpg",
        [
            (183, 281, 400, 389, "Yes"),
            (412, 281, 628, 389, "No"),
        ],
        { 
            layout.ARE_YOU_SURE : "GUI/YN_Sure.png",
            layout.DELETE_SAVE : "GUI/YN_SaveDel.png",
            layout.OVERWRITE_SAVE : "GUI/YN_SaveOWrite.png",
            layout.LOADING : "GUI/YN_Load.png",
            layout.QUIT : "GUI/YN_Quit.png",
            layout.MAIN_MENU : "GUI/YN_MMenu.png",
        }
)
I hope someone can help me. Thanks!
Last edited by Shad12ow on Thu Mar 07, 2013 7:37 pm, edited 2 times in total.

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Overwrite Save Took Wrong Screenshot

#2 Post by PyTom » Wed Mar 06, 2013 1:02 pm

You probably want to invoke the FileTakeScreenshot action at an appropriate time.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
Shad12ow
Regular
Posts: 168
Joined: Tue Nov 15, 2011 9:20 pm
Projects: Kage's Room
Location: Indonesia
Contact:

Re: Overwrite Save Took Wrong Screenshot

#3 Post by Shad12ow » Wed Mar 06, 2013 8:29 pm

Sorry to ask, but where do I need to invoke that? In this and my last code, I never even touched that, but it worked fine with the last code.

Edit:
Found the thing that caused the problem. It is the yesno prompt layout.
Here's the code.

Code: Select all

init -2 python:    
    layout.imagemap_yesno_prompt(
        "GUI/YN_Ground.jpg",
        "GUI/YN_Idle.jpg",
        "GUI/YN_Hovered.jpg",
        [
            (183, 281, 400, 389, "Yes"),
            (412, 281, 628, 389, "No"),
        ],
        { 
            layout.ARE_YOU_SURE : "GUI/YN_Sure.png",
            layout.DELETE_SAVE : "GUI/YN_SaveDel.png",
            layout.OVERWRITE_SAVE : "GUI/YN_SaveOWrite.png",
            layout.LOADING : "GUI/YN_Load.png",
            layout.QUIT : "GUI/YN_Quit.png",
            layout.MAIN_MENU : "GUI/YN_MMenu.png",
        }
)
After I disabled this, the save function worked perfectly. Now I need to find why this block of code caused that error.

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Overwrite Save Took Wrong Screenshot

#4 Post by Alex » Thu Mar 07, 2013 10:38 am


User avatar
Shad12ow
Regular
Posts: 168
Joined: Tue Nov 15, 2011 9:20 pm
Projects: Kage's Room
Location: Indonesia
Contact:

Re: Overwrite Save Took Wrong Screenshot

#5 Post by Shad12ow » Thu Mar 07, 2013 11:32 am

Oh nice! I'll use that. Thanks man!

Post Reply

Who is online

Users browsing this forum: Google [Bot], Ocelot