Expected Statement Error???

Aug 20, 2018
18
5
expected statement error.PNG
Capture.PNG How do I fix this? when I fix the indentation error on lines: 10,11,12,13,14 there is an expected statement error for the same lines again... (2 images attached)
Please help!
Thank you.
 

Elementario

Member
Game Developer
Nov 11, 2017
252
312
The syntax is wrong,
It should be like this
Code:
define NA = Character("Narrator", color ="#e411bc", who_font = "blahblah", what_font = "blahblah", what_size = 24)
If you have any more syntax doubts refer to the official documentation page,
 
  • Like
Reactions: Papa Ernie

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,426
15,333
The syntax is wrong,
Yes but no. In fact the syntax by itself is correct, it's the indentation that is wrong.
You can split long lines like this one in more than one line. But if you do so, you need to warn Ren'py/Python about it by creating an implicit block :
Code:
define NA = Character("Narrator", 
  color ="#e411bc", 
  who_font = "blahblah", 
  what_font = "blahblah", 
  what_size = 24)
In the code gave by @Nickthegreek , all lines were at the same level of indentation, making them be five separated lines, instead of an implicit block of five lines (one for the header and four for the content).
 
  • Like
Reactions: Porcus Dev

Elementario

Member
Game Developer
Nov 11, 2017
252
312
Yes but no. In fact the syntax by itself is correct, it's the indentation that is wrong.
You can split long lines like this one in more than one line. But if you do so, you need to warn Ren'py/Python about it by creating an implicit block :
Code:
define NA = Character("Narrator",
  color ="#e411bc",
  who_font = "blahblah",
  what_font = "blahblah",
  what_size = 24)
In the code gave by @Nickthegreek , all lines were at the same level of indentation, making them be five separated lines, instead of an implicit block of five lines (one for the header and four for the content).
Oh sorry, my bad :coldsweat:
I always define characters in one line, so never had to use that
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,426
15,333
Oh sorry, my bad :coldsweat:
No need to. It's not an obvious thing and you need to dig in the Python syntax to know this... or discover it in the code wrote by someone else.
It's not always useful, but it can be handy for list/dict when you know that you'll have to change/update the value at some times. Just because it's easier to read like this.
 
  • Like
Reactions: Papa Ernie

Elementario

Member
Game Developer
Nov 11, 2017
252
312
No need to. It's not an obvious thing and you need to dig in the Python syntax to know this... or discover it in the code wrote by someone else.
It's not always useful, but it can be handy for list/dict when you know that you'll have to change/update the value at some times. Just because it's easier to read like this.
Okay, thanks
I will keep that in mind :closedeyesmile:
 
  • Like
Reactions: Papa Ernie