ERROR; Indentation Error

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
TigerAlpaca
Regular
Posts: 38
Joined: Tue Apr 03, 2018 4:19 am
Contact:

ERROR; Indentation Error

#1 Post by TigerAlpaca »

This is the error:

Code: Select all

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


File "game/script.rpy", line 328: indentation mismatch.

Ren'Py Version: Ren'Py 6.99.14.3.3347
Sat Apr 21 13:34:44 2018
And this is the code it occurs in:

Code: Select all

"Push him off":
                
                  jump neutralpath1
                  
                "Do nothing":
                
                  jump falsepath2
                  
             label wrong1:
                
                r "You have to, um... OH! You have to control your temper."
                
                t1 "Partly, but no. You weren't listening, were you? You're lucky you had Ella to help you. After class detention with me, %(player_name)s."
                
                "It was annoying how the teacher knew my name and that Ella had been helping me, but I guessed it was part of the job."
                
                "I shivered slightly in my chair, remembering how her forked tongue had flickered in and out, like a snake's."
                
                "Wait... Hadn't I seen her somewhere before?"
                
                "I didn't pay attention to the rest of the class, there was no point. I just laid my head down on my desk and waited for the bell to go."
                
                "It did and everybody else left the room, including Ella."
                
                show ella sad talk at right
Please help :D

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

Re: ERROR; Indentation Error

#2 Post by kivik »

Each indentation needs to be 4 spaces. Your indentations fluctuate between 2 spaces and 3 spaces - so it's probably what's causing the problem.

Are you using a text editor like Atom? Don't use programs like window's notepad as it has no built in programming features like auto indentation and markers to show indentations for ease.

TigerAlpaca
Regular
Posts: 38
Joined: Tue Apr 03, 2018 4:19 am
Contact:

Re: ERROR; Indentation Error

#3 Post by TigerAlpaca »

kivik wrote: Sat Apr 21, 2018 8:54 am Each indentation needs to be 4 spaces. Your indentations fluctuate between 2 spaces and 3 spaces - so it's probably what's causing the problem.

Are you using a text editor like Atom? Don't use programs like window's notepad as it has no built in programming features like auto indentation and markers to show indentations for ease.
I'm using Editra and thanks, I'll try adding a space so they're all 4 spaces

TigerAlpaca
Regular
Posts: 38
Joined: Tue Apr 03, 2018 4:19 am
Contact:

Re: ERROR; Indentation Error

#4 Post by TigerAlpaca »

I've tried and it's still coming up with the same error message. I even deleted it and re-typed with a different indentation, but it's still saying the same. I don't know if I'm being really thick or what.

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

Re: ERROR; Indentation Error

#5 Post by kivik »

Can you show the code as it is now? Including the lines above 328

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: ERROR; Indentation Error

#6 Post by Donmai »

Correcting indentation means more than simply using four spaces. You should try to understand what a block of code is. For example, a menu is a block of code; a label is another. In your menu block, the options must be at the same indentation level otherwise that will generate an error.

Code: Select all

menu:
    "Push him off":
                
        jump neutralpath1
                  
    "Do nothing":
                
        jump falsepath2
                  
label wrong1:
                
    r "You have to, um... OH! You have to control your temper."
                
    t1 "Partly, but no. You weren't listening, were you? You're lucky you had Ella to help you. After class detention with me, %(player_name)s."
                
    "It was annoying how the teacher knew my name and that Ella had been helping me, but I guessed it was part of the job."
                
    "I shivered slightly in my chair, remembering how her forked tongue had flickered in and out, like a snake's."
                
    "Wait... Hadn't I seen her somewhere before?"
                
    "I didn't pay attention to the rest of the class, there was no point. I just laid my head down on my desk and waited for the bell to go."
                
    "It did and everybody else left the room, including Ella."
                
    show ella sad talk at right
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

TigerAlpaca
Regular
Posts: 38
Joined: Tue Apr 03, 2018 4:19 am
Contact:

Re: ERROR; Indentation Error

#7 Post by TigerAlpaca »

Okay, thanks. I'll try that.

TigerAlpaca
Regular
Posts: 38
Joined: Tue Apr 03, 2018 4:19 am
Contact:

Re: ERROR; Indentation Error

#8 Post by TigerAlpaca »

Thank you all, it really helps ^^ I do have another error now, but I should be able to solve it. Or not.

Post Reply

Who is online

Users browsing this forum: Google [Bot], simple_human