Page 1 of 1
Second question to confirm the first answer
Posted: Sun Dec 08, 2019 6:33 am
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?
Re: Second question to confirm the first answer
Posted: Sun Dec 08, 2019 6:51 am
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
Re: Second question to confirm the first answer
Posted: Sun Dec 08, 2019 7:19 am
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

Re: Second question to confirm the first answer
Posted: Sun Dec 08, 2019 7:36 am
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
Re: Second question to confirm the first answer
Posted: Sun Dec 08, 2019 8:42 am
by Newnewbie
Works great... thank you SO MUCH!
Re: Second question to confirm the first answer
Posted: Sun Dec 08, 2019 8:45 am
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:
is equivalent to
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
Re: Second question to confirm the first answer
Posted: Sun Dec 08, 2019 8:51 am
by Newnewbie
Thank you for the great variant too ^^