Easy question about if statement

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
Jogabba
Newbie
Posts: 7
Joined: Thu Dec 07, 2017 8:09 pm
Contact:

Easy question about if statement

#1 Post by Jogabba »

Okay, this one should be simple.

I have a variable called friendship_level_with_john, which kinda explains itself.

At a certain moment in my game, John asks me a question, and I want a certain option to appear ONLY if friendship_level_with_john is higher than 3.
So, the code I've written is this:

Code: Select all

menu: 
    if friendship_level_with_john > 3
    	"You're my best friend":
    		jump best_friends
    "You're fine, I guess":
    	jump normal_friends 
       
Of course, this poor attempt does not work. What would be the proper way to do this?

User avatar
Draziya
Regular
Posts: 70
Joined: Sun Nov 26, 2017 8:50 am
Completed: this was for you. [NaNoRenO 19], Acetylene [AceJam19], Ah!! My Roommate is a Succubus Hellbent on World [MonJam 18], I Don't Have A Clue [QRMJam 18], Cautionary Tale [NaNoRenO 18], OP Dodge Cross [GGJ 18], Acetone [AceJam 18]
Projects: I'm a love interest in my childhood friend's reverse harem!!
Organization: Watercress
itch: Drazillion
Contact:

Re: Easy question about if statement

#2 Post by Draziya »

It should be like this

Code: Select all

    menu:
        "You're my best friend" if friendship_level_with_john > 3:
            jump best_friends
        "You're fine, I guess":
            jump normal_friends
Image


Jogabba
Newbie
Posts: 7
Joined: Thu Dec 07, 2017 8:09 pm
Contact:

Re: Easy question about if statement

#4 Post by Jogabba »

Thank you! You guys are awesome!

Post Reply

Who is online

Users browsing this forum: Kocker, ZianRiyone