A Question ^^:

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
rune
Newbie
Posts: 3
Joined: Wed Apr 06, 2005 2:44 am
Contact:

A Question ^^:

#1 Post by rune »

Okay im like super new for even noobs and i keep getting these two error messages (i have like one script i wrote that works but when i try to add more text or put in a change scene command it gives me these messages...)


One:
telling me that its not terminated in a new line. what can i do?>_<

Two:
UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 677: unexpected code byte

While parsing game/script.rpy.


Yea i dont even know what that means @_@

Ahhh. Every time i see them i just wanna cry =_=
So help anyones! ^^;; Would be much appriciated.

chronoluminaire
Eileen-Class Veteran
Posts: 1153
Joined: Mon Jul 07, 2003 4:57 pm
Completed: Elven Relations, Cloud Fairy, When I Rule The World
Tumblr: alextfish
Skype: alextfish
Location: Cambridge, UK
Contact:

#2 Post by chronoluminaire »

Urggh. That "is not terminated by a newline" was the single most frustrating error I saw writing my NaNoRenO game. Here are some of the things I found that caused it:

#1: A string somewhere has a missing or extra quote. There could be two reasons for this:
* You're trying to use a double-quote somewhere inside your text. You can't do this. Go to the places in question and replace them with one or two single quotes:

Code: Select all

Selena "Oh, so you're calling me a "loony" now, are you?!"   # WRONG!
Selena "Oh, so you're calling me a ''loony'' now, are you?!" # Right
* You've accidentally failed to open or close a string somewhere with double quotes.
Unfortunately, Ren'Py doesn't know where that line is, because it now thinks that the next open quote is a close quote, and so on. On the many occasions this happened to me (it's very easy to do), I found the line in question by running a grep command to show me all lines of the file which don't have exactly two quote marks on. But if you don't use grep, another way to do it is to cut half of the script out and paste it into a different .rpy file, then try running the game again, and see which file the problem is in. Keep narrowing it down until you can see the offending line.

This accounts for the large majority of the times I see this frustrating error. But sometimes I found instead it was:

#2: Some python command or block needs closing with a close parenthesis or something similar, which I forgot to do.
#3: Sometimes the file genuinely isn't terminated with a newline. The answer here is to make sure that the final character of the file is a newline (Return or Enter).
#4: Sometimes it was something else...

Hope this helps! Do post back and tell us how you get on.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#3 Post by PyTom »

I've gone in and modified Ren'Py so it now tells you where the _start_ of a run-on line is, rather than the end... so hopefully, that'll make things easier to debug.

Going back to Rune's second error, it looks like he or she is using some sort of word processor to edit Ren'Py scripts, and it's putting in a styled quote mark rather than the straight quote that Ren'Py accepts. This is confusing Ren'Py, and it's bailing out. I recommend using SciTE for Ren'Py or some other text editor to edit Ren'Py scripts.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

PixelWrangler
Regular
Posts: 103
Joined: Wed Mar 16, 2005 11:00 pm
Location: Swimming in the sea of electronic dots
Contact:

Re: A Question ^^:

#4 Post by PixelWrangler »

rune wrote:Two:
UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 677: unexpected code byte
One of the first things I learned was to not Copy/Paste scripts from MS-Word, as it inserts UTF-8 (special character) quotes, just like PyTom said.

However, if you're already getting the UTF-8 error, there is a trick you can use to "clean up" the code. Nothing fancy... just a simple "Find and Replace" command.

Select, in Word (or the text editor you're cutting from) the "open quote" symbol. Then, using SciTE or a straight text editor like Notepad, run a Replace, paste the character into the "Replace" field, and enter a straight ' or " quote characer in the "Replace With" field. Select "Replace All" or the like. Repeat for end quotation marks, commas, etc.

Be warned you still may have to pick through your script at some point to find that pesky character that's tripping things up, but this will at least give you a good head start.

Hope this helps.

P.W.
Life is hard.
Except in ren'ai games.
Then it's a whole lot softer.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Sugar_and_rice