Page 1 of 2

Allowing saving during splashscreen

Posted: Sun Sep 02, 2018 9:37 pm
by Coren
I'm interested in making a splashscreen before the main menu, but allowing the player to save during it - how should I go about doing that? (Imagine something like Fate/Stay Night, where you can save during the prologue that plays before the main menu.)

Thanks!

Re: Allowing saving during splashscreen

Posted: Sun Sep 02, 2018 10:17 pm
by Imperf3kt
What is there to save? The game hasn't even started at the splashscreen.

Re: Allowing saving during splashscreen

Posted: Mon Sep 03, 2018 12:14 am
by Coren
I mean if I am trying to make a long prologue that occurs before the main menu, using the label splashscreen command. How do I allow the player to save during the prologue instead of having to wait until they reach the main menu?

Re: Allowing saving during splashscreen

Posted: Mon Sep 03, 2018 1:14 am
by Imperf3kt
You should be using the main_menu label for that.
https://www.renpy.org/doc/html/label.ht ... ial-labels

Code: Select all

label main_menu:
    "your prologue here"
    return
label start:
    return
label foo:
    "your main story. This replaces the start label."
    return
Then in the navigation menu, adjust the action of the start button.

Code: Select all

textbutton _("Start") action Start("foo")

Re: Allowing saving during splashscreen

Posted: Mon Sep 03, 2018 1:16 am
by Coren
I plan on having the game bring the player to the actual main menu after the prologue. How can I do that if I remove the main menu altogether?

I'm looking for something like in this thread: viewtopic.php?t=2400 but the code here seems outdated. Do you know if there's a newer code that will work that does the same function? Thank you!!

Re: Allowing saving during splashscreen

Posted: Mon Sep 03, 2018 1:20 am
by Imperf3kt
Using label main_menu doesn't remove the main menu, it just makes the game start there.
label main_menu
If it exists, this label is called instead of the main menu. If it returns, Ren'Py will start the game at the start label. For example, the following will immediately start the game without displaying the main menu.
You just need to make some minor changes.
I edited my prior post to add an example usage.

Re: Allowing saving during splashscreen

Posted: Mon Sep 03, 2018 1:25 am
by Coren
I gave it a try, and yes it skipped the main menu. The return command brings the game to label start, which is after the main menu, so this label replaces the main_menu rather than adds on to it, which is not what I am trying to do. I'm trying to have a main menu and also have a prologue that plays the first time before it, like in Fate/Stay Night. Would that be possible?

That's why I phrased my question as how to save during the splashscreen, because label splashscreen does exactly what I want - play the prologue then go to the main menu after. The downside is just that saving is disabled during the splashscreen, and I want to enable it.

Re: Allowing saving during splashscreen

Posted: Mon Sep 03, 2018 1:28 am
by Imperf3kt
Sorry about that, I misread the quoted text.

I have adjusted my posts and believe it should work if used as shown.


You could also try placing it at the very end of your script file without a return.


Looking at the linked thread, that should work.

Re: Allowing saving during splashscreen

Posted: Mon Sep 03, 2018 1:34 am
by Coren
Thanks for trying to help - I'm a complete newb though so I don't know how to change actions.

The main menu text in screens looks like this:

Code: Select all

        if main_menu:

            textbutton _("Start") action Start()
What should I change it to?

Re: Allowing saving during splashscreen

Posted: Mon Sep 03, 2018 1:37 am
by Coren
Do you by any chance know how to make the following code

Code: Select all

$ _game_menu_screen = "_save_screen"
Work with the newest version of Ren'py? When I use it it causes an error, saying _save_screen cannot be found.

Re: Allowing saving during splashscreen

Posted: Mon Sep 03, 2018 1:39 am
by Coren
Also the main_menu tag also doesn't work unfortunately - I just tried it and I still cannot save during the prologue sequence.

Re: Allowing saving during splashscreen

Posted: Mon Sep 03, 2018 1:40 am
by Imperf3kt
Just make a new label and have Start action, start there. Start ("new_label")
I may have edited it after you saw, I apologise for that. I am at work and replying in the few moments break I find here and there, if I leave something out, it usually takes me many minutes to edit it in.


I'll have a try when home. ~3 hours

Re: Allowing saving during splashscreen

Posted: Mon Sep 03, 2018 1:49 am
by Coren
Hey thanks for all your replies! I *think* I have managed to sort it out by tweaking the _save_screen label to make saving possible, but I'll just test it out a few more times before making sure.

Re: Allowing saving during splashscreen

Posted: Mon Sep 03, 2018 3:23 am
by MaydohMaydoh
I think Imperf3kt's method would work best. If you use a persistent variable in the main menu label to call the main menu screen if the prologue has been seen and use the start label as the prologue.

Code: Select all

label main_menu:
    if persistent.prologue:
        call screen main_menu
    else:
        return
        
label start:
    "Prologue goes here."
    $ persistent.prologue = True
    return
    
screen main_menu()
    textbutton "Start" action Start("new_start")
    
label new_start:
    "Game goes here."

Re: Allowing saving during splashscreen

Posted: Mon Sep 03, 2018 4:24 am
by Imperf3kt
I had a quick trial and it indeed seems to completely ignore the main menu (even when calling it, bringing up the game menu instead)

Will look into this more later, but can say for now, the suggested methods don't work as intended.