Say I have a menu. The options in that menu are variable, i.e. if Flag A == True, menu option A will appear. At a given point in time, there might be zero associated flags set to True, or there might be as many as 15. If the latter case, there would be far too many menu options to appear on the screen. The most obvious solution, then, would be to have Ren'py execute code to increment a "Counter" variable +1 upward each time a menu option is displayed. If the Counter reaches a certain integer value (e.g. if Counter == 7), it would trigger the game to display an eighth menu option for "More". Clicking on "More" would jump to another label within the scenario, where a second menu would be triggered, displaying the options which were not flagged as having been displayed the first time around. A "spillover" menu, so to speak.
But this only works if there's a way to have Ren'py add flags on or between menu items... Which, I don't know if there is.
If there's a way to do this, or a better way, please let me know.
Variable menus with lots of options
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.
-
- Newbie
- Posts: 4
- Joined: Wed Sep 05, 2018 6:46 pm
- Contact:
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3791
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Variable menus with lots of options
You may be better off making a custom screen with the options on it as buttons.
On a personal note: this idea sounds terrible.
I recently bought a commercial VN with similar design and I've almost run out of save slots just getting halfway through one route! There were so many choices that I don't even remember what prompted most of them.
I hate too many choices.
On a personal note: this idea sounds terrible.
I recently bought a commercial VN with similar design and I've almost run out of save slots just getting halfway through one route! There were so many choices that I don't even remember what prompted most of them.
I hate too many choices.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Re: Variable menus with lots of options
Coooould you write it as a call screen instead of an ordinary choice menu and then just add a viewport scroll?
Something like this, maybe, just with more options?
Code: Select all
screen choices(xinitial=0.0, yinitial=0.0):
viewport:
xinitial yinitial
scrollbars "vertical"
mousewheel True
draggable True
pagekeys True
side_yfill True
vbox:
if flag_a:
textbutton _("Flag A.") action Jump("label_a")
if flag_b:
textbutton _("Flag B.") action Jump("label_b")
textbutton _("No flag.") action Jump("no_flag")
Code: Select all
label start:
"1."
$ flag_a = False
$ flag_b = False
"2."
menu:
"Set flag A.":
$ flag_a = True
jump ch
"Set flag B.":
$ flag_b = True
jump ch
label ch:
call screen choices
label label_a:
"A."
jump start
label label_b:
"B."
jump start
label no_flag:
"Nothing."
jump start
return
Re: Variable menus with lots of options
Or just add a viewport to the choice screen.
Who is online
Users browsing this forum: No registered users