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.
-
notanumber
- Newbie
- Posts: 16
- Joined: Mon Jul 08, 2019 6:19 pm
-
Contact:
#1
Post
by notanumber » Sat Aug 31, 2019 11:37 pm
Let's say the player has to make a choice between 5 characters and that determines which route he'll take for the rest of the VN.
When he makes the branching decision i'd set a variable, for example,
Is there a way to display the value of the chosenCharacter variable under each save slot in the save/load screen? Apparently there's two methods called FileSaveName(slot) and FileTime(slot) that are called in screens.rpy so maybe something like that can be used to fetch those values.
If all else fails i might just set the filesavename to the $chosenCharacter variable but it would be interesting to know anyway.
-
hell_oh_world
- Miko-Class Veteran
- Posts: 777
- Joined: Fri Jul 12, 2019 5:21 am
- Projects: The Button Man
- Organization: NILA
- Github: hell-oh-world
- Location: Philippines
-
Contact:
#2
Post
by hell_oh_world » Sat Aug 31, 2019 11:55 pm
notanumber wrote: ↑Sat Aug 31, 2019 11:37 pm
Let's say the player has to make a choice between 5 characters and that determines which route he'll take for the rest of the VN.
When he makes the branching decision i'd set a variable, for example,
Is there a way to display the value of the chosenCharacter variable under each save slot in the save/load screen? Apparently there's two methods called FileSaveName(slot) and FileTime(slot) that are called in screens.rpy so maybe something like that can be used to fetch those values.
If all else fails i might just set the filesavename to the $chosenCharacter variable but it would be interesting to know anyway.
You can do that through the use of store variable named "save_name"
Code: Select all
label start:
$ save_name = renpy.input("Type the name of the Character you want to use: ").strip()
## Now from this point, unless the user picked another character again, saves will be named as the name of the Character.
## Assuming that you didn't change the file_slots screen in screens.rpy, the save_name will always be present under the save slot's thumbnail.
-
notanumber
- Newbie
- Posts: 16
- Joined: Mon Jul 08, 2019 6:19 pm
-
Contact:
#3
Post
by notanumber » Sun Sep 01, 2019 1:13 am
Well it kinda sucks that there's no way to fetch whatever variable/object I want, but this does get the job done, so thank you.
Also just for the record, you totally can save more than one variable into save_name separated by an underscore, and then obtain and display those two variables after parsing them in screens.rpy for every save file. Just did!
-
Kia
- Eileen-Class Veteran
- Posts: 1011
- Joined: Fri Aug 01, 2014 7:49 am
- Deviantart: KiaAzad
- Discord: Kia#6810
-
Contact:
#4
Post
by Kia » Sun Sep 01, 2019 8:18 am
-
rames44
- Veteran
- Posts: 232
- Joined: Sun May 29, 2016 4:38 pm
-
Contact:
#5
Post
by rames44 » Mon Sep 02, 2019 1:09 pm
It is theoretically possible to do this, but would involve some Python coding. Essentially, what you’re asking for is to “peek inside” the save file. As I recall, Ren’py saves the game state using the Python “pickle” capability, so what you’d have to do is manually “unpickle” it and look at the value inside the “store” in the result.
There is a (very) brief discussion of the save file format here
viewtopic.php?f=8&t=49149&p=483433&hili ... le#p483426
And some code that fiddles with savefiles here that might possibly help
https://f95zone.to/threads/renpy-save-e ... ment.6456/ (this isn’t Python, but might instruct you on the file structure.)
Users browsing this forum: Bing [Bot], Google [Bot], span4ev