Hide a choice?
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: 46
- Joined: Tue Nov 08, 2011 3:55 pm
- Contact:
Hide a choice?
Umm... Is it possible to hide a dp_period choice? Like cooking. If I wanna cook then I need a kitchen. And when I get a kitchen it is unlocked. Can somebody help? Thanks.
- Gear
- Miko-Class Veteran
- Posts: 764
- Joined: Tue Apr 05, 2011 10:15 pm
- Projects: Tempestus Sum
- Organization: Xenokos Interactive
- IRC Nick: Gear
- Skype: Skye.Gear
- Location: Grand Prairie, TX
- Contact:
Re: Hide a choice?
Set a flag. When the kitchen is unlocked:
Then, where the player is:
Just pay attention to the alignment. If you get it wrong, you'll end up with a mess. Like I do when I cook.
Code: Select all
$ kitchen_flag = True
Code: Select all
if kitchen_flag == True:
"Cook":
jump food_catastrophe
"Other options":
jump elsewhere_label
The best reason to get up in the morning is to outdo yourself: to do it better than you've ever done it before. But if you haven't done it better by nightfall... look at your globe and pick a spot: it's always morning somewhere.
-
- Miko-Class Veteran
- Posts: 758
- Joined: Tue Jun 22, 2010 12:54 am
- Completed: Christmas
- IRC Nick: DragoonHP
- Location: Zion Island, Solario
- Contact:
Re: Hide a choice?
Code: Select all
menu:
"Cook. if kitchen_flag == True"
jump food_catastrophe
"Other options."
jump elsewhere_label
-
- Regular
- Posts: 46
- Joined: Tue Nov 08, 2011 3:55 pm
- Contact:
Re: Hide a choice?
Thanks.
-
- Miko-Class Veteran
- Posts: 758
- Joined: Tue Jun 22, 2010 12:54 am
- Completed: Christmas
- IRC Nick: DragoonHP
- Location: Zion Island, Solario
- Contact:
Re: Hide a choice?
Oopsie... that code is wrong...
This is the right onw.
Code: Select all
menu:
"Cook" if kitchen_flag == True:
jump food_catastrophe
"Other options.":
jump elsewhere_label
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Hide a choice?
In python, there's usually no need to test for explicit truth. Writing:
works similarly, and is more idiomatic.
Code: Select all
menu:
"Cook" if kitchen_flag:
jump food_catastrophe
"Other options.":
jump elsewhere_label
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
-
- Regular
- Posts: 46
- Joined: Tue Nov 08, 2011 3:55 pm
- Contact:
Re: Hide a choice?
Yup. Thanks.
Who is online
Users browsing this forum: Google [Bot]