Basically I want to choose a small random subset of options for a choice menu from a larger set without duplicating any options. A simple sample would be trying to get a choice menu "You're being attacked, what should you do?" to show a random assortment of four of the following seven options ("Jump" jump jump1, "Dodge" jump dodge, "Charge" jump charge, "Duck" jump duck, "Wait" jump wait, "Attack Magic" jump attack_magic, "Defense Magic" jump defense_magic)
renpy.random.sample can choose the subset (ie renpy.random.sample(battle1, 4) will pick four out of the seven options without duplicating them), but I can't figure out how to get random.sample's output to appear as separate options in the menu. The closest I've gotten so far is by brute forcing...
Code: Select all
$ battle1 = renpy.random.choice(['a', 'b', 'etc'])
if battle1 == 'a':
menu:
pro "You're being attacked, what should you do?"
"Jump":
jump jump1
"Dodge":
jump dodge
"Charge":
jump charge
"Duck":
jump duck
elif battle1 == 'b':
menu:
pro "You're being attacked, what should you do?"
"Jump":
jump jump1
"Dodge":
jump dodge
"Charge":
jump charge
"Wait":
jump wait
[[Repeat for every variation of 4 out of 7 options]]