Nested menu choices

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
Phoenyx75
Newbie
Posts: 15
Joined: Wed Dec 22, 2021 11:49 am
Contact:

Nested menu choices

#1 Post by Phoenyx75 »

I was wondering whether it's possible to do menu choices immediately after having already done so. So, for instance, first a menu that asks what someone would like to talk about, with 3 choices, and then once they pick one, whether they believe something, and they can answer either yes or no. I've looked at the documentation and it doesn't seem to say if this is possible, but I imagine it is.

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: Nested menu choices

#2 Post by Per K Grok »

Phoenyx75 wrote: Sun Dec 26, 2021 7:28 pm I was wondering whether it's possible to do menu choices immediately after having already done so. So, for instance, first a menu that asks what someone would like to talk about, with 3 choices, and then once they pick one, whether they believe something, and they can answer either yes or no. I've looked at the documentation and it doesn't seem to say if this is possible, but I imagine it is.
Not sure if this covers what you are looking for.

Code: Select all

    menu menu1 :
        "Pick 1":
            jump menu2
        "Pick 2":
            jump menu2
        "Pick 3":
            jump menu2

    menu menu2:
        "Yes":
            jump menu1
        "No":
            jump menu1

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

Re: Nested menu choices

#3 Post by Alex »

The same mechanic, but looks more like nested menus (named menus make it possible to jump to one or another like one can jump to labels)

Code: Select all

label start:
    a "Some questions..."
    menu menu_1:
        "What would you like to talk about?"
        "Weather":
            menu menu_1_1:
                "How do you like the local weather?"
                "Fine":
                    b "It's fine... rain, cold wind and all - it's just fine."
                    jump menu_1
                    
                "Awful":
                    b "Are you kidding? It's been raining since I arrived!"
                    jump menu_1

        "Some other topic":
            menu menu_1_2:
                "2 + 2 = ?"
                "Four":
                    b "Everybody knows it."
                    jump menu_1
                    
                "Three to Five":
                    b "That depends of..."
                    a "Khm, try again."
                    jump menu_1_2

        "End conversation":
            b "Enough talking for today..."
    a "Well..."

Phoenyx75
Newbie
Posts: 15
Joined: Wed Dec 22, 2021 11:49 am
Contact:

Re: Nested menu choices

#4 Post by Phoenyx75 »

Thanks, Per and Alex :-). I actually got a response in the renpy Discord forum that got me a working version, but I am bookmarking this thread in case I need more info on this subject later.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]