Save Files That Can Be Named

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
Suru
Regular
Posts: 57
Joined: Wed Aug 31, 2016 10:27 pm
Contact:

Save Files That Can Be Named

#1 Post by Suru » Fri Dec 15, 2017 12:01 am

Is there a way to alter the save files in Renpy so you can name them yourself whatever you would like? I know sometimes I have a hard time not having a customization save file for some renpy games and wish I could name them myself. Would there be some sort of code to alter what's already there or would it need to be completely crafted from scratch? Thanks.

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

Re: Save Files That Can Be Named

#2 Post by Imperf3kt » Fri Dec 15, 2017 12:39 am

I assume the character naming code and save_name variable could be used together?

Sorry I cannot give examples right now
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

User avatar
Ocelot
Miko-Class Veteran
Posts: 849
Joined: Tue Aug 23, 2016 10:35 am
Skype: miinipaa
Contact:

Re: Save Files That Can Be Named

#3 Post by Ocelot » Fri Dec 15, 2017 11:03 am

You can add and retrieve arbitrary data to saves: viewtopic.php?p=445160#p445160
< < insert Rick Cook quote here > >

User avatar
xavimat
Eileen-Class Veteran
Posts: 1337
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: xavimat
Location: Italy
Contact:

Re: Save Files That Can Be Named

#4 Post by xavimat » Sat Dec 16, 2017 7:22 am

I'm a bit confused for your question, when you say "alter what's already there".

Do you really need to change the actual names of the files? (the .save files that nobody needs to see?).
Do you need a save_name or other info to display on the load screen? (see the post linked by Ocelot)

You can indeed name your save files:
$ renpy.save('whatevernamefloatsyourboat') will produce the file: whatevernamefloatsyourboat-LT1.save

And then, you can load that saved file:
$ renpy.load('whatevernamefloatsyourboat')

You can, also, retrieve the list of saved games:
renpy.list_saved_games(fast=True)

I use a "user system" that stores a user-code in a persistent.users dictionary, and then loads the correct save file using that name.
That said, I'm not using at all the save/load screens already built in Ren'Py.
Cops&Robbers A two-player experiment
Fear&Love Why can’t we simply express our feelings? Why am I afraid to say ‘I love you’?
unknown [Sci-Fi - mystery - computer]
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
Suru
Regular
Posts: 57
Joined: Wed Aug 31, 2016 10:27 pm
Contact:

Re: Save Files That Can Be Named

#5 Post by Suru » Sat Dec 16, 2017 12:29 pm

Sorry if I was unclear. I am looking for a method to allow players to name their own save files whatever they would like. Basically allowing any player to enter what they like as the name of the save.

User avatar
xavimat
Eileen-Class Veteran
Posts: 1337
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: xavimat
Location: Italy
Contact:

Re: Save Files That Can Be Named

#6 Post by xavimat » Sat Dec 16, 2017 1:05 pm

Suru wrote:
Sat Dec 16, 2017 12:29 pm
Sorry if I was unclear. I am looking for a method to allow players to name their own save files whatever they would like. Basically allowing any player to enter what they like as the name of the save.
Ok. Then my post is useless for you. IIRC there was a post asking the same thing, it should be here, in the forums, somewhere...
Cops&Robbers A two-player experiment
Fear&Love Why can’t we simply express our feelings? Why am I afraid to say ‘I love you’?
unknown [Sci-Fi - mystery - computer]
Honest Critique (Avatar made with Chibi Maker by ~gen8)

Errilhl
Regular
Posts: 163
Joined: Wed Nov 08, 2017 4:32 pm
Projects: HSS
Contact:

Re: Save Files That Can Be Named

#7 Post by Errilhl » Tue Dec 19, 2017 8:03 am

Haven't looked into this, but wouldn't that just involve using a renpy.input() where the user can input his/her choice for name of the savefile, and if no name is input, use a default name? Shouldn't be very hard to figure out, I think...
Currently working on: Image

Post Reply

Who is online

Users browsing this forum: Nikois