Ren'Py About remembering choices

Deleted member 1610159

Newbie
Game Developer
Aug 26, 2019
55
34
So what i am trying top do is i want renpy to remember a menu choice made earlier in the game. And when i come to a certain point later in the game, i want to add additional lines/sentences in the script, only if i had earlier chosen a particular choice.(that triggered the new line, )

(only an example)
menu:
"go party":
jump partyido
"go sleep":
sleepineed

later in the game i meet a girl which can only be unlocked if i went to the party.
so.

yes bro that girl is fine.
you really should have come to the party that night (to only appear if i did not go to the party)
you remember the girl we met at the party (to only appear if i did go to the party)
 

Alcahest

Engaged Member
Donor
Game Developer
Jul 28, 2017
3,291
4,162
Read up on variables/flags and the if statement for ren'py. This is basic stuff.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,369
15,286
So what i am trying top do is i want renpy to remember a menu choice made earlier in the game.
As GRasputin said, this is really the basis. So basic that it even have in the quick start of the documentation.

Python:
default dayXGoesToParty = None

label whatever:

    menu:
       "go party":
            $ dayXGoesToParty = True
            jump partyido
       "go sleep":
            $ dayXGoesToParty = False
            jump sleepineed


label whateverElse:
    # The party don't happened yet
    if dayXGoesToParty == None:
        [Alternate code block]
    # MC goes to the party
    elif dayXGoesToParty == True:
        whatever "you remember the girl we met at the party"
    # The party happened, but MC decided to sleep instead
    else dayXGoesToParty:
        whatever "you really should have come to the party that night"

Oh, and by the way, the forum have a whole section dedicated to this kind of question.
 

woody554

Well-Known Member
Jan 20, 2018
1,428
1,787
you can have menu choices that are only visible when an if-statement is true. as in:


Python:
menu:
    "go party":
        $ var_went_to_party = True  #  variable keeping track whether you went to party or not.
    "go sleep":
        $ var_went_to_party = False


then the following will do what you wanted.

menu:
    "yes bro that girl is fine." :
        jump yourscene1
    "you really should have come to the party that night" if var_went_to_party == False :
        jump yourscene2
    "you remember the girl we met at the party" if var_went_to_party == True :
        jump yourscene3
 

Deleted member 1610159

Newbie
Game Developer
Aug 26, 2019
55
34
you can have menu choices that are only visible when an if-statement is true. as in:


Python:
menu:
    "go party":
        $ var_went_to_party = True  #  variable keeping track whether you went to party or not.
    "go sleep":
        $ var_went_to_party = False


then the following will do what you wanted.

menu:
    "yes bro that girl is fine." :
        jump yourscene1
    "you really should have come to the party that night" if var_went_to_party == False :
        jump yourscene2
    "you remember the girl we met at the party" if var_went_to_party == True :
        jump yourscene3
Thank you very dude. It really helped me. Thanks for the help.:D:D