How to limit save slots?

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
Purple_dia
Newbie
Posts: 2
Joined: Sat Jan 12, 2019 2:45 pm
Contact:

How to limit save slots?

#1 Post by Purple_dia »

The default game model created by Renpy has an infinite amount of save slots and 6 autosave and quicksave. My main goal is to limit the manual save slots to only 6 in 1 page, as opposed to 6 saves per unlimited pages.

So, in the gui I have by default
define gui.file_slot_cols = 3
define gui.file_slot_rows = 2 which puts me nicely at 6 slots per page.

I have been trying for the past hour so limit the number of pages by different methods :
define gui.file_slot_pages = 1
define gui.file_slot_pages = max(1)
define gui.file_slot_pages = (max = 1)
define Filepagenext = (max = 1) and several other functions but none have worked. I'm not sure how to proceed. Any ideas?

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: How to limit save slots?

#2 Post by Imperf3kt »

You can just remove the paging system from the file_slots screen. No need to fiddle with max saves if you only want one page - remove the ability to go to page 2, 3, 4 etc, and the player only has access to the save slots on the first page.

Just be sure to leave a way to access the quick load and quick save and maybe automatic saves/loads screens.


Removing the ability to save and limiting it to six is quite the unpopular thing to do, are you absolutely sure you should do this?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Purple_dia
Newbie
Posts: 2
Joined: Sat Jan 12, 2019 2:45 pm
Contact:

Re: How to limit save slots?

#3 Post by Purple_dia »

Imperf3kt wrote: Sat Jan 12, 2019 3:15 pm You can just remove the paging system from the file_slots screen. No need to fiddle with max saves if you only want one page - remove the ability to go to page 2, 3, 4 etc, and the player only has access to the save slots on the first page.

Just be sure to leave a way to access the quick load and quick save and maybe automatic saves/loads screens.


Removing the ability to save and limiting it to six is quite the unpopular thing to do, are you absolutely sure you should do this?
I'm not sure what lines I should write to remove the ability to go to further pages. Could you please give me an example?

I am not going to completely remove quicksave and autosave. I just want to limit the number of manual saves, since I think that for the particular game I have in mind anything more than that would be excessive. In any case, even if I decide to increase the number of saves allotted, I still think it'll be useful to know how to do this.

Thank you for the response!

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: How to limit save slots?

#4 Post by rayminator »

In screen.rpy look for

Code: Select all

## range(1, 10) gives the numbers from 1 to 9.
                for page in range(1, 10):
                    textbutton "[page]" action FilePage(page)
then where the [textbutton and for] is just put this ## in front of textbutton it will cancel it out

it should look like this

Code: Select all

## range(1, 10) gives the numbers from 1 to 9.
                ##for page in range(1, 10):
                    ##textbutton "[page]" action FilePage(page)

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: In addition

#5 Post by IrinaLazareva »

the same code (for one page):

Code: Select all

                ## range(1, 10) gives the numbers from 1 to 9.
                for page in range(1, 2):
                    textbutton "[page]" action FilePage(page)

                textbutton _(">") action FilePageNext(max=1)
https://www.renpy.org/doc/html/screen_a ... lePageNext

Post Reply

Who is online

Users browsing this forum: henne