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.
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.
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"
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.
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!
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.