Is there a way to name saves? [ANSWERED]

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
pyopyon
Veteran
Posts: 420
Joined: Thu Aug 29, 2013 4:35 am
Completed: https://chouette.itch.io/
Projects: Ocean Pearls, Catching the Fox [NaNo16], Singles
Organization: Jellyfish Parade
Tumblr: jelpiparade
Skype: miss.chouette
Soundcloud: pyopyon
itch: chouette
Contact:

Is there a way to name saves? [ANSWERED]

#1 Post by pyopyon » Thu Feb 18, 2016 2:58 pm

Instead of having saves organized by date, is there a way to name them manually?
Last edited by pyopyon on Fri Feb 19, 2016 3:44 pm, edited 1 time in total.
Image ImageImage

WiP: Image

✿ Writer for Trade/Commission ✿

User avatar
Donmai
Eileen-Class Veteran
Posts: 1867
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question
Projects: Slumberland
Location: Brazil
Contact:

Re: Is there a way to name saves?

#2 Post by Donmai » Thu Feb 18, 2016 5:36 pm

Use save_name variable: http://www.renpy.org/doc/html/save_load ... -variables
You can pass a string to save_name from time to time in your code.

Code: Select all

$ save_name = "Dancing with the enemy"
scene ballroom
"While we were dancing, I could notice an evil smile in Jeremy's face."
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
pyopyon
Veteran
Posts: 420
Joined: Thu Aug 29, 2013 4:35 am
Completed: https://chouette.itch.io/
Projects: Ocean Pearls, Catching the Fox [NaNo16], Singles
Organization: Jellyfish Parade
Tumblr: jelpiparade
Skype: miss.chouette
Soundcloud: pyopyon
itch: chouette
Contact:

Re: Is there a way to name saves?

#3 Post by pyopyon » Thu Feb 18, 2016 6:30 pm

Oh, that's a good solution!

But I think I should've been more clear in my question;

what I mean is there a way for a player to type in the name of a save themselves?
Image ImageImage

WiP: Image

✿ Writer for Trade/Commission ✿

User avatar
Shakezula
Regular
Posts: 67
Joined: Wed May 20, 2015 8:01 pm
Organization: Digital Sandbox
Contact:

Re: Is there a way to name saves?

#4 Post by Shakezula » Thu Feb 18, 2016 8:09 pm

Assuming you have the save name variable above, all you would have to do is set it to be = renpy.input('Please enter a name for this specific saved game')

more on that input function and its equally helpful parameters here:
http://www.renpy.org/doc/html/input.html

The saves as the files they are listed in the saves folder, don't actually have the date attached to them; only the save screen pulls that information out of the file to list. So if you're asking about how the saves are named in the save screen, you just have to edit that screen code to only display the information you want.

This is the relevant code you need to edit in your save screen (in the screens.rpy file):

Code: Select all

                 # Add the screenshot and the description to thebutton.
                    add FileScreenshot(i)
                    text ( " %2d. " % i
                           + FileTime(i, empty=_("Empty Slot."))
                           + "\n"
                           + FileSaveName(i)) style "large_button_text"
Specifically the FileTime() area. You'll still have to study the screen language documentation to get a better idea of how you can put what specifically you want to place there.
That saves/loads/rollback page posted above is also really helpful, it's got some stuff on renaming saves, and setting file pages, which help you further customize your saving options.

User avatar
pyopyon
Veteran
Posts: 420
Joined: Thu Aug 29, 2013 4:35 am
Completed: https://chouette.itch.io/
Projects: Ocean Pearls, Catching the Fox [NaNo16], Singles
Organization: Jellyfish Parade
Tumblr: jelpiparade
Skype: miss.chouette
Soundcloud: pyopyon
itch: chouette
Contact:

Re: Is there a way to name saves?

#5 Post by pyopyon » Fri Feb 19, 2016 3:44 pm

Okay, I'll see if I can play around with it. Thanks a lot y'all!
Image ImageImage

WiP: Image

✿ Writer for Trade/Commission ✿

User avatar
Shakezula
Regular
Posts: 67
Joined: Wed May 20, 2015 8:01 pm
Organization: Digital Sandbox
Contact:

Re: Is there a way to name saves? [ANSWERED]

#6 Post by Shakezula » Fri Feb 19, 2016 4:36 pm

If you have issues breaking down that screen to do what you want, come on back and we'll figure them out out together :wink:


most of those file functions like the FileTime() one in the default save screen:

Code: Select all

FileTime(name, format='%b %d, %H:%M', empty='', page=None)
Returns the time the file was saved, formatted according to the supplied format. If the file is not found, empty is returned.
The return value is a string.
...are broken down on this particular doc page: http://www.renpy.org/doc/html/screen_ac ... le-actions

tofuuu
Regular
Posts: 51
Joined: Tue Apr 24, 2018 7:15 pm
Contact:

Re: Is there a way to name saves? [ANSWERED]

#7 Post by tofuuu » Sun Aug 12, 2018 12:35 am

Hi! Have you figured out how to make a custom $ save_name from user? I've tried using renpy.input but i got an error.

Post Reply

Who is online

Users browsing this forum: No registered users