What I'm trying to do is have choices locked behind variable checks. That is pretty simple on its face, and I'm familiar with the way that's built into ren'py. The issue, though, is that I want to tell players WHY the choice is showing but not selectable. As far as I understand it, the native Ren'Py way to do it does not do anything but show the option and make it unselectable.
Ideally, my game's choice menu would show all possible options. Options that the player does not have the appropriate stats/flags for would be in red text. These red buttons could still be clicked, though, and get a message telling them why they can't do it in the dialogue box.
I have figured out a rather inelegant way to do this. It's not scalable and requires a lot of custom and redundant coding when multiple gated choices are involved. Here is what that looks like:
Code: Select all
if test_variable < 20:
menu test_choice:
"What do you do?"
"Eat some sushi":
jump test_choice_sushi
"Go for a walk":
jump test_choice_walk
"{color=#FF0000}Punch the moon{/color}":
"I don't have a high enough TEST VARIABLE to do that!"
jump test_choice
else:
menu test_choice_a:
"What do you do?"
"Eat some sushi":
jump test_choice_sushi
"Go for a walk":
jump test_choice_walk
"{color=#3CB043}Punch the moon{/color}":
jump test_choice_moon
label test_choice_sushi:
"You eat sushi."
jump locked_choice_tester_2
label test_choice_walk:
"You go for a walk."
jump locked_choice_tester_2
label test_choice_moon:
"You punch the moon. Sick."
jump locked_choice_tester_2
Any help would be greatly appreciated!