How would I create a menu that only shows its options after a text box finishes?

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
Automne
Newbie
Posts: 4
Joined: Thu Oct 04, 2018 11:13 pm
Contact:

How would I create a menu that only shows its options after a text box finishes?

#1 Post by Automne »

The way it happens by default is that the text box and the menu both appear at the same time. What I'd like to do is have a text box that types out its text, then once it finishes have the menu options to progress to one of the next scenes appear with the text box still visible at the bottom. I'll admit it's probably easy to do, but I haven't been able to find anything about it on google or in the documentation.

Simply put, how would I delay a menu's choices appearing? Anything I put before the menu items except the dialogue box itself (such as a pause) gives an "expected menuitem" error, which makes sense but is a bit frustrating.

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

Re: How would I create a menu that only shows its options after a text box finishes?

#2 Post by Imperf3kt »

A choice menu won't show the text box unless you give it a line of dialogue to display. So just leave it out.

Example:

Code: Select all

    menu:
        "This text will appear in the text box, and the menu will show at the same time." 
        
        "option 1":
            #do something
        "option 2":
            #do something else
To have the dialogue box go away, do it like this.

Code: Select all

    "This text will appear in the text box, and the menu will show after it has shown." 
    menu:
        "option 1":
            #do something
        "option 2":
            #do something else
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Automne
Newbie
Posts: 4
Joined: Thu Oct 04, 2018 11:13 pm
Contact:

Re: How would I create a menu that only shows its options after a text box finishes?

#3 Post by Automne »

Imperf3kt wrote: Fri Oct 05, 2018 12:31 am (snip)
Yes, the problem is I don't want the dialogue box to go away. I guess my post might have been worded poorly. Here's what I want to happen:

1. Text box appears, and text starts to type.
2. Once the text box finishes typing and all dialogue is visible, the menu options appear. Text box is still visible at this time while the options are on the screen.
3. Player clicks an option and moves on.

Coding it the first way makes the options appear too soon, while the text is still typing.

Coding it the second way gets the dialogue to finish typing before the options show up, like I want, but removes the finished text box when the options appear which I don't want.

philat
Eileen-Class Veteran
Posts: 1909
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: How would I create a menu that only shows its options after a text box finishes?

#4 Post by philat »

Code: Select all

    "This text will appear in the text box, and the menu will show after it has shown." 
    menu:
        extend ""
        
        "option 1":
            #do something
        "option 2":
            #do something else

Automne
Newbie
Posts: 4
Joined: Thu Oct 04, 2018 11:13 pm
Contact:

Re: How would I create a menu that only shows its options after a text box finishes?

#5 Post by Automne »

philat wrote: Fri Oct 05, 2018 2:59 am

Code: Select all

    "This text will appear in the text box, and the menu will show after it has shown." 
    menu:
        extend ""
        
        "option 1":
            #do something
        "option 2":
            #do something else
Thank you, that worked!

Post Reply

Who is online

Users browsing this forum: No registered users