Page 1 of 1

Trouble with Coding

Posted: Sat Dec 31, 2011 1:19 am
by ShuraORandom
I am having all kinds of trouble with my script, I dunno if it's bugs with Ren'Py or if I've done something wrong with my script.

What the problem is, is that every time I launch my game it detects errors with indentation.

exp.

File "game/script.rpy", line 47: Line is indented, but the preceding say statement statement does not expect a block. Please check this line's indentation.

But however it hasn't had a problem with this before... Has anyone else had this problem? If you have did you ever solve it? I'd like to know.

-Shura-

Re: Trouble with Coding

Posted: Sat Dec 31, 2011 1:43 am
by Camille
If you show us the code that the error is referring to, we might be able to help you better. D: Like, just show us a couple of lines using the

Code: Select all

 tags.

Re: Trouble with Coding

Posted: Sat Dec 31, 2011 3:25 am
by ShuraORandom
Here's some of my coding

scene black with dissolve
show text "SOR Productions presents..." with Pause(1.5)
show text "Bronagh Cafe" with Pause(1.5)

scene bgcity
with dissolve
m "Honey, how was your trip?"

Okay one of my repeating problems is with the line "Honey how was your trip?" It keeps saying the error that I posted above. It's been having the same problem sense I've started working on my project. It's getting seriously annoying trying to fix it. I've had to edit over my script which is now over four hundred lines long now.

I'm not sure if this is what you wanted, I'll admit I know very little about coding. I did go to a tech class for a semester.... But my teacher sucked and I learned almost nothing.

Re: Trouble with Coding

Posted: Sat Dec 31, 2011 4:24 am
by redeyesblackpanda
It keeps reading until it hits a problem. Once it hits a problem, it'll stop and tell you. The thing is, it seems you have a lot of problems, so when you correct one, the next one pops up. Just keep correcting until it stops telling you that you have errors. If it says there's an error with indentation at that line, there probably is. Is that how your code looks with indentations?

When I write, I check for errors often so that I don't have to get all messed up. I'm not sure saying this at this point helps though. :lol:

Re: Trouble with Coding

Posted: Sat Dec 31, 2011 4:48 am
by ShuraORandom
redeyesblackpanda wrote:It keeps reading until it hits a problem. Once it hits a problem, it'll stop and tell you. The thing is, it seems you have a lot of problems, so when you correct one, the next one pops up. Just keep correcting until it stops telling you that you have errors. If it says there's an error with indentation at that line, there probably is. Is that how your code looks with indentations?

When I write, I check for errors often so that I don't have to get all messed up. I'm not sure saying this at this point helps though. :lol:
Well, technically that's just the first few lines. All of my coding is indented and pretty clean.

So yeah that's what it looks like but it's not the whole thing. The thing I posted up is from what I seen, the most hated line in the whole script I wrote.

It only started with this problem when I decided that I was almost finished coding the teaser. But before that all the errors it hit were reasonable, like typos or forgotten parts to the coding. I seriously don't know what the problem is

Re: Trouble with Coding

Posted: Sat Dec 31, 2011 4:54 am
by redeyesblackpanda
Oh, the "with dissolve" could be the problem. Shouldn't it be on the same line as "scene bgcity"?
I'm saying this because of this: http://renpy.org/wiki/Fade

Code: Select all

Oh, yeah and you might want to use code tags...
They look like this without the periods... [code.]CODE_HERE[/code.]

Re: Trouble with Coding

Posted: Sat Dec 31, 2011 4:57 am
by ShuraORandom
I just tried that, and it doesn't seem to be the problem... I came up with a whole mess of the same indent errors on different lines.

Re: Trouble with Coding

Posted: Sat Dec 31, 2011 4:58 am
by ShuraORandom
I do also have code tags in my script, but I didn't post them up.

Re: Trouble with Coding

Posted: Sat Dec 31, 2011 5:05 am
by redeyesblackpanda
ShuraORandom wrote:I do also have code tags in my script, but I didn't post them up.
I'm talking about on the forum. I'm not sure putting that in your script is a good idea :shock: .

If the indent errors were further down, as in line 48 onward, then it fixed it! :D There can be multiple causes for an indent error, so the problem might be something else further down. Sounds to me that you just have a lot of bugs, so you've gotta keep squishing. :lol:

If this wasn't of help, I'm sorry, but I'm somewhat new myself... :oops:

Re: Trouble with Coding

Posted: Sat Dec 31, 2011 5:09 am
by ShuraORandom
Ugh that's not what I meant.

I thought you meant where the coding tells you to put it like.
##game starts here

I'm sorry it's pretty late where I am and my mind doesn't really work well this time of day.

It didn't really help. But it's alright, at least you attempted to help.

Re: Trouble with Coding

Posted: Sat Dec 31, 2011 5:12 am
by redeyesblackpanda
Oh, if you do ##, it does nothing. Its not read, it's just notes. I hope you get the help you need, there are really experienced people here! :D (not me though...)

Re: Trouble with Coding

Posted: Sat Dec 31, 2011 5:16 am
by ShuraORandom
Yeah, I know that ## is just a comment. I've had some experience with coding (not much though) I used to be one heck of a php coder. But that was almost a year ago and well I found php coding boring so I haven't done it sense.

But thanks for trying to help! As they say 'it's the thought that counts'.

Sadly it's not the thought that fixes the coding though....

Re: Trouble with Coding

Posted: Sat Dec 31, 2011 9:59 am
by Alex
I suppose, that <m "Honey, how was your trip?"> is line 46, then check line 47 - it definitely indented too much (a single space can cause the trouble). Also, don't forget to save changes in your script, and don't use old saves - start game from the very beginning.

Re: Trouble with Coding

Posted: Sun Jan 01, 2012 6:44 pm
by SinusPi
@ShuraORandom, always put your code in

Code: Select all

 ... 
tags when posting on the forum. Otherwise your indentation will not show, and since it's the main problem, it should definitely be preserved. So, either use the code tags, or use another code pasting service, like pastebin.com .

And don't be shy with your files - you might think the problem is in the code you paste, while actually the problem might lurk elsewhere. Go ahead and post a screenful of code - better post more than less.