Remembering choices

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
Blackravebow
Newbie
Posts: 2
Joined: Thu Dec 14, 2023 6:25 pm
Contact:

Remembering choices

#1 Post by Blackravebow »

I’m trying to figure out how to make it so when you give the player choices, they have to click through each one in order for the game to progress.
When you click one choice you go through the dialogue and end back up at the choice menu with the choice you just selected blurred out so now you have to click through the other couple and then the game continues. The way I currently have it is that you select the choice, go through one of the dialogues, and then the story skips the other two choices and continues.
Attachments
IMG_9024.jpeg
(5.05 MiB) Not downloaded yet
IMG_9023.jpeg
(4.19 MiB) Not downloaded yet

User avatar
m_from_space
Miko-Class Veteran
Posts: 975
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Remembering choices

#2 Post by m_from_space »

Blackravebow wrote: Fri Dec 29, 2023 11:27 am I’m trying to figure out how to make it so when you give the player choices, they have to click through each one in order for the game to progress.
That's a very basic thing to do, there are different approaches. One would be to just use a list that stores the already chosen paths. And Renpy actually ships with something like this called a "menuset": https://www.renpy.org/doc/html/menus.html#menu-set

You could also implement it yourself, since you want your non-available paths to be "blurred". In this case the biggest problem is changing the menu screen so you can pass arguments for items that should be blurred: https://www.renpy.org/doc/html/menus.ht ... -arguments

Code: Select all

default choices = []

label start:
    "Please pick a color!"
    menu:
        "Purple" if "purple" not in choices:
            $ choices.append("purple")
            jump scenario_purple
        "Orange" if "orange" not in choices:
            $ choices.append("orange")
            jump scenario_orange
        "Purple" (True) if "purple" in choices:
            pass
        "Orange" (True) if "orange" in choices:
            pass
This code would send "True" to the menu screen in cases the paths were already chosen. Now you would have to alter the "choice" screen inside <screens.rpy> so it will check for that argument we sent and in cases where it is "True", the item is displayed as a blurred text or image instead of a textbutton the user can click. I hope that helps you make what you want to achieve.

Post Reply

Who is online

Users browsing this forum: Alex