Issues with a custom main menu

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.
Message
Author
User avatar
rayminator
Veteran
Posts: 344
Joined: Fri Feb 09, 2018 12:05 am
Projects: Redoing games to fix spelling mistakes other companys that don't care
Location: Canada
Contact:

Re: Issues with a custom main menu

#31 Post by rayminator » Fri Jan 10, 2020 4:55 pm

I have never seen a game going back to the main menu with renpy by using the escape key or right click they always went to save menu

so please show me what game that have ever went to the main menu I have played your game before and it never went to the main menu
you should recognize my user name from f95zone

you would have to over ride them using key maps as I have stated before

User avatar
Alex
Lemma-Class Veteran
Posts: 2418
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Issues with a custom main menu

#32 Post by Alex » Fri Jan 10, 2020 5:17 pm

Adabelitoo wrote:
Fri Jan 10, 2020 4:24 pm
...So if I use the return statement in a screen that was called (age_confirmation), it will return to the place where it was called (splashscreen) but where the next return is returning to? The main menu?

Also, when you said to check the main and game menus screen I guess you mean the navigation screens and not the actual main menu screen and game menu screen? ...

My current problem is the one you show in that video. Before starting the game, if you go to the Load/Preferences/About screen you can't go back to the main_menu anymore (ignore the imagebuttons for now), because now we don't have the default textbutton menu anymore (which is great, because I don't want it either) and using Escape or Right click don't bring us back to the main menu like it does in the default template or in my first attempt to modify the menu. ...
1. Yes, splashscreen label must have a line with return statement to bring player to main menu context. When you call a label the return statement is used to return back to the place right after the call statement. And if you didn't call any label the game will return to main menu.

https://www.renpy.org/doc/html/label.ht ... -statement

2. Well, yes - if all buttons in navigation screen then fix them there.

3. The problem is that you not in a main menu context, 'cause you didn't return from splashscreen label. When in main menu and navigation buttons has ShowMenu-actions right-click should return you back to main menu.

Adabelitoo
Regular
Posts: 37
Joined: Sat Apr 13, 2019 2:32 pm
Contact:

Re: Issues with a custom main menu

#33 Post by Adabelitoo » Fri Jan 10, 2020 5:54 pm

rayminator wrote:
Fri Jan 10, 2020 4:55 pm
I have never seen a game going back to the main menu with renpy by using the escape key or right click they always went to save menu

so please show me what game that have ever went to the main menu I have played your game before and it never went to the main menu
you should recognize my user name from f95zone

you would have to over ride them using key maps as I have stated before
Lol, I never thought someone here would actualize recognize my game.

The thing is, the escape and right click will always show the save menu once you're already playing the game (it means, once you started a new game or you loaded a save file) but before that if you go to the Load/About/Preferences screen, if you press escape or Right click it should bring you back to the main menu, and that's the problem now. If I go to any of those screens I can't go back to the main menu and therefor I can't go to any other screen or start the game.
Alex wrote:
Fri Jan 10, 2020 5:17 pm
The problem is that you not in a main menu context, 'cause you didn't return from splashscreen label. When in main menu and navigation buttons has ShowMenu-actions right-click should return you back to main menu.
Ok, now I have the return in my splashscreen but it still doesn't go back to main menu with right click. This is my code now. Am I missing something?

On script.rpy

Code: Select all

label splashscreen:
    scene bg splash
    call screen age_confirmation
    return

screen age_confirmation:
    vbox:
        text "{font=fonts/RobotoCondensed-Regular.ttf}{b}{u}{size=40}Warning:{/size}{/u}{/b}{/font}":
            xpos 550
            ypos 150
        #
        #	More text
        #
        textbutton "{font=fonts/RobotoCondensed-Regular.ttf}{u}{color=#000000}Click here if you are over the legal age of your country.{/color}{/u}{/font}" action Return():
            xpos 400
            ypos 350

#label start_game:
#    return
On screens.rpy

Code: Select all

screen navigation():

    if main_menu:
        imagemap:
            idle "menu5_idle2"
            hover "menu5_hover2"

            #Start
            hotspot (190, 65, 242, 210):
                action Start()
                tooltip "Start"
            #Load
            hotspot (519, 65, 242, 210):
                action ShowMenu("load")
                tooltip "Load"
            #Config
            hotspot (850, 65, 242, 210):
                action ShowMenu("preferences")
                tooltip "Settings"
            #Information
            hotspot (354 ,310, 242, 210):
                action ShowMenu("about")
                tooltip "About the game"
            #Exit
            hotspot (683 ,310, 242, 210):
                action Show("quitconfirmscreen")
                tooltip "Exit the game"

    imagebutton:
        style "imagamap_buttons"
        idle "menu_blog idle"
        hover "menu_blog hover"
        action Start()
        #action OpenURL("https://abrokena.blogspot.com/")
        tooltip "Developer blog"
    imagebutton:
        style "imagamap_buttons"
        idle "menu_support idle"
        hover "menu_support hover"
        #action ShowMenu("preferences")
        action ShowMenu("support")
        tooltip "Support the game"

    $ tooltip = GetTooltip()

    if GetTooltip() is not None:
        text GetTooltip() at pos_menu:
            style "menu_tooltip"
            
screen main_menu():
    ## This ensures that any other menu screen is replaced.
    tag menu
    #add "presentation"
    style_prefix "main_menu"

    add gui.main_menu_background

    ## This empty frame darkens the main menu.
    frame:
        pass

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

    if gui.show_name:

        vbox:
            text "[config.name!t]":
                style "main_menu_title"

            text "[config.version]":
                style "main_menu_version"
                
screen about():

    tag menu
    add "gui/abou_menu.png"
    ## This use statement includes the game_menu screen inside this one. The
    ## vbox child is then included inside the viewport inside the game_menu
    ## screen.
    #use game_menu(_("About"), scroll="viewport"):

    style_prefix "about"

    vbox:

        label "[config.name!t]"
        text _("Version [config.version!t]\n")

        ## gui.about is usually set in options.rpy.
        if gui.about:
            text "[gui.about!t]\n"

        text _("Made with {a=https://www.renpy.org/}Ren'Py{/a} [renpy.version_only].\n\n[renpy.license!t]")
                

User avatar
rayminator
Veteran
Posts: 344
Joined: Fri Feb 09, 2018 12:05 am
Projects: Redoing games to fix spelling mistakes other companys that don't care
Location: Canada
Contact:

Re: Issues with a custom main menu

#34 Post by rayminator » Fri Jan 10, 2020 6:43 pm

Thought you were talking about the in-game I don't know how to fix that but the only thing I can think of doing is not to worry about that the players always can click return or click on back to main menu

Adabelitoo
Regular
Posts: 37
Joined: Sat Apr 13, 2019 2:32 pm
Contact:

Re: Issues with a custom main menu

#35 Post by Adabelitoo » Fri Jan 10, 2020 9:02 pm

Yeah I know that and honestly I prefer it this way because it's another difference from the average renpy NSFW game, but I'm afraid that if I changed that without noticing it, maybe I changed something else, and that something else maybe could mess the game in the future. I'm probably worrying for nothing, but that's how I am sadly.

User avatar
rayminator
Veteran
Posts: 344
Joined: Fri Feb 09, 2018 12:05 am
Projects: Redoing games to fix spelling mistakes other companys that don't care
Location: Canada
Contact:

Re: Issues with a custom main menu

#36 Post by rayminator » Fri Jan 10, 2020 9:22 pm

just don't forget that it is your choice what you want to do it does take your time to build a game just don't rush like other dev's do

you will make a great game so far your game is great just like summertime Sega game so don't give up on it

it's just there were more problem in one question how to fix it might be other code in your game that might be the cause as well

sorry I am drinking so I might not make sense

Post Reply

Who is online

Users browsing this forum: Google [Bot]