Call load screen after bad ending

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
AXYPB
Regular
Posts: 95
Joined: Thu Sep 04, 2014 3:04 am
Github: AXYPB
Contact:

Call load screen after bad ending

#1 Post by AXYPB » Sat Sep 06, 2014 9:05 pm

I would like to call the load game screen within the text, after a bad ending. I need the user to be unable to press the Return and Save Game buttons as well as advance further in the script, as when using the load screen from the main menu. Using call screen load isn't enough as it still allows the user to continue.

User avatar
SONTSE
Regular
Posts: 95
Joined: Sun Nov 24, 2013 10:49 pm
Completed: 8 VN's so far
Contact:

Re: Call load screen after bad ending

#2 Post by SONTSE » Mon Sep 08, 2014 1:44 pm

a simple and ugly solution comes to mind

Code: Select all

    #bad ending script here
label infinite_loop:
    call screen load
    jump infinite_loop
so if user press "return" it simply returns him back to the screen.
if you insist user to be unable to return and savegame maybe modifying screens will help.
the code for it is more complicated (and even more ugly for sure)
go to screens.rpy and find "screen navigation" change to following

Code: Select all

screen navigation(bad_end=False):

    # The background of the game menu.
    window:
        style "gm_root"

    # The various buttons.
    frame:
        style_group "gm_nav"
        xalign .98
        yalign .98

        has vbox

        if not bad_end:
            textbutton _("Return") action Return()
        textbutton _("Preferences") action ShowMenu("preferences")
        if not bad_end:
            textbutton _("Save Game") action ShowMenu("save")
        textbutton _("Load Game") action ShowMenu("load")
        textbutton _("Main Menu") action MainMenu()
        textbutton _("Help") action Help()
        textbutton _("Quit") action Quit()
then find "screen load" change to following

Code: Select all

screen load(badend=False):

    # This ensures that any other menu screen is replaced.
    tag menu

    use navigation(bad_end=badend)
    use file_picker
then when you reach your bad end just

Code: Select all

    call screen load(badend=True)
    #instead of "call screen load"
Look! It's moving. It's alive. It's alive... IT'S ALIVE! Oh, in the name of God! Now I know what it feels like to be God!(@Henry_Frankenstein. Sums up my coding style)

Post Reply

Who is online

Users browsing this forum: Google [Bot]