Save / Load menu help [Closed]

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
Chansel
Veteran
Posts: 249
Joined: Sat May 01, 2010 6:11 pm
Projects: School's Out! -- A GxB or GxG VN/Dating Sim
Location: The Netherlands, Noord-Brabant
Contact:

Save / Load menu help [Closed]

#1 Post by Chansel » Sat Dec 11, 2010 4:49 pm

Alright, it’s time for me to call for help from the amazing LemmaSoft Forums once again!
I’ve been redesigning the GUI of School’s Out! and I finally have something that looks half decent. But I just can’t get it exactly the way I want it.
My problem is that I can’t figure out for the life of me how to change the text that is shown in the save slots. There are a few problems I’ve ran into that I’d like your help with:

1. Is it possible to use a different font in the Save/Load menu than you’re using in the textbox? Right now I’ve done this:

Code: Select all

    ## The file containing the default font.
    style.default.font = "gui/Felt Regular.ttf"

    ## The default size of text.
    style.default.size = 22
    
    ## The default color of the text
    style.default.color = "5e798e"
So my guess would be that I’d have to replace ‘default’ with something else. But I can’t find what it should be anywhere T^T Blame my searching skills. (or lack thereof)

2. Right now when I create a new save, renpy automatically assigns a number to it.
Example 1.jpg
A save slot with the automatically made number
Example 1.jpg (75.93 KiB) Viewed 1266 times
Is there a way to stop it from doing that? It's not all that important, but I don't think it's pretty so I want to rid myself of it >.<

3. I’d like each save slot to show two different things. At the top, above the two lines, it should show the date and time the player created the safe. Luckily for me, it already does that (yay!). But as mentioned above, I’d like to edit it a little. First of all, remove the number. Secondly I’d like it to have a different font than the 2nd part (which I’ll describe below).
The second part that I’d like there to be should have a few words of text to show where the player is at in the game. Specifically this:
- The in game period (Morning, Afternoon or Evening)
- The in game location (example: School, Park or Town)
- The in game day (Mon – Sun)
- The in game date (April 23, March 07, etc.)
Here’s a picture of what I’d like the final version to look like:
Example 2.jpg
A photoshopped example of a save slot
Example 2.jpg (77.47 KiB) Viewed 1266 times
On a final note I’d like to clarify that I already have the save/load menu in place. The first picture (example 1) is a screenshot of what it currently looks like in game. So all I’m really looking for is a way to edit the fonts, placements and contents of what texts the game shows in the save slots.

Thank you all in advance for any help I’ll (hopefully) get!
Also, I hope I posted enough/not too much information for someone to tell me how I should do this :)

Xx
Chansel
Last edited by Chansel on Tue Dec 14, 2010 7:46 pm, edited 1 time in total.
Image ~ A GxB or GxG Visual Novel/Dating Sim

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: Save / Load menu help

#2 Post by Aleema » Sat Dec 11, 2010 5:40 pm

To find styles, use the style finder, lol. Hit Shift+I with your mouse hovering over what you want to alter.

If I recall correctly save slots need multiple stylings, one for the last save, disabled slots, the number itself is different I think ... just, it's going to make your brain hurt. You're warned. =P The style I think is called "file_picker_text".

As for your other questions, I WISH HUNNY. I've tried to venture into dynamic save file names, and maybe it's easier with the new screen language, but all my attempts give me a headache. You'll either have to manually rebuild the save/load screens, or painstakingly update what the save file line should say every period/location/date you go through.

As for the number ... you can try to hide it by setting it's x or ypos to something ridiculously off screen. Maybe that'll work.


But if someone knows how to do this easily, share the love ~

User avatar
Chansel
Veteran
Posts: 249
Joined: Sat May 01, 2010 6:11 pm
Projects: School's Out! -- A GxB or GxG VN/Dating Sim
Location: The Netherlands, Noord-Brabant
Contact:

Re: Save / Load menu help

#3 Post by Chansel » Sat Dec 11, 2010 6:28 pm

To find styles, use the style finder, lol. Hit Shift+I with your mouse hovering over what you want to alter.
>.< Soo, eruhm. Now that we’ve got that rather obvious and embarrassing solution out of the way. Hehe. Thanks for pointing that out again. I totally, completely, 100% forgot about that.
And you were right. It was indeed “file_picker_text”. So, that’s one problem solved and out of the way.
As for your other questions, I WISH HUNNY. I've tried to venture into dynamic save file names, and maybe it's easier with the new screen language, but all my attempts give me a headache. You'll either have to manually rebuild the save/load screens, or painstakingly update what the save file line should say every period/location/date you go through.
That’s rather discouraging ^^” I mean if you, the super-coding-lady, can’t do it... Then what chances have I got >.<? But by painstakingly update, do you mean that I should keep a variable all the time with what I want the save slot to display?
Say, if the MC goes to school in the morning on the 25th of march, then I’ve got to put that into a variable? And if the day progresses and it becomes the afternoon, change that variable?
Because if that’s what you’re saying, then I’ll go for that. I mean, I’ve got most of that stored in separate variables already. So is it an idea to make a new one who reads the other four and makes it into 1 new variable for the save slot to read?
...Does that make any sense what so ever? And would it be possible?
Because I am convinced that it is possible in some way or another. Because I do believe I’ve seen a saving system like this before. (it’s what inspired me to try and make mine similar). If only I remember where... *starts thinking very hard*
Image ~ A GxB or GxG Visual Novel/Dating Sim

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: Save / Load menu help

#4 Post by Aleema » Sat Dec 11, 2010 7:56 pm

Chansel wrote:I mean if you, the super-coding-lady, can’t do it...
First of all, I'm not. Second, it's possible, just annoying. You can't plug in variables to the "file_entry_format" that change dynamically. That thing only recognizes the time stamp and a string called "save_name". So what you'll be changing is "save_name", all the time, every time. Possible? Yes.

Set up your file_entry_format to resemble the format you want. In this case, probably:

Code: Select all

config.file_entry_format = "%(time)s\n%(save_name)s"
Time, break line, save name, which will have more break lines in it.
Then your save_name var should look like this:

Code: Select all

save_name = "%s\n%s\n%s\n%s"%(period,location,day,date)
From what I remember, this needs to be called every time you want it to be accurate, because it won't change with the variables you call. So if you have a script that changes the date, slap this in there. Change period? Slap this at the end. Slap it everywhere that changes one of those variables. And the only way to get it to look the way you want is using the {font} and {size} tags and such.

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Save / Load menu help

#5 Post by Alex » Sun Dec 12, 2010 9:57 am

Just my thoughts...

Code: Select all

init python:
    def save_name_funct():
        global var1
        global var2
        global var3
        global var4
        global save_name
        save_name = "%s\n%s\n%s\n%s" %(var4, var1, var2, var3)
        
    config.overlay_functions.append(save_name_funct)

label start:

    $ var1 = "evening"
    $ var2 = "monday"
    $ var3 = "school"
    $ var4 = "==========="

    scene black
    "blah blah blah"
    "blah blah blah"
    $ var4 = "<<<<===>>>>"
    "... ... ..."
    "blah blah blah"
Instead of var1, var2 etc. you should use your actual variables.
This function should renew its value each time you show smth on the screen, so you'll get a proper save name.

User avatar
SleepKirby
Veteran
Posts: 255
Joined: Mon Aug 09, 2010 10:02 pm
Projects: Eastern Starlight Romance, Touhou Mecha
Organization: Dai-Sukima Dan
Location: California, USA
Contact:

Re: Save / Load menu help

#6 Post by SleepKirby » Mon Dec 13, 2010 8:23 pm

For getting rid of the "#." in front of the save file description, you can do it with the Ren'Py 6.11 screen language. It's (potentially) not that bad if you don't have too much customization going on already:

(1) First thing you can do is just take the default save/load screen code:
http://www.renpy.org/doc/html/screen_special.html#save
http://www.renpy.org/doc/html/screen_special.html#load
And copy-paste them into any .rpy file in your "game" folder. (You need to define both the save and load screens. If you only define one of them, Ren'Py won't automatically use that screen.)

(2) Now look at this part:

Code: Select all

                    # Add the screenshot and the description to the
                    # button.
                    add FileScreenshot(i)
                    text ( " %2d. " % i
                           + FileTime(i, empty=_("Empty Slot."))
                           + "\n"
                           + FileSaveName(i)) style "large_button_text"
Change the last lines to:

Code: Select all

                    text ( FileTime(i, empty=_("Empty Slot."))
                           + "\n"
                           + FileSaveName(i)) style "large_button_text"
That should do it. Remember that the save and load screens are defined separately, so be sure make the change to both screens. (I briefly confused myself with this when testing the above code >_>)

If you'd like to try porting the rest of your save/load screen customization (like imagemaps) to the screen language, I can try to help there. I know how to do imagemaps at least. (It might be a pain to port everything over to screen language just for getting rid of that number, but if you have any further customization ideas in mind, I think the extra flexibility from screen language should be worth it.)

EDIT: OH, forgot to mention something. If you use the screen language for load/save, Renpy won't read your old save files (nothing harmful will happen to your old saves though). This is because the screen language looks for save filenames like 6-1-LT1.save instead of 51-LT1.save like before. I don't know of a way around this, so I've been meaning to ask whether the filename convention can be customized or at least reverted back to the old way...

User avatar
Chansel
Veteran
Posts: 249
Joined: Sat May 01, 2010 6:11 pm
Projects: School's Out! -- A GxB or GxG VN/Dating Sim
Location: The Netherlands, Noord-Brabant
Contact:

Re: Save / Load menu help

#7 Post by Chansel » Tue Dec 14, 2010 7:45 pm

@ Alex
Thanks! That was exactly the kind of thing I was looking for ! The save slots and I are eternally grateful :3

@SleepKirby:
I much appreciate the help, but I think you’re right that it might be too much work for such a small thing. Especially since I myself wouldn’t even know where to start, so I’d have to ask you (or someone else) to fully convert it to screen language for me. Which is going a bit overboard for just removing a single number that’s “not 100% pretty”. Thank you very much for offering to help me with it though =D
btw: Love your avatar. Kirby rules!
Image ~ A GxB or GxG Visual Novel/Dating Sim

User avatar
SleepKirby
Veteran
Posts: 255
Joined: Mon Aug 09, 2010 10:02 pm
Projects: Eastern Starlight Romance, Touhou Mecha
Organization: Dai-Sukima Dan
Location: California, USA
Contact:

Re: Save / Load menu help [Closed]

#8 Post by SleepKirby » Tue Dec 14, 2010 9:42 pm

Yeah, the screen language gives you a lot of options, but when you have a lot of options, it can be time consuming to learn what you can do and how to do it. Maybe at some point the new Ren'Py site can have cookbook recipes that'll make it easier to get into screen language.

(And I think I'll bring up the save filenames issue in another topic. I feel like I was trying to hijack your topic back there, oops. >_>)

Post Reply

Who is online

Users browsing this forum: _ticlock_