Add extra info in save/load menu? [Solved]

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
stwkun
Regular
Posts: 82
Joined: Wed Jan 02, 2013 7:57 pm
Organization: Stw Projects
Contact:

Add extra info in save/load menu? [Solved]

#1 Post by stwkun »

Hello everyone, I would like to know if it is possible to add extra information (in Save/Load menu) apart of the date.

Suppose I have declared several variables such as "Day" "Money" "Level" and I want to these variables to be showed in save/load menu.

I add a image showing what I want to get.

https://lh3.googleusercontent.com/-w72x ... imagen.png
Last edited by stwkun on Wed Mar 01, 2017 2:29 am, edited 1 time in total.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2402
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Add extra info in save/load menu?

#2 Post by Ocelot »

https://www.renpy.org/doc/html/config.h ... _callbacks
To save data in your saves, and
https://www.renpy.org/doc/html/screen_a ... l#FileJson
or
https://www.renpy.org/doc/html/save_loa ... .slot_json
to retrieve them

Something like

Code: Select all

init python:
    def my_save(data):
        data["my_day"] = day
        data["my_money"] = money
        data["my_level"] = level

    config.save_json_callbacks = [ my_save ]

# in save screen:
text FileJson(current_slot, key="my_day", missing='Unknown date')
EDIT: Proof of concept project. I have changed script.rpy and file_slots screen in screens.rpy.
http://puu.sh/uktzR/9318ae58b7.png
Attachments
TEST SAVE.rar
The archived project
(498.71 KiB) Downloaded 58 times
< < insert Rick Cook quote here > >

Apa
Regular
Posts: 103
Joined: Fri Dec 23, 2016 2:26 am
Location: NYC
Contact:

Re: Add extra info in save/load menu?

#3 Post by Apa »

The text area below save image could get clattered if it’s too much info, I guess?
Anyway to put some info on image associated with save?

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2402
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Add extra info in save/load menu?

#4 Post by Ocelot »

Sure, it is just an example. You can do it the same way you would normally place text over image.
http://puu.sh/ukXVm/72f0ada63c.png
< < insert Rick Cook quote here > >

User avatar
stwkun
Regular
Posts: 82
Joined: Wed Jan 02, 2013 7:57 pm
Organization: Stw Projects
Contact:

Re: Add extra info in save/load menu?

#5 Post by stwkun »

Thanks so much, it works and after many day I could implement it for the classic codes 8) 8) 8)

# in save screen (classic codes):

Code: Select all


$ my_day = FileJson(file_name, key="my_day", missing='Unknown date')
                    text "Days:[my_day]"


Post Reply

Who is online

Users browsing this forum: Dark79