[Question] How differ choice menu

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
Ageha
Regular
Posts: 38
Joined: Wed Apr 20, 2011 11:08 am
Tumblr: agehaatlas
Deviantart: Ageha1304
Contact:

[Question] How differ choice menu

#1 Post by Ageha » Fri Jan 03, 2014 1:45 pm

So I got a little problem. I want to make a choice where one choice appears depending on a choice had made before. How can I do this?

User avatar
SundownKid
Lemma-Class Veteran
Posts: 2299
Joined: Mon Feb 06, 2012 9:50 pm
Completed: Icebound, Selenon Rising Ep. 1-2
Projects: Selenon Rising Ep. 3-4
Organization: Fastermind Games
Deviantart: sundownkid
Location: NYC
Contact:

Re: [Question] How differ choice menu

#2 Post by SundownKid » Fri Jan 03, 2014 2:05 pm

You can do it like:

Code: Select all

menu:
    "Open the door.":
       "I opened the front door."
    "Sneak in the back door." if superspy == True:
       "I was able to sneak in without anyone noticing."
    "Break through the ceiling." if thief == True:
       "I broke through the ceiling instead."

Crazy Li
Regular
Posts: 113
Joined: Fri Jan 03, 2014 3:35 pm
Contact:

Re: [Question] How differ choice menu

#3 Post by Crazy Li » Fri Jan 03, 2014 8:58 pm

To further elaborate on SundownKid's answer, just make sure to set a variable in the previous choice. That's what you're checking here.

So if in some part of your game you had a choice like...

Code: Select all

menu:
    "Become a spy":
         $ superspy = True
         jump spy
     "Become a thief":
         $ thief = True
         jump thief
     "Become a cop":
         jump cop
You can then utilize the code that Sundown posted, checking for the variables you set earlier when the player made those decisions that set them.

User avatar
Ageha
Regular
Posts: 38
Joined: Wed Apr 20, 2011 11:08 am
Tumblr: agehaatlas
Deviantart: Ageha1304
Contact:

Re: [Question] How differ choice menu

#4 Post by Ageha » Sat Jan 04, 2014 6:15 am

Thank you! Everything works just like it should! :)

Post Reply

Who is online

Users browsing this forum: Google [Bot]