Page 1 of 1

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

Posted: Wed Apr 22, 2020 7:54 pm
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?

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

Posted: Wed Apr 22, 2020 8:54 pm
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.

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

Posted: Thu Apr 23, 2020 12:30 pm
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()

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

Posted: Thu Apr 23, 2020 1:15 pm
by humanpencil
Got it! I looked at the Quickstart article and made changes to the code, thanks!!!