Using one save file

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
sweetchi
Newbie
Posts: 2
Joined: Sat Jan 15, 2022 11:05 am
Contact:

Using one save file

#1 Post by sweetchi »

I'm trying to make a game where clicking "Continue" on the title screen will send you to your most recently saved game but it will only do so if you have saved in the first place.

Code: Select all

define savecount = 0

label continue:
    if (savecount == 1):
        $ renpy.load("1-1")
    else:
        return


## Navigation screen ###########################################################
##
## This screen is included in the main and game menus, and provides navigation
## to other menus, and to start the game.

screen navigation():
    vbox:
        style_prefix "navigation"

        xpos gui.navigation_xpos
        yalign 0.5

        spacing gui.navigation_spacing

        if main_menu:

            textbutton _("New Game") action Start()


        textbutton _("Continue") action Jump('continue')

        if _in_replay:

            textbutton _("End Replay") action EndReplay(confirm=True)

        elif not main_menu:

            textbutton _("Main Menu") action MainMenu()
If I press continue, the game will load no matter what and I tried getting rid of the code in the "continue" label and it still just loads, so am I forgetting something because I don't think the problem is the if statement if it just loads anyway. (This is in screens.rpy + if you couldn't already tell I'm new to Ren'py and Python.)

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2384
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Using one save file

#2 Post by Ocelot »

This might help: viewtopic.php?p=388783
< < insert Rick Cook quote here > >

sweetchi
Newbie
Posts: 2
Joined: Sat Jan 15, 2022 11:05 am
Contact:

Re: Using one save file

#3 Post by sweetchi »

Thank you! This is exactly what I was trying to do.

Post Reply

Who is online

Users browsing this forum: Google [Bot]