Menu Choices
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.
- TheOneAndOnly-K
- Regular
- Posts: 78
- Joined: Mon Apr 07, 2014 10:33 am
- Contact:
Menu Choices
Okay, I want to do two things with menu choices...
1. To move the menu choices up, so they're not running over my text box.
2. To make certain choices available if a path/gift is unlocked.
Eg: I have asked player to decide whether they wish to join school council or not. If they agree, I'd like to open a new option in the morning for them to 'visit the office', but not skip the time period doing so.
1. To move the menu choices up, so they're not running over my text box.
2. To make certain choices available if a path/gift is unlocked.
Eg: I have asked player to decide whether they wish to join school council or not. If they agree, I'd like to open a new option in the morning for them to 'visit the office', but not skip the time period doing so.
- TheOneAndOnly-K
- Regular
- Posts: 78
- Joined: Mon Apr 07, 2014 10:33 am
- Contact:
Re: Menu Choices
Bump...
Re: Menu Choices
To make a conditional menu choice, just use if. Let's say that earlier in the game players could choose to learn Spanish, which set a variable $ Spanish = True (and if they chose not to it's set to $ Spanish = False). Then your menu could read:
Then the last option will only show up in the menu is Spanish is True.
Code: Select all
"What shall I do today?"
menu:
"Go shopping":
...
"Stay at home":
...
"Go to Spain" if Spanish:
...
- TheOneAndOnly-K
- Regular
- Posts: 78
- Joined: Mon Apr 07, 2014 10:33 am
- Contact:
Re: Menu Choices
That's why it's not working.. I put the coding in backwards XD Thanks a lot~
Re: Menu Choices
1. In screens.rpy
Code: Select all
screen choice:
window:
style "menu_window"
xalign 0.5
yalign 0.5 #<=== set it to 0.3 or so to move choice menu up (rest of the code unchanged)
- TheOneAndOnly-K
- Regular
- Posts: 78
- Joined: Mon Apr 07, 2014 10:33 am
- Contact:
Re: Menu Choices
It works, but perhaps there's a way it wont cut into the text box...?
- TheOneAndOnly-K
- Regular
- Posts: 78
- Joined: Mon Apr 07, 2014 10:33 am
- Contact:
Re: Menu Choices
Another question:
How would I write it if, as above it was
but with two ?'s needed to be on.
How would I write it if, as above it was
Code: Select all
menu:
"Yadda" if ? == True:
Re: Menu Choices
You can use boolean operations - https://docs.python.org/3/library/stdtypes.html
As for positioning choice menu, it's all up to you how to "design" it - if you really want to show 10 or more choices you could make a two-column choice menu or put it inside a viewport to let player scroll through it.
http://lemmasoft.renai.us/forums/viewto ... =8&t=16914
http://www.renpy.org/doc/html/screens.html#viewport
Code: Select all
menu:
"Yadda" if var1 == True and var2 >= 5:
http://lemmasoft.renai.us/forums/viewto ... =8&t=16914
http://www.renpy.org/doc/html/screens.html#viewport
- TheOneAndOnly-K
- Regular
- Posts: 78
- Joined: Mon Apr 07, 2014 10:33 am
- Contact:
Re: Menu Choices
Thank you!~
- TheOneAndOnly-K
- Regular
- Posts: 78
- Joined: Mon Apr 07, 2014 10:33 am
- Contact:
Re: Menu Choices
Bump!
Question: If I have an 'if' command I want to run first, how do I make it run without turning the other commands off?
Question: If I have an 'if' command I want to run first, how do I make it run without turning the other commands off?
Re: Menu Choices
It works like:
- do one of possible stuffsor
- or do each of stuffs if appropriate condition is true
http://www.renpy.org/doc/html/conditional.html
- do one of possible stuffs
Code: Select all
if var == value:
do stuff
else:
do other stuff
Code: Select all
if var == value:
do stuff
elif var == value_2:
do stuff_2
else:
do other stuff
Code: Select all
if var_1 == value_1:
do stuff_1
if var_2 == value_2:
do stuff_2
if var_3 == value_3:
do stuff_3
Who is online
Users browsing this forum: No registered users