Page 1 of 1

Is it possible to fade to black before returning to main menu? [SOLVED]

Posted: Tue Sep 17, 2019 4:28 pm
by duck-and-wolf
So, I found a 13-year-old thread (this one: viewtopic.php?f=8&t=1179) where someone had asked how to do this, but the answer that was listed there, from 2006, seems no longer to apply, which of course makes sense that things could have changed so dramatically since then that not every answer from such an old thread would still be relevant.

I asked in that thread if there was any updated way to get this to work, but the resurrected thread seems to have gone completely un-noticed and has fallen off the most recent threads list pretty quickly; it probably wouldn't have gotten much attention because the title was very ambiguous (just 'Ren'Py Questions') and the date was so, so old.

So I figured I would copy-paste my post from that thread and re-ask in a new thread with a better title. I hope that's ok, I'm still learning the forum rules and etiquette here, and I certainly don't want to be annoying!

So when I try this:

Code: Select all

label quitToMenu:

    pause

    $ quick_menu = False

    with None
    $ renpy.transition(pixellate)
    jump _library_main_menu
...it results in the below exception, I'm assuming because _library_main_menu is no longer what the main menu screen is referred to as.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 198, in script
    jump _library_main_menu
ScriptError: could not find label '_library_main_menu'.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 198, in script
    jump _library_main_menu
  File "C:\Users\Derp\Desktop\renpy-7.3.2-sdk\renpy\ast.py", line 1695, in execute
    rv = renpy.game.script.lookup(target)
  File "C:\Users\Derp\Desktop\renpy-7.3.2-sdk\renpy\script.py", line 894, in lookup
    raise ScriptError("could not find label '%s'." % str(original))
ScriptError: could not find label '_library_main_menu'.

Windows-8-6.2.9200
Ren'Py 7.3.2.320
Derp 0.07
Wed Sep 11 15:25:36 2019
And when I try this:

Code: Select all

label quitToMenu:

    pause

    $ quick_menu = False

    with None
    $ renpy.transition(pixellate)
    return
...nothing happens, the game just immediately cuts to the main menu.

These code samples do the exact same as using return (meaning, nothing different happens at all, the game does return to the main menu but without any sort of transition):

Code: Select all

label quitToMenu:

    pause

    $ quick_menu = False

    with None
    $ renpy.transition(pixellate)
    $ MainMenu(confirm=False)()

Code: Select all

label quitToMenu:

    pause

    $ quick_menu = False

    with None
    $ renpy.transition(pixellate)
    $ renpy.full_restart()
I used pixellate as the transition in the above tests because I wanted something really obvious so I could see if I was getting a result or not, even though my ultimate goal is to use a simple fade.

I've been able to at least fade away to black by trying this:

Code: Select all

label quitToMenu:

    pause

    $ quick_menu = False

    scene black
    with fade

    return
But once it has faded to black, the main menu of course instantly appears, without any transition, so it's better than nothing but still not ideal.

Is there any way currently to set a transition when you return to the main menu?

Re: Is it possible to fade to black before returning to main menu?

Posted: Tue Sep 17, 2019 4:49 pm
by xavimat

Re: Is it possible to fade to black before returning to main menu?

Posted: Tue Sep 17, 2019 4:52 pm
by hell_oh_world
duck-and-wolf wrote: Tue Sep 17, 2019 4:28 pm So, I found a 13-year-old thread (this one: viewtopic.php?f=8&t=1179) where someone had asked how to do this, but the answer that was listed there, from 2006, seems no longer to apply, which of course makes sense that things could have changed so dramatically since then that not every answer from such an old thread would still be relevant.

I asked in that thread if there was any updated way to get this to work, but the resurrected thread seems to have gone completely un-noticed and has fallen off the most recent threads list pretty quickly; it probably wouldn't have gotten much attention because the title was very ambiguous (just 'Ren'Py Questions') and the date was so, so old.

So I figured I would copy-paste my post from that thread and re-ask in a new thread with a better title. I hope that's ok, I'm still learning the forum rules and etiquette here, and I certainly don't want to be annoying!

So when I try this:

Code: Select all

label quitToMenu:

    pause

    $ quick_menu = False

    with None
    $ renpy.transition(pixellate)
    jump _library_main_menu
...it results in the below exception, I'm assuming because _library_main_menu is no longer what the main menu screen is referred to as.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 198, in script
    jump _library_main_menu
ScriptError: could not find label '_library_main_menu'.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 198, in script
    jump _library_main_menu
  File "C:\Users\Derp\Desktop\renpy-7.3.2-sdk\renpy\ast.py", line 1695, in execute
    rv = renpy.game.script.lookup(target)
  File "C:\Users\Derp\Desktop\renpy-7.3.2-sdk\renpy\script.py", line 894, in lookup
    raise ScriptError("could not find label '%s'." % str(original))
ScriptError: could not find label '_library_main_menu'.

Windows-8-6.2.9200
Ren'Py 7.3.2.320
Derp 0.07
Wed Sep 11 15:25:36 2019
And when I try this:

Code: Select all

label quitToMenu:

    pause

    $ quick_menu = False

    with None
    $ renpy.transition(pixellate)
    return
...nothing happens, the game just immediately cuts to the main menu.

These code samples do the exact same as using return (meaning, nothing different happens at all, the game does return to the main menu but without any sort of transition):

Code: Select all

label quitToMenu:

    pause

    $ quick_menu = False

    with None
    $ renpy.transition(pixellate)
    $ MainMenu(confirm=False)()

Code: Select all

label quitToMenu:

    pause

    $ quick_menu = False

    with None
    $ renpy.transition(pixellate)
    $ renpy.full_restart()
I used pixellate as the transition in the above tests because I wanted something really obvious so I could see if I was getting a result or not, even though my ultimate goal is to use a simple fade.

I've been able to at least fade away to black by trying this:

Code: Select all

label quitToMenu:

    pause

    $ quick_menu = False

    scene black
    with fade

    return
But once it has faded to black, the main menu of course instantly appears, without any transition, so it's better than nothing but still not ideal.

Is there any way currently to set a transition when you return to the main menu?

Code: Select all

label quitToMenu:

    pause

    $ quick_menu = False

    with None
    $ renpy.transition(pixellate)
    $ MainMenu(confirm=False)()
I didn't know actually that you can use actions normally, like calling a python code or something. Maybe you can try to add another action. I don't know how you will add another action on a format like that, maybe give it a shot though. Add the action With() to cause a transition.

Code: Select all

label quitToMenu:

    pause

    $ quick_menu = False

    with None
    $ renpy.transition(pixellate)
    $ MainMenu(confirm=False)()
    ## Something like:
    ## $ MainMenu(confirm=False)(), With(dissolve)()

Re: Is it possible to fade to black before returning to main menu?

Posted: Thu Sep 19, 2019 10:39 am
by duck-and-wolf
xavimat wrote: Tue Sep 17, 2019 4:49 pm Have you tried this? https://renpy.org/doc/html/config.html# ... transition
Image

I swear I googled for it (I hope the effort I put into my original post shows I at least did try to figure this out on my own before whining to the forums!).

Thank you so much <3