[SOLVED] NVL menu is showing up for the ADV menu as well?

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
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

[SOLVED] NVL menu is showing up for the ADV menu as well?

#1 Post by Kinmoku »

Hi all,

I use choice menus in my project from both NVL and ADV modes. However, when I'm in ADV, the NVL menu shows up, with the NVL frame too. My code is below:

Code: Select all

screen choice(items):
    style_prefix "choice"

    vbox:
        for i in items:
            textbutton i.caption action i.action

screen nvl(dialogue, items=None):
    frame:
        pos (540, 30)
        
        side "c":
            area (0, 0, 844, 780)

            viewport id "vp":
                yadjustment ui.adjustment (value=9999, range=9999)

                vbox:
                    spacing gui.nvl_spacing
                    
                    use nvl_dialogue(dialogue)
                    
        ## Displays the menu, if given. The menu may be displayed incorrectly if
        ## config.narrator_menu is set to True, as it is above.
    vbox:
        pos(0, 850)
        for i in items:
                textbutton i.caption:
                    action i.action
                    style "nvl_button"
Does anyone know why this is happening? I'd like to use both menus in both situations.
Last edited by Kinmoku on Mon May 25, 2020 9:19 am, edited 1 time in total.

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

Re: NVL menu is showing up for the ADV menu as well?

#2 Post by gas »

I'm not totally sure, but probably you can leave the normal menu behaviour as default, and use the menu argument to determine when a menu is a NVL one or a normal one.

Code: Select all

# this one should be seen as NVL mode...
menu (nvl = True):

    "Gas is a genius":
        jump no_way

    "Gas is stupid":
        jump more_probably

If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: NVL menu is showing up for the ADV menu as well?

#3 Post by Kinmoku »

gas wrote: Wed May 20, 2020 5:52 am I'm not totally sure, but probably you can leave the normal menu behaviour as default, and use the menu argument to determine when a menu is a NVL one or a normal one.

Code: Select all

# this one should be seen as NVL mode...
menu (nvl = True):

    "Gas is a genius":
        jump no_way

    "Gas is stupid":
        jump more_probably

Weirdly, I use this for the NVL menu (which appears later in the game) but both menus still look the same. Is "menu (nvl = False):" what I should be using?

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

Re: NVL menu is showing up for the ADV menu as well?

#4 Post by gas »

According to documentation if you set (nvl = True) as a menu argument, that menu should be seen in nvl type.
While others should look as ADV.
So, why this doesn't work is out of my knowledge.

Another approach can be to assign the menu variable.

Code: Select all

default adv_menu = menu # create a copy of the standard menu
From now onward you can do:

Code: Select all

$ menu = adv_menu
menu:
     "bla bla"
to set a normal menu

Code: Select all

$ menu= nvl_menu
menu:
    "bla bla"
to have instead the menu look as a nvl menu
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

User avatar
MaydohMaydoh
Regular
Posts: 165
Joined: Mon Jul 09, 2018 5:49 am
Projects: Fuwa Fuwa Panic
Tumblr: maydohmaydoh
Location: The Satellite of Love
Contact:

Re: NVL menu is showing up for the ADV menu as well?

#5 Post by MaydohMaydoh »

I would think what Gas first said is right. Check to make sure you don't have "define menu = nvl_menu" somewhere in your code.

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: NVL menu is showing up for the ADV menu as well?

#6 Post by Kinmoku »

Thanks both. I think that's what was happening.

I now have:

Code: Select all

define adv_menu = menu
define menu = nvl_menu
And then use:

Code: Select all

$ menu = adv_menu

menu:
	"Choice 1":
		"Choice 1"
	"Choice 2":
		"Choice 2"
		
# for adv menu, and...

$ menu = nvl_menu

menu:
	"Choice 1":
		"Choice 1"
	"Choice 2":
		"Choice 2"

# for nvl menu. Seems to be working :D	

Post Reply

Who is online

Users browsing this forum: Bing [Bot]