Is it possible to fade to black before returning to main 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
duck-and-wolf
Regular
Posts: 47
Joined: Thu Aug 29, 2019 6:20 pm
Completed: Head of the Class
Organization: Duck & Wolf
Contact:

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

#1 Post 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?
Last edited by duck-and-wolf on Thu Sep 19, 2019 10:39 am, edited 1 time in total.

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

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

#2 Post by xavimat »

Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Contact:

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

#3 Post 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)()

duck-and-wolf
Regular
Posts: 47
Joined: Thu Aug 29, 2019 6:20 pm
Completed: Head of the Class
Organization: Duck & Wolf
Contact:

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

#4 Post 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

Post Reply

Who is online

Users browsing this forum: Google [Bot]