[SOLVED] How do I hide load game button?

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
BigHa
Newbie
Posts: 15
Joined: Sun Jan 19, 2014 8:45 am
Contact:

[SOLVED] How do I hide load game button?

#1 Post by BigHa » Sun Jan 19, 2014 8:56 am

I try to hide "load game" button by using persistent but it's not work.
I use image map like this.

If hide load game

-New Game
-Settings
-Quit

If not hide load game

-New Game
-Continue
-Settings
-Quit

I put $ persistent.save_unlocked = True in Screen Save (and disabled quick save in quick menu)
It look like work.But when I try to delete save file,The problem come.
It's still have continue button.

Can I hide load game button when no save file in save directories? How to do it?
And last question Can I make single save game slot? How to do it?

Edit: Single Game slot mean you can have one slot to save (and it select automatic when click save/load button)

Thanks & Sorry for my bad English.
Last edited by BigHa on Mon Jan 20, 2014 1:01 pm, edited 2 times in total.

Crazy Li
Regular
Posts: 113
Joined: Fri Jan 03, 2014 3:35 pm
Contact:

Re: How do I hide load game button and make single save slot

#2 Post by Crazy Li » Sun Jan 19, 2014 2:45 pm

Hiding the load button might be a little harder using image maps, because you'd need to switch your image map and definitions depending on a variable. Not using image maps, I could easily tell you how to do this.

If you only want one slot, THIS might be easier to do with an image map, because you'd only put one slot on your image map for the load and save screens. Normally, I'd say to abandon regular load/save entirely and just use quick load and quick save since you want it to automatically be chosen... but I notice that even that has 10 slots for some odd reason, and I haven't really used quick saving at all to understand how it works. Maybe something to look into though if you can get a quick save that only works on the same one slot.

I know you can also do manual saving from renpy.save: http://www.renpy.org/wiki/renpy/doc/ref ... renpy.save so another option is to re-code your save button to use this and your load button to use the load equivalent, giving you more control over how saves/loads are done.

BigHa
Newbie
Posts: 15
Joined: Sun Jan 19, 2014 8:45 am
Contact:

Re: How do I hide load game button and make single save slot

#3 Post by BigHa » Sun Jan 19, 2014 3:38 pm

Thanks! Crazy Li
But I still have some troubles.
Save and Load is work but I can't use renpy.can_load (filename): to check if save file exist. If file exist it'll show load game button.
When I use renpy.can_load (filename): it return false all the time.

Kinsman
Regular
Posts: 130
Joined: Sun Jul 26, 2009 7:07 pm
Location: Fredericton, NB, Canada
Contact:

Re: [Still need help] How do I hide load game button?

#4 Post by Kinsman » Sun Jan 19, 2014 9:34 pm

The quick save always uses one slot, as far as I can tell after looking at the Ren'Py code.
Try this code to see if the quick-save exists or not:

Code: Select all

python:
    # Get the timestamp of the quick-save. If you can, the file exists.

    def save_exists():
        timestamp = FileTime(1,page="quick")
        if (timestamp == ""):
            return False
        else:
            return True
Flash To Ren'Py Exporter
See the Cookbook thread

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: [Still need help] How do I hide load game button?

#5 Post by PyTom » Mon Jan 20, 2014 1:42 am

renpy.can_load("quick-1")
is probably the best way to test for a quickload file.
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

BigHa
Newbie
Posts: 15
Joined: Sun Jan 19, 2014 8:45 am
Contact:

Re: [Still need help] How do I hide load game button?

#6 Post by BigHa » Mon Jan 20, 2014 1:00 pm

Thanks you everyone. Finally, I use save and load like this.

init python:
def datasave():
renpy.save("quick-1")
ui.text('Quicksave successful!')

def dataload():
if renpy.can_load("quick-1"):
renpy.load("quick-1")
else:
ui.text('Quickload Fails!')

in image map menu

hotspot (568, 549, 627, 571) action datasave
hotspot (654, 549, 716, 571) action dataload

main menu check conidition

if renpy.can_load("quick-1"):

in script.rpy
when start game (new game)

$ _game_menu_screen = None # To stop player from access old save/load menu
$ renpy.unlink_save("quick-1") # To remove old save data if player select new game

Post Reply

Who is online

Users browsing this forum: Google [Bot]