Expected statement error - dialog

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
graceregs
Newbie
Posts: 2
Joined: Tue May 22, 2018 10:31 pm
Contact:

Expected statement error - dialog

#1 Post by graceregs » Tue May 22, 2018 10:43 pm

Hi I am EXTREMELY new... as in, I've been using renpy for like an hour and a half. I've gotten an error in every line of dialog and I don't know why... if someone could help me out I would appreciate it a lot.

I'm going to copy and paste my text then the error text.

mine:

label start:

define c = Character(“Claudia”)

scene bg black

c “It didn’t take me long to pack up my stuff.”
c “I decided to give away most of it to charity and throw out what I couldn’t donate.”
c “I wanted to leave my memories of this place behind too.”

scene bg aptstreet
with Dissolve(.5)

pause .5

c “After everything I went through… I needed a fresh start. I rented out a shabby apartment in the city.”
c “It wasn’t much to look at and it certainly wasn’t the safest neighbourhood in the city, but I was determined to make this place my new home.”

show claudia at left
with Dissolve(.5)

c “Moving in didn’t take long.”

show claudia sad at left

c “I…”
c “I just hope things will be better here.”

and here is the errors:

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


File "game/script.rpy", line 7: expected statement.
c “It didn’t take me long to pack up my stuff.”
^

File "game/script.rpy", line 8: expected statement.
c “I decided to give away most of it to charity and throw out what I couldn’t donate.”
^

File "game/script.rpy", line 9: expected statement.
c “I wanted to leave my memories of this place behind too.”
^

File "game/script.rpy", line 16: expected statement.
c “After everything I went through… I needed a fresh start. I rented out a shabby apartment in the city.”
^

File "game/script.rpy", line 17: expected statement.
c “It wasn’t much to look at and it certainly wasn’t the safest neighbourhood in the city, but I was determined to make this place my new home.”
^

File "game/script.rpy", line 22: expected statement.
c “Moving in didn’t take long.”
^

File "game/script.rpy", line 26: expected statement.
c “I…”
^

File "game/script.rpy", line 27: expected statement.
c “I just hope things will be better here.”
^

User avatar
SpicyMayo1429
Newbie
Posts: 8
Joined: Tue Mar 20, 2018 11:23 am
Contact:

Re: Expected statement error - dialog

#2 Post by SpicyMayo1429 » Tue May 22, 2018 11:13 pm

your issue is that when you defined your character, within the brackets you only need ' but you have ". It should look like this.

Code: Select all

define c = Character ('Claudia')

graceregs
Newbie
Posts: 2
Joined: Tue May 22, 2018 10:31 pm
Contact:

Re: Expected statement error - dialog

#3 Post by graceregs » Tue May 22, 2018 11:50 pm

SpicyMayo1429 wrote:
Tue May 22, 2018 11:13 pm
your issue is that when you defined your character, within the brackets you only need ' but you have ". It should look like this.

Code: Select all

define c = Character ('Claudia')
hi, I tried that but it didn't fix the error. thanks for letting me know i defined the character wrong

kivik
Miko-Class Veteran
Posts: 783
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Expected statement error - dialog

#4 Post by kivik » Wed May 23, 2018 5:43 am

Are you writing your code in MS Word or Wordpad something? Your straight quotes (" and ') have all been converted to smart quotes (“” ’), which isn't understood by python / renpy as string declarators.

Try using Atom - which comes with Renpy free - as your text editor, or any other "programmers" text editors that won't auto-format your quotes into smart quotes.

kivik
Miko-Class Veteran
Posts: 783
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Expected statement error - dialog

#5 Post by kivik » Wed May 23, 2018 5:49 am

SpicyMayo1429 wrote:
Tue May 22, 2018 11:13 pm
your issue is that when you defined your character, within the brackets you only need ' but you have ". It should look like this.

Code: Select all

define c = Character ('Claudia')
This is actually incorrect - both double and single quotes work for python and renpy - the language is agnostic about which quotes are used for string declarations. However you can use double quotes more easily within single quotes, and vice versa without having to escape them:

Code: Select all

'"This is in a pair of double quotes"'
"'This is in a pair of single quotes'"
"\"This is in a pair of escaped double quotes because I used double quotes for the string\""
'\'This is in a pair of escaped single quotes because I used single quotes for the string\''
In some languages (php for example) you can mix variables directly into double quotes but not single quotes - but python uses {} brackets to directly mix in variables, so again, doesn't care if it's single or double quotes - far as I understand it.

Post Reply

Who is online

Users browsing this forum: No registered users