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.
-
Mooneon
- Regular
- Posts: 78
- Joined: Sat Jul 04, 2015 4:05 pm
-
Contact:
#1
Post
by Mooneon » Tue Apr 05, 2016 6:07 pm
So this code is in the screen.rpy and I'm currently working on the preferences.
Code: Select all
grid 3 1:
style_group "prefs"
xfill True
# The left column.
vbox:
frame:
style_group "pref"
has vbox
label _("Display")
textbutton _("Window") action Preference("display", "window")
textbutton _("Fullscreen") action Preference("display", "fullscreen")
frame:
style_group "pref"
has vbox
label _("Transitions")
textbutton _("All") action Preference("transitions", "all")
textbutton _("None") action Preference("transitions", "none")
And suddenly. There's an error here. It's mostly all about the grid 3 1: Now it's asking about the expected statement.
How do I fix this?
Code: Select all
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.
File "game/screens.rpy", line 468: expected statement.
grid 3 1:
^
Ren'Py Version: Ren'Py 6.99.10.1227
-
mobychan
- Veteran
- Posts: 275
- Joined: Fri Apr 24, 2015 6:31 am
- Projects: The Chosen - Sakura Pink & Gentian Blue
- Organization: Foresoft
- Location: Germany
-
Contact:
#2
Post
by mobychan » Wed Apr 06, 2016 1:53 am
your indentation at "style_group "prefs"" is wrong, that's why it can't find the following block
-
Mooneon
- Regular
- Posts: 78
- Joined: Sat Jul 04, 2015 4:05 pm
-
Contact:
#3
Post
by Mooneon » Thu Apr 07, 2016 9:55 pm
I've changed the indentation in different ways and yet it is still telling me about an expected statement.
Code: Select all
# Put the navigation columns in a three-wide grid.
grid 3 1:
style_group "prefs"
xfill True
Moving the grid 3 1: doesn't work either because of indentation
Moving the style_group "prefs" doesn't work either. Everything I change in the script it just keeps asking for syntax, indentation or an expected statement. It's the grid 3 1: !! There's a problem with this word!
Code: Select all
# Put the navigation columns in a three-wide grid.
grid 3 1:
style_group "prefs"
xfill True
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/screens.rpy", line 464: expected statement.
grid 3 1:
^
Ren'Py Version: Ren'Py 6.99.10.1227
[/code]
P:S I am still new to Renpy. So i don't really understand some things. So please help! I would really love that.
-
Onishion
- Veteran
- Posts: 295
- Joined: Mon Apr 20, 2015 10:36 am
-
Contact:
#4
Post
by Onishion » Thu Apr 07, 2016 11:15 pm
I think you'd want it like this:
Code: Select all
grid 3 1:
style_group "prefs"
xfill True
# The left column.
vbox:
frame:
style_group "pref"
has vbox
label _("Display")
textbutton _("Window") action Preference("display", "window")
textbutton _("Fullscreen") action Preference("display", "fullscreen")
frame:
style_group "pref"
has vbox
label _("Transitions")
textbutton _("All") action Preference("transitions", "all")
textbutton _("None") action Preference("transitions", "none")
You basically don't want to indent anything unless the preceding line has a ":" at the end of it, which defines what follows as a "block". All "blocks" need to be at the same indentation level. I'm not positive that would work, I'm a bit hazy on screen language myself, but the intendentation should be right. If that still doesn't fix it, then maybe a previous segment was improperly indented as well and it didn't catch on until the part that you linked there.
Niow if you DID intend the original version right for what you wanted, then you would need to add in ":"s to the end of the preceding lines.
-
Mooneon
- Regular
- Posts: 78
- Joined: Sat Jul 04, 2015 4:05 pm
-
Contact:
#5
Post
by Mooneon » Thu Apr 07, 2016 11:22 pm
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/screens.rpy", line 465: expected statement.
grid 3 1:
^
Ren'Py Version: Ren'Py 6.99.10.1227
[/code]
I pasted it on my screens.rpy. And yet it is still talking about the expected statement.

-
mobychan
- Veteran
- Posts: 275
- Joined: Fri Apr 24, 2015 6:31 am
- Projects: The Chosen - Sakura Pink & Gentian Blue
- Organization: Foresoft
- Location: Germany
-
Contact:
#6
Post
by mobychan » Fri Apr 08, 2016 2:11 am
@Onishion: There was still one space too much in front of "style_group "prefs"" and "xfill True"
Code: Select all
grid 3 1:
style_group "prefs"
xfill True
# The left column.
vbox:
frame:
style_group "pref"
has vbox
label _("Display")
textbutton _("Window") action Preference("display", "window")
textbutton _("Fullscreen") action Preference("display", "fullscreen")
frame:
style_group "pref"
has vbox
label _("Transitions")
textbutton _("All") action Preference("transitions", "all")
textbutton _("None") action Preference("transitions", "none")
I didn't test this, but indentation on this part is correct.
since you use it in a screen there has to be at least one more set of 4 spaces for indent, more if there's more blocks than just "screen name():"
Code: Select all
screen name():
grid 3 1:
style_group "prefs"
xfill True
# The left column.
vbox:
frame:
style_group "pref"
has vbox
label _("Display")
textbutton _("Window") action Preference("display", "window")
textbutton _("Fullscreen") action Preference("display", "fullscreen")
frame:
style_group "pref"
has vbox
label _("Transitions")
textbutton _("All") action Preference("transitions", "all")
textbutton _("None") action Preference("transitions", "none")