Make choice disappear after being chosen

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
lindsay-jb
Regular
Posts: 26
Joined: Tue Aug 25, 2020 1:05 am
Contact:

Make choice disappear after being chosen

#1 Post by lindsay-jb » Fri May 14, 2021 1:10 am

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!

strayerror
Regular
Posts: 135
Joined: Fri Jan 04, 2019 3:44 pm
Contact:

Re: Make choice disappear after being chosen

#2 Post by strayerror » Fri May 14, 2021 2:30 am

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.

VictorSeven
Newbie
Posts: 2
Joined: Sat May 15, 2021 7:26 pm
Soundcloud: nightblindband
itch: teamemberwings
Contact:

Re: Make choice disappear after being chosen

#3 Post by VictorSeven » Sat May 15, 2021 7:38 pm

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.

Post Reply

Who is online

Users browsing this forum: Imperf3kt