How many times can you chnage an if?

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
User avatar
lovebby
Regular
Posts: 106
Joined: Mon Sep 09, 2013 12:24 am
Deviantart: lovebby
Contact:

How many times can you chnage an if?

#1 Post by lovebby »

It seems my "if" statements aren't changing like they should. It goes something like this:

Code: Select all

"Hey Bobio." if saminfo == "name":
                   you"Hey Bobio!"
                   Bob"I see you've met Sam."
                   Bob"Well, it is a lot nicer than some of the other names I had been given when I was a kid."
                   $ bobinfo == "kids"
                   jump bobask
               "Blah." if saminfo == "blah":
                   jump seesam
label seesam:     
    menu sammenu:
                
            "So do you have a nickname for Bob?"
                $ saminfo = "name"
                you"So do you have a nickname for Bob?"
             "What other nicknames did Bob have?" if saminfo == "blah": ### here is the only problem
                you"What other nicknames did Bob have?"
               
It works fine up until it gets to saminfo == "blah", it won't show up, and I can't see why? Everything works perfect if I take away the that if statement but that kind of defeats the purpose?

SundownKid
Lemma-Class Veteran
Posts: 2299
Joined: Mon Feb 06, 2012 9:50 pm
Completed: Icebound, Selenon Rising Ep. 1-2
Projects: Selenon Rising Ep. 3-4
Organization: Fastermind Games
Deviantart: sundownkid
Location: NYC
Contact:

Re: How many times can you chnage an if?

#2 Post by SundownKid »

You can change it infinite times. It should be working, maybe it's just an error in your code. I use a number for that kind of thing though. Also it's missing "jump sammenu' at the end of the first choice in the 2nd label.

User avatar
akemicchi
Veteran
Posts: 465
Joined: Mon Dec 31, 2007 11:22 pm
Projects: Magicians of Delphine, Panaderia: Ensaimada, SweetTooth!, XOXO Droplets
Deviantart: littlebabyshoes
Contact:

Re: How many times can you chnage an if?

#3 Post by akemicchi »

Did you copy the script verbatim? Because you're missing a colon after the first menu item. You should be getting an error that tells you to put a colon there before the game will run.

Code: Select all

label seesam:     
    menu sammenu:
                
            "So do you have a nickname for Bob?":
                $ saminfo = "name"
                you"So do you have a nickname for Bob?"
If there is a colon, there shouldn't be any other reason the second menu item doesn't show up. Unless, of course, saminfo doesn't actually equal "blah"...

Post Reply

Who is online

Users browsing this forum: Google [Bot], Nozori_Games