I have two loading screens by mistake?

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
Samitha
Newbie
Posts: 7
Joined: Wed Nov 13, 2019 5:21 pm
Projects: Princess Impersonator
itch: samitha-games
Contact:

I have two loading screens by mistake?

#1 Post by Samitha » Thu Jan 16, 2020 7:12 pm

Hello everyone!

I have yet another question, and this one baffles me completely. I seem to have two separate loading screens for some reason and one works and the other doesn't, although I don't have separate coding for them. The problem is when I access the loading screen from a custom screen I made, it works perfectly, but when I access it from the main menu, the background color changes and the menu options stop working. The only thing that works is the actual loading of the game.

This is the code for my loading screen:

Code: Select all

screen load():

    tag menu

    add "gui/save_load_background.png"

    use file_slots(_(""))

    add "gui/load_game_title.png" xalign 0.2 yalign 0.4

    vbox:

        xalign 0.1
        yalign 0.7

        imagebutton auto "gui/mainmenu_save_%s.png" action MainMenu(confirm=True)
        imagebutton auto "gui/save_load_%s.png" action ShowMenu("load")
        imagebutton auto "gui/chapterselection_save_%s.png" action Null()
        imagebutton auto "gui/gallery_save_%s.png" action Null()
        spacing 10

    vbox:

        xalign 0.1
        yalign 0.85

        imagebutton auto "gui/return_save_%s.png" action Return()
        spacing 20


This is the code from my custom menu:

Code: Select all

screen pausescreen():


    add "gui/overlay/pause_screen.png"

    vbox:

        xalign 0.5
        yalign 0.5
        spacing 5

        imagebutton auto "images/pause_screen_menu_%s.png" action MainMenu(confirm=True)
        imagebutton auto "images/pause_screen_save_%s.png" action ShowMenu("save")
        imagebutton auto "images/pause_screen_load_%s.png" action ShowMenu("load")
        imagebutton auto "images/pause_screen_chapterselection_%s.png" action Null()
        imagebutton auto "images/pause_screen_gallery_%s.png" action Null()

    vbox:

        yalign 0.8
        xalign 0.5
        spacing 30

        imagebutton auto "images/pause_screen_return_%s.png" action Return()


This is the code from the Main menu:

Code: Select all

screen navigation():

    vbox:
        xalign 0.25
        yalign 0.52
        spacing 30

        imagebutton auto "gui/newgame_button_%s.png" action Start()


    vbox:
        xalign 0.3
        yalign 0.85
        spacing 25


        imagebutton auto "gui/continue_button_%s.png" action ShowMenu("load")

        imagebutton auto "gui/chapterselection_button_%s.png" action NullAction()

        imagebutton auto "gui/settings_button_%s.png" action ShowMenu("preferences")

        imagebutton auto "gui/gallery_button_%s.png" action ShowMenu("gallery")

        imagebutton auto "gui/quit_button_%s.png" action Quit(confirm=not main_menu)



Thank you all in advance :wink: :D !!

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 2806
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: I have two loading screens by mistake?

#2 Post by Imperf3kt » Thu Jan 16, 2020 7:58 pm

the load and save screen are actually part of the file_slots screen.

im unable to tell what your specific issue is from the code alone though, can you post some screenshots?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Twitter

User avatar
gas
Miko-Class Veteran
Posts: 535
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: I have two loading screens by mistake?

#3 Post by gas » Fri Jan 17, 2020 6:29 am

How navigation is called?
The pause screen is correct, but that navigation thing is suspect.
Did you changed your main_menu screen, or totally omitted?
10 ? "RENPY"
20 GOTO 10

RUN

User avatar
Samitha
Newbie
Posts: 7
Joined: Wed Nov 13, 2019 5:21 pm
Projects: Princess Impersonator
itch: samitha-games
Contact:

Re: I have two loading screens by mistake?

#4 Post by Samitha » Fri Jan 17, 2020 4:31 pm

Imperf3kt wrote:
Thu Jan 16, 2020 7:58 pm
the load and save screen are actually part of the file_slots screen.

im unable to tell what your specific issue is from the code alone though, can you post some screenshots?
I tried taking some useful screenshots but they look exactly the same and don't really offer a more graphic explanation to my problem, sorry. The problem seems to be of another kind, though I can say that the main menu button hover option does not seem to work and the slot buttons arent really displaying the text or hover options, but they load normally, though. Other than that, they look the same. I'll include an image either way :)
gas wrote:
Fri Jan 17, 2020 6:29 am
How navigation is called?
The pause screen is correct, but that navigation thing is suspect.
Did you changed your main_menu screen, or totally omitted?
I think perhaps it's something like that, though my main menu screen worked perfectly fine before I even touched the save/load screens and I had already modified it.
I'm starting to think that the problem lies in the game menu, I'll share the code.

Code: Select all

screen game_menu(title, scroll=None, yinitial=0.0):

    style_prefix "game_menu"

    if main_menu:
        add gui.main_menu_background
    else:
        add gui.game_menu_background

    frame:
        style "game_menu_outer_frame"

        hbox:

            ## Reserve space for the navigation section.
            frame:
                style "game_menu_navigation_frame"

            frame:
                style "game_menu_content_frame"

                if scroll == "viewport":

                    viewport:
                        scrollbars "vertical"
                        mousewheel True
                        draggable True
                        pagekeys True

                        side_yfill True

                        vbox:
                            transclude

                elif scroll == "vpgrid":

                    vpgrid:
                        cols 1
                        yinitial 1.0

                        scrollbars "vertical"
                        mousewheel True
                        draggable True
                        pagekeys True

                        side_yfill True

                        transclude

                else:

                    transclude




    label title

    if main_menu:
        key "game_menu" action ShowMenu("main_menu")
Attachments
load-screen.png
load-screen.png (11.53 KiB) Viewed 314 times

User avatar
gas
Miko-Class Veteran
Posts: 535
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: I have two loading screens by mistake?

#5 Post by gas » Fri Jan 17, 2020 6:46 pm

The game_menu lack the 'use navigation' statement.

Original screen:

Code: Select all


                        side_yfill True

                        transclude

                else:

                    transclude

    use navigation  ### <--- THIS one

    textbutton _("Return"):
        style "return_button"

        action Return()

    label title
And so I'm asking again how your main menu buttons are actually displaying XD.
10 ? "RENPY"
20 GOTO 10

RUN

User avatar
Samitha
Newbie
Posts: 7
Joined: Wed Nov 13, 2019 5:21 pm
Projects: Princess Impersonator
itch: samitha-games
Contact:

Re: I have two loading screens by mistake?

#6 Post by Samitha » Mon Jan 20, 2020 4:25 pm

The game_menu lack the 'use navigation' statement.
Yes, I remember deleting it :oops: :shock:

I wanted other options on the menu and wanted them positioned differently. Is there a better way to do it? I just kinda thought that including the buttons right on the loading screen would work as it does with my save screen and one of the loading screens I have.

Sorry, I didn't post the main menu code last time because I had done so before xD
But here it goes:

Code: Select all

screen navigation():

    vbox:
        xalign 0.25
        yalign 0.52
        spacing 30

        imagebutton auto "gui/newgame_button_%s.png" action Start()


    vbox:
        xalign 0.3
        yalign 0.85
        spacing 25


        imagebutton auto "gui/continue_button_%s.png" action ShowMenu("load")

        imagebutton auto "gui/chapterselection_button_%s.png" action NullAction()

        imagebutton auto "gui/settings_button_%s.png" action ShowMenu("preferences")

        imagebutton auto "gui/gallery_button_%s.png" action ShowMenu("gallery")

        imagebutton auto "gui/quit_button_%s.png" action Quit(confirm=not main_menu)


...While writing this I realized that this loading screen is accessed from the Main menu directly (from the continue button) so the save button would have no real function here, alas why it isn't working at all. Is it the same case with the Main menu button? Seeing that the return button already goes to the Main menu. In that case, I should make a separate screen for the continue button.

Still, I get the feeling that the slot buttons are not working properly. The text that should show the time and day of the save, is missing.

User avatar
gas
Miko-Class Veteran
Posts: 535
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: I have two loading screens by mistake?

#7 Post by gas » Tue Jan 21, 2020 4:54 am

Sorry, but you're continually posting a navigation screen calling it "main menu", and not the actual main_menu().

I'm quite sure the whole error come from a wrong main_menu() screen and contexts, but I can't tell until you post that code.
10 ? "RENPY"
20 GOTO 10

RUN

User avatar
Samitha
Newbie
Posts: 7
Joined: Wed Nov 13, 2019 5:21 pm
Projects: Princess Impersonator
itch: samitha-games
Contact:

Re: I have two loading screens by mistake?

#8 Post by Samitha » Mon Jan 27, 2020 3:31 pm

Sorry, I thought that my main menu was the code I had shown before :(

I think it's what I said last time, that maybe the main menu button doesn't work because the return button does exactly that; return to the main menu. I already know why the save button doesn't work, and the rest of the buttons/screens ere not defined yet, so their buttons don't work just yet. And like I said, the return button works fine.

I will post the Main Menu code, if you can find something wrong I will appreciate it, if not, I still thank you for answering my posts and helping me all this time :)

Code: Select all

screen main_menu():

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

    style_prefix "main_menu"

    add gui.main_menu_background
    add "gui/pititle.png" xalign 0.3 yalign 0.3



    ## The use statement includes another screen inside this one. The actual
    ## contents of the main menu are in the navigation screen.
    use navigation

    if gui.show_name:

        vbox:

            text "[config.version]":
                style "main_menu_version"

Post Reply

Who is online

Users browsing this forum: No registered users