Page 1 of 1

Make choice disappear after being chosen

Posted: Fri May 14, 2021 1:10 am
by lindsay-jb
I have a section in the script where you can investigate multiple items. I want it to loop back to the menu screen until all 3 choices have been made and you can then move on. Is there a way I can loop back to the choice menu but remove options that have already been selected? And how would I program it to tell the game to go on once all 3 Choices have been investigated?

Additionally, my choice buttons always have a drastically different position depending on how many options I put in. Is there a way I can make the top button anchored and not move, and additional buttons are just added underneath it?

Thanks!

Re: Make choice disappear after being chosen

Posted: Fri May 14, 2021 2:30 am
by strayerror
For the first part of your question I think you're looking for this: https://www.renpy.org/doc/html/menus.html#menu-set

For the latter part I believe you'd have to investigate making an alteration to the menu screen in screens.rpy.

Re: Make choice disappear after being chosen

Posted: Sat May 15, 2021 7:38 pm
by VictorSeven
Here's what I did in my game.

Code: Select all

label mondaychoicesetup:
default _mondaychoice = 0
$mc1 = True
$mc2 = True
$mc3 = True
$mc4 = True
$mc5 = True
$mc6 = False
if _mondaychoice == 5:
    $mc6 = True
"Damn. Jack and Alphonse must be putting in work. I'm actually done early for once."
label mondaychoice:
    scene janitor02 with fade
    menu mondaychoice1:
        "What should I use all this extra time for?"
        "Check in with Jade" if mc1:
            jump jadechatmonday

        "Visit Kanako" if mc2:
            jump kanakochatmonday

        "See how Chiara is doing" if mc3:
            jump chiarachatmonday

        "Drop by to see Aoibheann" if mc4:
            jump aoibheannchatmonday

        "Check on the pool" if mc5:
            jump poolcheckmonday

        "Finish up for the day" if _mondaychoice == 5:
            jump firstattack

#talk to Jade
label jadechatmonday:
    $_mondaychoice +=1
    $mc1 = False
    #insert scene here
    jump mondaychoice
Things to note:
I created an integer variable to track how many choices the player has chosen (_mondaychoice).
I created a boolean variable for each option($mc1 through $mc6), and set the last one to False. It only becomes true once the required number of choices have been chosen. That's the Continue option.
I created the menu using the "if (variable here)" which tells the program to only display the menu option if the boolean variable for that option is True. You can also do this to force the program to display the last choice once EITHER "if $mc6:" OR "_mondaychoice == x:", where x = the number of options the player should choose before this appears.
When the option is selected, you want to add 1 to your integer variable and make the boolean variable for that option False.
At the end of the option's scene, you want to jump to label mondaychoice, and you'll see that the option you just chose is gone.

Hope this helps.