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.
-
Mirenzo
- Regular
- Posts: 28
- Joined: Sat Jan 20, 2018 5:12 pm
-
Contact:
#1
Post
by Mirenzo » Thu Mar 08, 2018 3:41 pm
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.
-
Ocelot
- Eileen-Class Veteran
- Posts: 1882
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
-
Contact:
#2
Post
by Ocelot » Thu Mar 08, 2018 3:58 pm
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:
#3
Post
by ReDZiX » Thu Mar 08, 2018 4:05 pm
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:
And it will work the same.
-
Mirenzo
- Regular
- Posts: 28
- Joined: Sat Jan 20, 2018 5:12 pm
-
Contact:
#4
Post
by Mirenzo » Thu Mar 08, 2018 7:55 pm
OMG, sorry, i'm so stupid....
-
Mirenzo
- Regular
- Posts: 28
- Joined: Sat Jan 20, 2018 5:12 pm
-
Contact:
#5
Post
by Mirenzo » Sat Mar 24, 2018 4:03 am
Solved
Users browsing this forum: No registered users