Why do all the options appear, when stated not 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
TheMCButterfly
Newbie
Posts: 17
Joined: Sat Mar 30, 2019 12:16 pm
Projects: Friends Forever - Talk to a character
IRC Nick: Butterfly
Contact:

Why do all the options appear, when stated not to?

#1 Post by TheMCButterfly » Sun Mar 31, 2019 3:54 am

SOLVED

Hello, my name is Butterfly! So I recently posted a question, but I'm probably going to be asking a lot more. Thanks for your precious time!

So my question is... Well, here's my code:

Code: Select all


label start:

    scene tablenormal

    $ left = False

    $ bond = 0

    "If you already have data, load it up. Now is the time to do so."

    menu:

     "\"I'm back, Nozomi!\"" if left:
         n "placeholder"

         n "placeholder"

         jump menus

     "\"Hello!\"" if not left:
        define name = Character("[player]")

        python:
            player = renpy.input("What is your name?")
            player = player.strip()

        n "Hello, [player]!"

        n "My name is Nozomi!"

        n "Maybe you already..."

        n "Knew that."

        $ bond = 0

        jump menus

label menus:

    menu:
        "What do you want to do?"

        "Talk" if bond == 0 or 1 or 2 or 3 or 4:
            $ bondtalk1 = renpy.random.random(1, 4)

            if bondtalk1 = 1 then:
                jump bondtalk1_1

        "Ask me" if bond == 0 or 1 or 2 or 3 or 4:
            $ bondask1 = renpy.random.random(1, 4)

            if bondask1 = 1 then
                jump bondask1_1

        "Talk" if bond == 5 or 6 or 7:
            "..."

        "Ask me" if bond == 5 or 6 or 7:
            "..."

        "Goodbye":
            call goodbye

        "Change music" if bond == 7:
            "placeholder"
            
 
When I load the game, and go to the part where the menus appear, all the buttons are avaliable, why is this?
I set it so when you start the game, your bond will be set to 0. Why does this happen, and could someone please help?

I will most likely post more of these, so thanks for all your time. I know most people are busy, so I'm very greatful (That sounded very cheesy).
Last edited by TheMCButterfly on Sun Mar 31, 2019 4:14 am, edited 1 time in total.

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Why do all the options appear, when stated not to?

#2 Post by Alex » Sun Mar 31, 2019 4:06 am

Code: Select all

if bond == 0 or 1
This condition will be true if either (bond == 0) is true or (1) is true. The "1" is ok, so the whole condition is true.
Try either

Code: Select all

if bond == 0 or bond == 1 or bond == 2
or

Code: Select all

if bond in (0, 1, 2, 3)

TheMCButterfly
Newbie
Posts: 17
Joined: Sat Mar 30, 2019 12:16 pm
Projects: Friends Forever - Talk to a character
IRC Nick: Butterfly
Contact:

Re: Why do all the options appear, when stated not to?

#3 Post by TheMCButterfly » Sun Mar 31, 2019 4:19 am

Alex wrote:
Sun Mar 31, 2019 4:06 am

Code: Select all

if bond == 0 or 1
This condition will be true if either (bond == 0) is true or (1) is true. The "1" is ok, so the whole condition is true.
Try either

Code: Select all

if bond == 0 or bond == 1 or bond == 2
or

Code: Select all

if bond in (0, 1, 2, 3)
Thank you! This worked.

Post Reply

Who is online

Users browsing this forum: Google [Bot]