Second question to confirm the first answer

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
Newnewbie
Newbie
Posts: 23
Joined: Sun Dec 08, 2019 4:06 am
Contact:

Second question to confirm the first answer

#1 Post by Newnewbie »

Hi guys!

I have got a question, cannot find an answer anywhere...

I would like to question the player, and ask him he is sure of its answer with a second question. And if the player answer "no" to the second question, then go back to the first question again. The issue is that I don't know how to go back to the first question ^^'

Have an idea, please?

User avatar
deltadidirac
Regular
Posts: 123
Joined: Fri Nov 30, 2018 5:00 am
Projects: Artworks and Comics
Tumblr: deltadidirac
Deviantart: Deltadidirac67
Location: Europe
Contact:

Re: Second question to confirm the first answer

#2 Post by deltadidirac »

I imagine what are you asking.... probablu you will must use some menu, but...

but if you can write all the sequences dialogue (as only an example), I can give you the right code

User avatar
Newnewbie
Newbie
Posts: 23
Joined: Sun Dec 08, 2019 4:06 am
Contact:

Re: Second question to confirm the first answer

#3 Post by Newnewbie »

Hello again!

Here's my current code:

Code: Select all

label start:

    menu:

        e "What do you want to do?"

        "Stay":
            jump choice1_yes

        "Leave":
            jump choice1_no

    label choice1_yes:

        $ menu_flag = True

        menu:

            e "Are you sure?"

            "Yes":
                jump choice2_yes

            "No":
                jump choice2_no

    label choice1_no:

        $ menu_flag = False

        menu:

            e "Are you sure?"

            "Yes":
                jump choice2_yes

            "No":
                jump choice2_no

    return
Thank you :)

User avatar
deltadidirac
Regular
Posts: 123
Joined: Fri Nov 30, 2018 5:00 am
Projects: Artworks and Comics
Tumblr: deltadidirac
Deviantart: Deltadidirac67
Location: Europe
Contact:

Re: Second question to confirm the first answer

#4 Post by deltadidirac »

Newnewbie wrote: Sun Dec 08, 2019 7:19 am Hello again!

Here's my current code:

Code: Select all

label start:

    menu:

        e "What do you want to do?"

        "Stay":
            jump choice1_yes

        "Leave":
            jump choice1_no

    label choice1_yes:

        $ menu_flag = True

        menu:

            e "Are you sure?"

            "Yes":
                jump choice2_yes

            "No":
                jump choice2_no

    label choice1_no:

        $ menu_flag = False

        menu:

            e "Are you sure?"

            "Yes":
                jump choice2_yes

            "No":
                jump choice2_no

    return
Thank you :)
If I understand well try so.....

Code: Select all

label start:
    menu:
        e "What do you want to do?"

        "Stay":
            $ menu_flag = True
            jump choice1_yes

        "Leave":
            $ menu_flag = False
            jump choice1_no

label choice1_yes:    

    menu:

        e "Are you sure?"

        "Yes":
            jump choice2_yes

        "No":
            jump start

label choice1_no:    

    menu:

        e "Are you sure?"

        "Yes":
            jump choice2_no

        "No":
            jump start
bye

User avatar
Newnewbie
Newbie
Posts: 23
Joined: Sun Dec 08, 2019 4:06 am
Contact:

Re: Second question to confirm the first answer

#5 Post by Newnewbie »

Works great... thank you SO MUCH!

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: Second question to confirm the first answer

#6 Post by IrinaLazareva »

Newnewbie wrote: Sun Dec 08, 2019 6:33 am And if the player answer "no" to the second question, then go back to the first question again.
The menu object can have its own tags that can be jumped on:

Code: Select all

label start:
    'begin'
    
    menu my_choice:
        e "What do you want to do?"
        "Stay":
            pass
        "Leave":
            menu:
                e "Are you sure you want to quit?"
                "Yes":        
                    return
                "No":
                    jump my_choice
    
    'the story goes on'
    return

i.e. the line:

Code: Select all

    menu my_choice:
        '?'
is equivalent to

Code: Select all

label my_choice:
    menu:
        '?'   


see example with
menu drink_menu
in doc https://www.renpy.org/doc/html/menus.html#in-game-menus
there's also you may also find an example of how menus interact with variables

User avatar
Newnewbie
Newbie
Posts: 23
Joined: Sun Dec 08, 2019 4:06 am
Contact:

Re: Second question to confirm the first answer

#7 Post by Newnewbie »

Thank you for the great variant too ^^

Post Reply

Who is online

Users browsing this forum: Google [Bot]