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.
-
yon
- Regular
- Posts: 153
- Joined: Tue Sep 09, 2014 5:09 pm
- Projects: YDSP
- Location: United States
-
Contact:
#1
Post
by yon » Tue Nov 04, 2014 7:45 pm
Now, I'm sure this is possible. In fact, I'm pretty sure I've seen it done somewhere in the documentation or the tutorial or something, but for the life of me I can't find it.
What I'm trying to do is give you the option to go back and choose options until you've gone through them all or gotten the right one.
Say, this is the code:
Code: Select all
menu:
"Choice 1":
"right choice"
"Choice 2":
"wrong choice."
#lets you choose again now
How would I go about making it so you see the menu again after clicking Choice 2?
(Preferably, I'd like to make it so Choice 2 doesn't show up again in that playthrough, but making it persistent data so it NEVER shows up again isn't what I want to do. I think I'll just add $ choice_2 = True and tell the menu to not show Choice 2 if choice_2 == True.)
Last edited by
yon on Tue Nov 04, 2014 10:45 pm, edited 1 time in total.
-
TheChris
- Regular
- Posts: 47
- Joined: Sat Oct 11, 2014 9:26 pm
- Projects: Stickshooter
- Deviantart: innocencecanceller
- Location: United States
-
Contact:
#2
Post
by TheChris » Tue Nov 04, 2014 9:51 pm
Here's what you could do:
Code: Select all
label start:
e "zz"
$ choice2 = False
label decision:
if choice2:
menu:
"Choice 1":
"right choice"
else:
menu:
"Choice 1":
"right choice"
"Choice 2":
"wrong choice."
$ choice2 = True
jump decision
e "xxx"
-
yon
- Regular
- Posts: 153
- Joined: Tue Sep 09, 2014 5:09 pm
- Projects: YDSP
- Location: United States
-
Contact:
#3
Post
by yon » Tue Nov 04, 2014 10:43 pm
Here's what I wound up doing:
Code: Select all
$ choice01 = False
$ choice03 = False
label an_end_good_decision:
menu:
"01" if choice01 == False:
$ choice01 = True
"Wrong choice"
jump an_end_good_decision
"02":
"Right choice"
"03" if choice03 == False:
$ choice03 = True
"Wrong choice"
jump an_end_good_decision
This seems to work. Thank you for your help!
-
meiri
- Regular
- Posts: 177
- Joined: Wed Jun 25, 2014 6:21 pm
- Projects: Tutor Tabitha, Movement
- Organization: Blue Bottlecap Games
- Location: East Coast, US
-
Contact:
#4
Post
by meiri » Tue Nov 04, 2014 10:54 pm
Just for your own knowledge, you can label menus.
Code: Select all
menu an_end_good_decision:
"01" if choice01 == False:
$ choice01 = True
"Wrong choice"
jump an_end_good_decision
"02":
"Right choice"
"03" if choice03 == False:
$ choice03 = True
"Wrong choice"
jump an_end_good_decision
What's in a loop? A loop iterated in any other way would output as sweet.
--
Have a look at my GxG kinetic novel, Movement, if you have the chance?
-
TheChris
- Regular
- Posts: 47
- Joined: Sat Oct 11, 2014 9:26 pm
- Projects: Stickshooter
- Deviantart: innocencecanceller
- Location: United States
-
Contact:
#5
Post
by TheChris » Tue Nov 04, 2014 11:01 pm
meiri wrote:Just for your own knowledge, you can label menus.
Code: Select all
menu an_end_good_decision:
"01" if choice01 == False:
$ choice01 = True
"Wrong choice"
jump an_end_good_decision
"02":
"Right choice"
"03" if choice03 == False:
$ choice03 = True
"Wrong choice"
jump an_end_good_decision
Thank you. I never knew that.
Users browsing this forum: No registered users