Choice won't go away after selecting it like it is supposed to

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
humanpencil
Newbie
Posts: 13
Joined: Mon Jun 03, 2019 3:42 am
Contact:

Choice won't go away after selecting it like it is supposed to

#1 Post by humanpencil »

so first off this is my system

Code: Select all

init:
    $ person_extro = 0
    $ person_intro = 0
    $ person_neutr = 0

init:
    $ marsh_rel = 1
    $ kyle_rel = 1
default choice1=1
default choice2=1
default choice3=1
pretty normal right? So I used this system to make certain choices appear only if you have = 1 in one of the person_ values. but then I also made it so in one of the lines that you do that, that line of code is repeated until you have chosen all the available choices:

Code: Select all

menu what_do:
            "What should you do now?"
            "Unpack your stuff" if choice1==1:
                $ choice1=0
                jump unpack
            "Clean up the somewhat dusty room." if choice2==1:
                $ choice2=0
                jump clean
            "Go socialise!" if person_extro == 1
                $ choice3=0
                jump talk_to_people
            "Play videogames" if person_intro == 1:
                $ choice3=0
                jump play_games
            "Go to the cafeteria" if person_neutr == 1:
                $ choice3=0
                jump go_cafe

        jump go_on
After the "go socialize" choice, there is another menu thingy:

Code: Select all

mar "What the hell.. I'm so sorry! I should really start being
        more careful!"
        menu:
            "It's okay! I'm fine really!":
                $ marsh_rel += 1
                jump fine
            "You bet you should!":
                $ marsh_rel -= 1
                jump hoes_mad
after that both have a different label:

Code: Select all

label lunch_sad:
     "blah blah text"
     jump what_do
and

Code: Select all

label lunch_happy:
       "blah blah text"
       jump what_do
but since like I said I have the "default system" that makes a choice disappear after you pick it, so that's what should happen right? Well for some reason when it goes back to the choices (what_do), the option "go socialise" is still there.. Can someone fix this?

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Contact:

Re: Choice won't go away after selecting it like it is supposed to

#2 Post by hell_oh_world »

humanpencil wrote: Wed Apr 22, 2020 7:54 pm so first off this is my system

Code: Select all

init:
    $ person_extro = 0
    $ person_intro = 0
    $ person_neutr = 0

init:
    $ marsh_rel = 1
    $ kyle_rel = 1
default choice1=1
default choice2=1
default choice3=1
pretty normal right? So I used this system to make certain choices appear only if you have = 1 in one of the person_ values. but then I also made it so in one of the lines that you do that, that line of code is repeated until you have chosen all the available choices:

Code: Select all

menu what_do:
            "What should you do now?"
            "Unpack your stuff" if choice1==1:
                $ choice1=0
                jump unpack
            "Clean up the somewhat dusty room." if choice2==1:
                $ choice2=0
                jump clean
            "Go socialise!" if person_extro == 1
                $ choice3=0
                jump talk_to_people
            "Play videogames" if person_intro == 1:
                $ choice3=0
                jump play_games
            "Go to the cafeteria" if person_neutr == 1:
                $ choice3=0
                jump go_cafe

        jump go_on
After the "go socialize" choice, there is another menu thingy:

Code: Select all

mar "What the hell.. I'm so sorry! I should really start being
        more careful!"
        menu:
            "It's okay! I'm fine really!":
                $ marsh_rel += 1
                jump fine
            "You bet you should!":
                $ marsh_rel -= 1
                jump hoes_mad
after that both have a different label:

Code: Select all

label lunch_sad:
     "blah blah text"
     jump what_do
and

Code: Select all

label lunch_happy:
       "blah blah text"
       jump what_do
but since like I said I have the "default system" that makes a choice disappear after you pick it, so that's what should happen right? Well for some reason when it goes back to the choices (what_do), the option "go socialise" is still there.. Can someone fix this?
I guess youre making it harder for yourself. And from the looks of your code, youre not entirely familiar well with renpy's workarounds. I suggest reading first the docs or the quickstart guide.

https://www.renpy.org/doc/html/quickstart.html

The easiest way to remove a choice once its chosen would be this.

Code: Select all

default menu_set = []
default affection = 0
label start:
    menu question:
    
        set menu_set
        
        "Choice 1":
            $ affection += 1
        "Choice 2":
            pass
    jump question
https://www.renpy.org/doc/html/menus.html#menu-set

Also, always default your variables. Don't initialize or declare your variable with `$`. Always use default for changeable variables and define for fixed variables or constants.

rames44
Veteran
Posts: 233
Joined: Sun May 29, 2016 4:38 pm
Contact:

Re: Choice won't go away after selecting it like it is supposed to

#3 Post by rames44 »

A minor issue with your code. You have

Code: Select all

default menu_set = []
which initializes menu_set to a list, not a set. May still work, because of the fact that many set operations are also supported on lists, but technically it should be

Code: Select all

default menu_set = set()

humanpencil
Newbie
Posts: 13
Joined: Mon Jun 03, 2019 3:42 am
Contact:

Re: Choice won't go away after selecting it like it is supposed to

#4 Post by humanpencil »

Got it! I looked at the Quickstart article and made changes to the code, thanks!!!

Post Reply

Who is online

Users browsing this forum: No registered users