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.
-
Qlara
- Regular
- Posts: 80
- Joined: Fri Nov 28, 2014 10:22 am
- Completed: Carmilla
- Skype: kantonija
- itch: visualgothic
- Location: Berlin
-
Contact:
#1
Post
by Qlara » Tue Apr 10, 2018 10:17 pm
How do I check whether the player actually
has a loadable file so I can deactivate the load button (like I did with the notes button)?
I only managed to make the button disappear until the player has actually visited the save screen, but that's obviously a poor result.
Code: Select all
textbutton _("Load") action ShowMenu("load")
textbutton _("Notes") action If(persistent.unlock_notes, Show("notes"))
Last edited by
Qlara on Sun Apr 15, 2018 4:44 pm, edited 2 times in total.
-
DragoonHP
- Miko-Class Veteran
- Posts: 758
- Joined: Tue Jun 22, 2010 12:54 am
- Completed: Christmas
- IRC Nick: DragoonHP
- Location: Zion Island, Solario
-
Contact:
#2
Post
by DragoonHP » Wed Apr 11, 2018 12:39 am
Code: Select all
textbutton _("Load") sensitive renpy.newest_slot() action ShowMenu("load")
Should work. A note though, the button will be unlocked even if there is an auto save
-
Qlara
- Regular
- Posts: 80
- Joined: Fri Nov 28, 2014 10:22 am
- Completed: Carmilla
- Skype: kantonija
- itch: visualgothic
- Location: Berlin
-
Contact:
#3
Post
by Qlara » Wed Apr 11, 2018 8:26 am
By googling your "newest_slot" suggestion I found another solution that doesn't even seem sensitive to autosaves.
Code: Select all
default lastsave = renpy.newest_slot(r"\d+")
if lastsave != None:
textbutton _("Load") action ShowMenu("load")
Users browsing this forum: Google [Bot]