End results due to choice options

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
FeelJovial
Newbie
Posts: 8
Joined: Wed May 22, 2013 2:24 pm
Projects: Phil: the Quota
Location: California, USA
Contact:

End results due to choice options

#1 Post by FeelJovial »

Hello, everyone.

So in my game, the player must make a choice which then will later show several different outcomes. The code for my actual game is extremely long, so here is an example of what I'd like to happen:
The first choice is "home" or "mall". If the player clicks "home" it will take them to another set of choices: "cry" or "laugh". Then they will return to the first choice screen and click "mall" and will see the choices: "broke" or "money". Later, after clicking a series of these type of choices, it will show an end result for having click cry over laugh and another end result for clicking broke over money.
I'm having trouble showing the end results. After clicking cry it doesn't show the result it should show.
I've been staring at this for several hours now and feel completely overwhelmed by it all so I might just be missing something or just entirely lost.

Code: Select all

label start:
    "So, let's try this out."
    $ day1_home = False
    $ day1_mall = False
    menu day1_choices:
        "Home" if day1_home == False:
            $ day1_home = True

            call day1_home
            
            jump day1_choices

        "Mall" if day1_mall == False:
            $ day1_mall = True
            
            call day1_mall
            
            jump day1_choices

    "Alright so now I hope THIS works."
    $ day2_love = False
    $ day2_hate = False
    menu day2_choices:
        "Love" if day2_love == False:
            $ day2_love == False
            if day1_laugh == True:
                call day2_love
            else:
                call day2_hate

        "Hate" if day2_hate == False:
            $ day2_hate = True
            if day1_broke == True:
                call day2_hate
            else:
                call day2_love

    
label day1_home:
    "It's good to be home."
    menu:
        "Cry":
            call day1_tears
        "Laugh":
            call day1_laugh
label day1_tears:
    "Tears of joy."
    return
label day1_laugh:
    "Laughs of happinesss."
    return
label day1_mall:
    "I like shopping."
    menu:
        "Broke":
            call day1_broke
        "Money":
            call day1_money
label day1_broke:
    "Hate life."
    return
label day1_money:
    "Need lots of it."
    return
label day2_love:
    "Glad it worked."
label day2_hate:
    "Finally."
Thank you all in advance.

Unin
Regular
Posts: 54
Joined: Wed Sep 01, 2010 8:08 pm
Location: Florida
Contact:

Re: End results due to choice options

#2 Post by Unin »

this might just be specific to your example, and not your actual code, but day2_love is never given an oppurtunity to be true.

Code: Select all

    "Alright so now I hope THIS works."
    $ day2_love = False
    $ day2_hate = False
    menu day2_choices:
        "Love" if day2_love == False:
            $ day2_love == False
            if day1_laugh == True:
                call day2_love
            else:
                call day2_hate
also day1_laugh is a label, but not an initialized variable, but you ask if its true.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Nozori_Games