Is there a way to randomize menu options or is there anyway to hide 5 options but show only 3 out of the 5 to the player

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
User avatar
Trafagal
Regular
Posts: 100
Joined: Mon Apr 29, 2019 9:32 am
Contact:

Is there a way to randomize menu options or is there anyway to hide 5 options but show only 3 out of the 5 to the player

#1 Post by Trafagal »

Hi Community,

1. May I ask of there is a way to randomize menu options in renpy?

For example, I have 3 answers to a question of what to eat. I would like to randomize the options.

Code: Select all

menu:# Option 1        "American Coffee and Agolio Olio please." :
          # Option 2       "Breakfast Tea with Spaghetti Sauce and Ground Beef please." :
         # Option 3        "Straberry Soda with Curry Fried Rice please." :

2. Is there anyway to put 5 different answers in the codings but renpy will only show 3 answers at random to the player?

Thank you!
Check out some of my stuffs here:https://linktr.ee/theartofjoshlab

Art Portfolio: https://www.instagram.com/theartofjoshlab/

Working on a personal Visual Novel~

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: Is there a way to randomize menu options or is there anyway to hide 5 options but show only 3 out of the 5 to the pl

#2 Post by rayminator »

this is one way on how you want it to be

Code: Select all

menu:
        "test 1":
            $ testone_done = True
            jump testone
        "test 2" if testone_done == True:
            e "Hello you have unlocked me..."
            pass

    e "That's how you do it"
    return

User avatar
Trafagal
Regular
Posts: 100
Joined: Mon Apr 29, 2019 9:32 am
Contact:

Re: Is there a way to randomize menu options or is there anyway to hide 5 options but show only 3 out of the 5 to the pl

#3 Post by Trafagal »

rayminator wrote: Sun Feb 13, 2022 1:30 am this is one way on how you want it to be

Code: Select all

menu:
        "test 1":
            $ testone_done = True
            jump testone
        "test 2" if testone_done == True:
            e "Hello you have unlocked me..."
            pass

    e "That's how you do it"
    return
Thank you Rayminator! Will try it!
Check out some of my stuffs here:https://linktr.ee/theartofjoshlab

Art Portfolio: https://www.instagram.com/theartofjoshlab/

Working on a personal Visual Novel~

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]