Error

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
Mirenzo
Regular
Posts: 28
Joined: Sat Jan 20, 2018 5:12 pm
Contact:

Error

#1 Post by Mirenzo »

Hi all, i would like to know what's wrong in this code:

Code: Select all

label jp1a:
    if jennyachi1 == "Yes":
        $ jpka = True
        If (jennyquest1check == True and jpka == True):
            jump show_videopeek_jenny
    else:
        jump page13video
i get this error that don't let me start the game:

Code: Select all

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


File "game/book.rpy", line 1175: expected statement.
    If (jennyquest1check == True and jpka == True):
                                                  ^

Ren'Py Version: Ren'Py 6.99.14.1.3218
Thu Mar 08 15:17:05 2018
[/code]
Ok i'm a rookie but please, where's my mistake?
Thank you.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2402
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Error

#2 Post by Ocelot »

if != If . Cgeck your capitalisation. It should be if (jennyquest1check and jpka):
< < insert Rick Cook quote here > >

ReDZiX
Regular
Posts: 32
Joined: Thu Jan 04, 2018 12:42 pm
Contact:

Re: Error

#3 Post by ReDZiX »

Your second if statement:

Code: Select all

If (jennyquest1check == True and jpka == True):
Should be:

Code: Select all

if (jennyquest1check == True and jpka == True): #if has to be lowercase
It's probably just a typo since you had the first one right, but if statement in python and most programming languages must always be lowercase.

Also if you need to check if a variable is True, you don't need to add the '== True' part, so you can do this:

Code: Select all

if (jennyquest1check and jpka): 
And it will work the same.

Mirenzo
Regular
Posts: 28
Joined: Sat Jan 20, 2018 5:12 pm
Contact:

Re: Error

#4 Post by Mirenzo »

OMG, sorry, i'm so stupid....

Mirenzo
Regular
Posts: 28
Joined: Sat Jan 20, 2018 5:12 pm
Contact:

Re: Error

#5 Post by Mirenzo »

Solved

Post Reply

Who is online

Users browsing this forum: No registered users