"if"s inside an "if"s? Please, I need help.

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
ohmykira

"if"s inside an "if"s? Please, I need help.

#1 Post by ohmykira » Tue Dec 30, 2008 1:49 pm

I have a "if" statement that refers to my previous menu options perfectly. However, I want to have another "if" statement inside of this one. Here's the direct sample from my script.

if bothlose == "haku_ake":
m "Haku...Ake..."
a "Rock..."
h "Paper..."
a "Scissors..."
h "Saaaaayyyys..."
b "SHOOOOT!
".....!!!"
if tolose == "haku":
h "What?!"
h "I...lost?"
a "Yes! Freedommmmm!"
t "Good job Ake!"
h "...."
"Just as planned."
m "Aww...POOR Haku."
h "Don't be sarcastic with me!"
m "Who, ME? I'd NEVER be sarcastic!"
a "Heheheh...."
m "Don't worry, we've got a nice outfit picked out for you!"
h "...."
m "Hold on, let me get it from my bag."
"Which outfit should I give him?"


And now the errors:

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.

On line 228 of /Applications/Games etc/renpy-6.8.1/Batsu Game/game/script.rpy: end of line expected.
b "SHOOOOT!\n ".....!!!"\n if tolose == "haku":\n h "What?!"\n h "I...lost?"\n a "Yes! Freedommmmm!"\n t "Good job Ake!"\n h "...."\n "Just as planned."\n m "Aww...POOR Haku."\n h "Don't be sarcastic with me!"\n m "Who, ME? I'd NEVER be sarcastic!"\n a "Heheheh...."\n m "Don't worry, we've got a nice outfit picked out for you!"\n h "...."\n m "Hold on, let me get it from my bag."\n "Which outfit should I give him?"\n\n\nif bothlose == "haku_tsuki":\n m "Haku...Tsuki..."\n t "Rock..."\n h "Paper..."\n t "Scissors..."\n h "Saaaaayyyys..."\n b "SHOOOOT!
^

On line 263 of /Applications/Games etc/renpy-6.8.1/Batsu Game/game/script.rpy: end of line expected.
b "SHOOOOT!\n ".....!!!"\n\n\nif bothlose == "Me_Tsuki":\n m "Me and Tsuki..."\n m "Rock..."\n t "Paper..."\n m "Scissors..."\n t "Saaaaayyyys..."\n b "SHOOOOT!
^

Ren'Py Version: Ren'Py 6.8.1a


I don't believe "if" statements are the correct name for these statements, so please correct me. I would really like and need people's help in order to finish and complete my game.
Is there a way around this situation? Please, I need help.
Thank you for your time, and please respond.

iichan_lolbot
Veteran
Posts: 206
Joined: Tue Dec 30, 2008 9:18 am
Projects: iichan erogame
Contact:

Re: "if"s inside an "if"s? Please, I need help.

#2 Post by iichan_lolbot » Tue Dec 30, 2008 3:00 pm

What OS do you use? Looks like the line break symbols are not read properly.
Maybe you wrote it on Mac/Linux and now trying to run on Win without script changes?

PS Just a guess, I'm not sure...

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: "if"s inside an "if"s? Please, I need help.

#3 Post by PyTom » Tue Dec 30, 2008 3:28 pm

First, please use the code tags to enclose code and tracebacks, so it is formatted correctly. That being said, I think the problem is:

Code: Select all

    b "SHOOOOT!
Which should more properly read:

Code: Select all

    b "SHOOOOT!"
(There could be another, similar error... or Ren'Py could just be confused.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: No registered users