[SOLVED] Menu with multiple say statements?

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
phibbean
Newbie
Posts: 4
Joined: Sat Jan 08, 2022 6:54 pm
Contact:

[SOLVED] Menu with multiple say statements?

#1 Post by phibbean » Thu Aug 25, 2022 3:24 pm

I'm looking for a way for a player to keep clicking through dialogue while menu choices are available. Is this possible without creating custom buttons for every single menu?

Ex:

Code: Select all

label start:
	e "Hi!"
	e "How are you?"
	e "Good to meet you."
	menu:
		"Who are you?":
			jump choice1
		"Hello.":
			jump choice2
So a player could click through multiple say statements ("Hi!" "How are you?" etc. would all display as separate statements rather than one), and the whole time the menu choices would be available to click. Kind of similar to how Telltale games keep another character talking while you pick your dialogue choices.

Thanks!
Last edited by phibbean on Thu Aug 25, 2022 11:17 pm, edited 1 time in total.

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

Re: Menu with multiple say statements?

#2 Post by Alex » Thu Aug 25, 2022 5:01 pm

phibbean wrote:
Thu Aug 25, 2022 3:24 pm
... Is this possible without creating custom buttons for every single menu? ...
It's not that you need to create buttons for every single menu... but it might looks like

Code: Select all

screen onscreen_choices_scr(list_of_choices=None):
    
    style_prefix "choice"
    
    vbox:
        align(0.5,0.2)
        for (choice_text, label_to_jump_to, next_label_name) in list_of_choices:
            button:
                text choice_text
                action [SetVariable("next_label", next_label_name),
                    Hide("onscreen_choices_scr"),
                    Jump(label_to_jump_to) ]

default next_label = None

# The game starts here.

label start:
    "..."
    # you need to pass the list of choices to the screen:
    # (some text (the choice), name of label to jump to if choice is chosen,
    # name of label to jump to after choice)
    show screen onscreen_choices_scr([ ("Who are you?", "choice1", "end"),
        ("Hello.", "choice2", "another_label") ])
    while True:
        e "Hi!"
        e "How are you?"
        e "Good to meet you."
        
label another_label:
    e "?.."
    "... ..."
    show screen onscreen_choices_scr([ ("#2 Who are you?", "choice1", "end"),
        ("#2 Hello.", "choice2", "end") ])
    while True:
        e "#2 Hi!"
        e "#2 How are you?"
        e "#2 Good to meet you."
        
label end:
    "The end."
    "?!"
    return
    
label choice1:
    "Who are you?.."
    $ renpy.jump(next_label)
    
label choice2:
    "Hello..."
    $ renpy.jump(next_label)
https://www.renpy.org/doc/html/statemen ... renpy.jump
https://www.renpy.org/doc/html/screen_actions.html#

phibbean
Newbie
Posts: 4
Joined: Sat Jan 08, 2022 6:54 pm
Contact:

Re: Menu with multiple say statements?

#3 Post by phibbean » Thu Aug 25, 2022 11:16 pm

Thanks! This is really helpful. I'll have to play with this over the weekend.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot]