Ren'py locked choices

shitcrap1

Newbie
Game Developer
Aug 15, 2023
99
505
hello everyone,
Can someone help me with codes to lock choices that have been al ready choosed
 

maximusleroy

Member
Aug 26, 2016
162
706
You can use

Python:
default menuset = set()

menu:
    set menuset
    
    "choice 1":
        ##code

    "choice 2":
        ##code

    "choice 3":
        ##code
You might have to empty menuset before a menu if different menu share the same choice name
 
  • Like
Reactions: shitcrap1

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,581
2,219
The above code by maximusleroy will remove any menu choices that has already been used. If none are left (you picked everything), things will continue to the next statement below the menu:.

In case you weren't already aware, you can add to menu choices too.

Python:
$ opt1_picked = False

menu:
    "Choice #1" if opt1_picked == False:
        $ opt1_picked = True
        "You picked option 1"

    "{color=#FF0000}Choice #1{/color}" if opt1_picked == True:
        "You already did that!"

Not a great example and there are lots of ways to improve it. But it demonstrates the use of if.

Beyond that...
The menu: statement uses screen choice():, which is entirely customizable - if you want to get creative.

Here's at least one example, where the menu choices are still shown but are grayed out (using sensitive False) by adding a custom parameter called enabled to the menu choice.
https://f95zone.to/threads/greying-out-choices-that-dont-meet-requirements.55499/#post-3737589

Somewhere amongst those three should be a solution you can live with.