Problem with if statements

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
lykoia
Newbie
Posts: 22
Joined: Tue Apr 14, 2020 11:15 am
Contact:

Problem with if statements

#1 Post by lykoia »

Hello, newbie here.

I tried to add this thing to the game that if the player is in a certain club they will go to that club room:

Code: Select all

    if club == "drama":
        jump mondaydrama
    elif club == "art":
        jump mondayart
    elif club == "music":
        jump mondaymusic
The player chooses the club earlier in the game:

Code: Select all

"Drama club":
        $ club = "Drama" 
        jump fridayclass01
"Art club":
        $ club = "Art"
        jump fridayclass01
"Music club":
        $ club = "Music"
        hide club-board 
        jump fridayclass01
I'm not sure what I did wrong but the code just doesn't work and even when the player chose the music club they will go to the drama club room.
From what I know, the choosing clubs code works [when I make a character say [club] they say the name of the current club] but not the second one.
Is there some way I could fix this?

Thank you

User avatar
Milkymalk
Miko-Class Veteran
Posts: 753
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: Problem with if statements

#2 Post by Milkymalk »

Capitalization matters. "Drama" is not == "drama"
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

lykoia
Newbie
Posts: 22
Joined: Tue Apr 14, 2020 11:15 am
Contact:

Re: Problem with if statements

#3 Post by lykoia »

Milkymalk wrote: Thu May 07, 2020 11:10 am Capitalization matters. "Drama" is not == "drama"
Oh, I didn't notice!
Thank you for your help, I appreciate it a lot

Post Reply

Who is online

Users browsing this forum: No registered users