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.
-
Poli
- Newbie
- Posts: 11
- Joined: Thu Aug 04, 2016 11:09 pm
- Projects: Raburī ken Coding: 5%(?) Images 3% Writing 20% Characters 20% Music 3%
-
Contact:
#1
Post
by Poli » Fri Aug 05, 2016 7:27 pm
(I ask too many questions, sorry...)
I've tried to fix these indentation errors by doing almost EVERYTHING I know.
Code: Select all
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.
File "game/script.rpy", line 43: expected statement.
bg room1 with fade
^
File "game/script.rpy", line 45: Line is indented, but the preceding play music statement statement does not expect a block. Please check this line's indentation.
e "..."
^
Ren'Py Version: Ren'Py 6.99.10.1227
here is my code.
Code: Select all
label story:
bg room1 with fade
play music "cricket.mp3" fadeout 2.0 fadein 7.0
e "..."
e "There's not much to do, so I'll just sleep."
-
Iylae
- Regular
- Posts: 73
- Joined: Sat Jan 09, 2016 6:57 am
- Location: Cornwall, UK
-
Contact:
#2
Post
by Iylae » Fri Aug 05, 2016 8:10 pm
Code: Select all
File "game/script.rpy", line 43: expected statement.
bg room1 with fade
^
You're missing the key word "show" on the second line.
Code: Select all
label story:
show bg room1 with fade
play music "cricket.mp3" fadeout 2.0 fadein 7.0
e "..."
e "There's not much to do, so I'll just sleep."
-----------------------------------------------------------------------------------------
Code: Select all
File "game/script.rpy", line 45: Line is indented, but the preceding play music statement statement does not expect a block. Please check this line's indentation.
e "..."
^
Another indentation error. It seems you aren't listening to the advice you've been given multiple times in other threads. If there is no : at the end of the line it does not require indentation.
Code: Select all
label story:
bg room1 with fade
play music "cricket.mp3" fadeout 2.0 fadein 7.0
e "..."
e "There's not much to do, so I'll just sleep."
If we are what we repeatedly do, then good coding is not an act, but a habit
-
deltë
- Newbie
- Posts: 14
- Joined: Mon Aug 08, 2016 10:43 am
- Location: United Kingdom
-
Contact:
#3
Post
by deltë » Mon Aug 08, 2016 12:07 pm
Correct code for second error:
Code: Select all
label story:
bg room1 with fade
play music "cricket.mp3" fadeout 2.0 fadein 7.0
e "..."
e "There's not much to do, so I'll just sleep."
If there is no colon at the end of a statement, you do not need to indent any lines after that. If you have a colon at the end of a statement, such as 'menu:' or whatnot, then you will need to indent the lines after that.
Users browsing this forum: Bing [Bot], Google [Bot]