Trying to load a specific quicksave on command

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
Alexis_Royce
Regular
Posts: 39
Joined: Tue Apr 10, 2012 2:34 pm
Projects: May I Take Your Order
Organization: imagiBROS
Tumblr: alexis_royce
Deviantart: alexisroyce
itch: alexisroyce
Contact:

Trying to load a specific quicksave on command

#1 Post by Alexis_Royce » Thu Mar 19, 2020 11:54 am

Hello! I'm making a game with an ecchi scene in it, and I've built a safeword button, so that the player can stop the scene and check in with the NPC. I want the illusion that, if they choose to continue, the NPC is picking the scene right back up where they left off. Because I want this button to work throughout the whole game, I need a way of ensuring that their progress is bookmarked, so to speak. And hey, that sure sounds like a quicksave would do the trick!

I've got the button as part of the quick menu, and it's set up to not display until called. When clicked, this imagebutton forces a quicksave in a specific slot, and then jumps to a label.

Code: Select all

hbox:
            style_prefix "quick"

            xalign 0.8
            yalign .80

            if safeword == "true":
                imagebutton:
                    idle "sw1.png"
                    hover "sw2.png"
                    action [QuickSave(1), Jump("safeword")]
                    alt "Safeword"

Simple enough so far, it jumps down to the label just fine and displays text. I've also hidden the quicksave and quickload buttons on the quick menu and the save screen, to keep the quicksave function quarantined and clean.

Code: Select all

label safeword:
    $ safeword = "false"
    # This will hide the button.

            "Then they talk a bit. Get some options of what to do."

But my problem comes at the end of all that. I want to have ren'py load that Quicksave slot I specified before.

I've tried so many different options, but none of them are working. I've tried:

Code: Select all

            $ QuickLoad(1)
This option doesn't seem to do anything, and will skip to the next block.

Code: Select all

            $ renpy.load(quick-1, confirm=False)
For this, I get a NameError, telling me that 'quick' is not defined.

Code: Select all

            $ FileLoad(quick-1, confirm=False)
For this, I get a NameError, telling me that 'quick' is not defined.

Code: Select all

            $ FileLoad(1, page="quick", confirm=False, newest=True)
This option doesn't seem to do anything, and will skip to the next block.

I've tried substituting the actual filename in place of "quick-1" where applicable, but I still get the same NameError.

Is there any way to make this work? And I know, I know, I'd use Autosaves if I could. I'd much rather hide those from the player than take away their quicksave option. So that would be preferred, but my attempts at cracking into the autosave function have been less than stellar.
Image

User avatar
Jackkel Dragon
Veteran
Posts: 269
Joined: Mon Mar 31, 2014 7:17 pm
Organization: Nightshade, Team Despair
itch: jackkel-dragon
Location: USA
Contact:

Re: Trying to load a specific quicksave on command

#2 Post by Jackkel Dragon » Thu Mar 19, 2020 12:49 pm

If you want a custom slot, maybe look into how the save action works: https://www.renpy.org/doc/html/screen_a ... l#FileSave

As for using a quicksave, it seems that QuickLoad() only loads the newest quicksave. So as long as you set newest to true when making the quicksave (and have no other way to quicksave), calling QuickLoad(False) should be enough to load it.

Edit: If you aren't using another screen button to load the game, you need to acquire the filename of the saved game. Some of the functions here may help: https://www.renpy.org/doc/html/save_load_rollback.html

In particular, it may be a good idea to try "list_saved_games" in the console to see what the filenames are, then use that to write the load statement.
Main Website
Includes information about and links to many of my current and past projects.

Major Game Projects
[Nightshade] Eldritch Academy, Eldritch University, Blooming Nightshade, Flowering Nightshade, Life as Designed
[Team Despair] Corpse Party D2 series

User avatar
Alexis_Royce
Regular
Posts: 39
Joined: Tue Apr 10, 2012 2:34 pm
Projects: May I Take Your Order
Organization: imagiBROS
Tumblr: alexis_royce
Deviantart: alexisroyce
itch: alexisroyce
Contact:

Re: Trying to load a specific quicksave on command

#3 Post by Alexis_Royce » Sat Mar 28, 2020 4:54 pm

Thank you very much for responding. I set newest to true for the button:

Code: Select all

action [QuickSave(1, newest=True), Jump("safeword")]
And set the quickload to false:

Code: Select all

$ QuickLoad(False)
And that means that it continues to only save to one specific save file, which is excellent! But it is still just skipping the request to QuickLoad. I've also tried typing "list_saved_games" into the console, but it just tells me that it's not defined.

Image

Or I get this, which I tried googling, to no avail:

Image

I'll keep plugging away!
Image

User avatar
Jackkel Dragon
Veteran
Posts: 269
Joined: Mon Mar 31, 2014 7:17 pm
Organization: Nightshade, Team Despair
itch: jackkel-dragon
Location: USA
Contact:

Re: Trying to load a specific quicksave on command

#4 Post by Jackkel Dragon » Sun Mar 29, 2020 12:56 am

The debug console function needs to be called with arguments, even if you use the defaults. So:

Code: Select all

renpy.list_saved_games()
The console feedback is basically saying there is a function by that name at a certain memory address.

As for "QuickLoad", that is only a screen action, not a python function. Which is why I suggest checking the list of saved games, then using the python load method with the filename you want.
Main Website
Includes information about and links to many of my current and past projects.

Major Game Projects
[Nightshade] Eldritch Academy, Eldritch University, Blooming Nightshade, Flowering Nightshade, Life as Designed
[Team Despair] Corpse Party D2 series

User avatar
Alexis_Royce
Regular
Posts: 39
Joined: Tue Apr 10, 2012 2:34 pm
Projects: May I Take Your Order
Organization: imagiBROS
Tumblr: alexis_royce
Deviantart: alexisroyce
itch: alexisroyce
Contact:

Re: Trying to load a specific quicksave on command

#5 Post by Alexis_Royce » Mon Mar 30, 2020 1:54 pm

Jackkel Dragon wrote:
Sun Mar 29, 2020 12:56 am
The debug console function needs to be called with arguments, even if you use the defaults. So:

Code: Select all

renpy.list_saved_games()
The console feedback is basically saying there is a function by that name at a certain memory address.

As for "QuickLoad", that is only a screen action, not a python function. Which is why I suggest checking the list of saved games, then using the python load method with the filename you want.
Ahhh, I understand. Thank you!
Image

Post Reply

Who is online

Users browsing this forum: Bing [Bot], GetOutOfMyLab, mold.FF