In the test game I'm making I wanna have choices that are don't exist unless they are unlocked by prior choices.
Example image:
In this image certain paths/choices are impossible unless the player choice to do an prior action that unlocked the ability to choose that option as indicated by the yellow lock icons.
How do I program this?
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.
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.
-
- Regular
- Posts: 38
- Joined: Sat Apr 21, 2018 3:46 am
- Contact:
- namastaii
- Eileen-Class Veteran
- Posts: 1350
- Joined: Mon Feb 02, 2015 8:35 pm
- Projects: Template Maker for Ren'Py, What Life
- Github: lunalucid
- Skype: Discord: lunalucid#1991
- Soundcloud: LunaLucidMusic
- itch: lunalucid
- Location: USA
- Contact:
Re: How do I program this?
you only need to have a list of variables that are all False by default
default my_variable1 = False
default my_variable2 = False
menu:
"Choice that always shows up":
e "blah blah blah"
"Unlocked choice" if my_variable1:
e "you finally unlocked this choice"
default my_variable1 = False
default my_variable2 = False
menu:
"Choice that always shows up":
e "blah blah blah"
"Unlocked choice" if my_variable1:
e "you finally unlocked this choice"
-
- Regular
- Posts: 38
- Joined: Sat Apr 21, 2018 3:46 am
- Contact:
- namastaii
- Eileen-Class Veteran
- Posts: 1350
- Joined: Mon Feb 02, 2015 8:35 pm
- Projects: Template Maker for Ren'Py, What Life
- Github: lunalucid
- Skype: Discord: lunalucid#1991
- Soundcloud: LunaLucidMusic
- itch: lunalucid
- Location: USA
- Contact:
Re: How do I program this?
If you're keeping it simple, you can put those variables in the script before the game starts (where characters are defined in the beginning template and such) and after you picked a choice, you could put any dialogue you want there or jump to another scene but just before in the script you can just change the variable with $. You should look at the documentation and other examples on the forums since there is a lot of information in both.
-
- Regular
- Posts: 38
- Joined: Sat Apr 21, 2018 3:46 am
- Contact:
Re: How do I program this?
My bad code, for reference:
The third option is meant to be the unlocked choice.
Code: Select all
menu:
"Try to calm down.":
jump calmdown1
"Ask question.":
jump askquestion1
"Use gun." if bringgun = True:
jump usegun
- namastaii
- Eileen-Class Veteran
- Posts: 1350
- Joined: Mon Feb 02, 2015 8:35 pm
- Projects: Template Maker for Ren'Py, What Life
- Github: lunalucid
- Skype: Discord: lunalucid#1991
- Soundcloud: LunaLucidMusic
- itch: lunalucid
- Location: USA
- Contact:
Re: How do I program this?
it needs to be indented correctly but also you don't need to put if it equals true, if you just put "if bringgun:" then it'll assume if it's true otherwise if you want to do the opposite and check that it's false, you'd do "if bringgun == False". Use double == because we use that to check a variable and we use a single = to assign.
Code: Select all
menu:
"Try to calm down.":
jump calmdown1
"Ask question.":
jump askquestion1
"Use gun." if bringgun = True:
jump usegun
Who is online
Users browsing this forum: Semrush [Bot]