Indentation Errors and more errors; what should I do? Solved

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
ksotaku100
Regular
Posts: 65
Joined: Fri Dec 25, 2009 8:12 pm
Contact:

Indentation Errors and more errors; what should I do? Solved

#1 Post by ksotaku100 »

Code: Select all

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


On line 3 of F:\Documents\P\SDKs\Ren' Py 6.9.3 SDK\renpy-6.9.3\The Drug Addict/game/natsumi1.rpy: say statement does not expect a block. Please check the indentation of the line after this one.
k "I would like to hang out with you, Natsumi."
                                               ^

On line 313 of F:\Documents\P\SDKs\Ren' Py 6.9.3 SDK\renpy-6.9.3\The Drug Addict/game/script.rpy: expected statement.
n and s "Yay!!"
  ^

On line 318 of F:\Documents\P\SDKs\Ren' Py 6.9.3 SDK\renpy-6.9.3\The Drug Addict/game/script.rpy: choice menuitem expects a non-empty block.
"Shizune":
          ^

On line 3 of F:\Documents\P\SDKs\Ren' Py 6.9.3 SDK\renpy-6.9.3\The Drug Addict/game/shizune2.rpy: say statement does not expect a block. Please check the indentation of the line after this one.
k "I need to leave."
                    ^

Ren'Py Version: Ren'Py 6.9.3c/code]
[code]label natsumi1:
    
    k "I would like to hang out with you, Natsumi."
            
             n "Oh, that's great! See ya, Shizune."
            
             show shizune angry with dissolve
            
             s "What?!"
            
             n "Heh... too bad!"/code]
[code]    n and s "Yay!!"
    
    s "Okay, who are you going to hang out with?"
    
    menu:
     "Shizune":
     jump shizune1
      
     "Natsumi":
     jump natsumi1
           /code]
[code]label shizune2:
    
             k "I need to leave."
                 
              n "Going to Shizune, huh?"
                 
              k "Uh... no."
                 
              stop movie
              hide movie
                 
              scene bg altroom with fade
                 
              show kimono angry with dissolve/code]

Can someone check these lines. I keep getting errors. Thank you.
Last edited by ksotaku100 on Sun Jan 03, 2010 7:58 pm, edited 1 time in total.

ksotaku100
Regular
Posts: 65
Joined: Fri Dec 25, 2009 8:12 pm
Contact:

Re: Indentation Errors and more errors; what should I do?

#2 Post by ksotaku100 »

Also I'm separating the storylines into different .rpy files.

A Terrible Rabbit
Regular
Posts: 69
Joined: Sun Dec 13, 2009 6:51 pm
Projects: Kyuuketsuki BonBon
Contact:

Re: Indentation Errors and more errors; what should I do?

#3 Post by A Terrible Rabbit »

Code: Select all

label natsumi1:

k "I would like to hang out with you, Natsumi."

n "Oh, that's great! See ya, Shizune."

show shizune angry with dissolve

s "What?!"

n "Heh... too bad!"
n and s "Yay!!"

s "Okay, who are you going to hang out with?"

menu:
"Shizune":
jump shizune1

"Natsumi":
jump natsumi1
label shizune2:

k "I need to leave."

n "Going to Shizune, huh?"

k "Uh... no."

stop movie
hide movie

scene bg altroom with fade

show kimono angry with dissolve
Sorry, did it look like this? :? I can't totally tell with your formatting.

ksotaku100
Regular
Posts: 65
Joined: Fri Dec 25, 2009 8:12 pm
Contact:

Re: Indentation Errors and more errors; what should I do?

#4 Post by ksotaku100 »

A Terrible Rabbit wrote:

Code: Select all

label natsumi1:

k "I would like to hang out with you, Natsumi."

n "Oh, that's great! See ya, Shizune."

show shizune angry with dissolve

s "What?!"

n "Heh... too bad!"
n and s "Yay!!"

s "Okay, who are you going to hang out with?"

menu:
"Shizune":
jump shizune1

"Natsumi":
jump natsumi1
label shizune2:

k "I need to leave."

n "Going to Shizune, huh?"

k "Uh... no."

stop movie
hide movie

scene bg altroom with fade

show kimono angry with dissolve
Sorry, did it look like this? :? I can't totally tell with your formatting.
Sorry, dude. :( I was a little confused with how you use

Code: Select all

 and [code/]

anyway, I'll attach the.rpy scripts into this message.

Please check and answer. Thank You.
Attachments
errors.txt
The Error Report
(997 Bytes) Downloaded 98 times
shizune2.rpy
Shizune Bad Ending Script
(32.9 KiB) Downloaded 94 times
natsumi1.rpy
Natsumi1 Script
(7.14 KiB) Downloaded 94 times
script.rpy
Main Script
(7.86 KiB) Downloaded 90 times

ksotaku100
Regular
Posts: 65
Joined: Fri Dec 25, 2009 8:12 pm
Contact:

Re: Indentation Errors and more errors; what should I do?

#5 Post by ksotaku100 »

Hopefully, people aren't laughing at my script, It's a school project. I'm a little bad at indentations. If you haven't checked my profile, I'm 14. I've downloaded KS and it was enjoyable.

A Terrible Rabbit
Regular
Posts: 69
Joined: Sun Dec 13, 2009 6:51 pm
Projects: Kyuuketsuki BonBon
Contact:

Re: Indentation Errors and more errors; what should I do?

#6 Post by A Terrible Rabbit »

Ok, here you are.
This should straighten out the line 318 error v
menus should look like this:

Code: Select all

menu:
    "Shizune":
        jump shizune1
    "Natsumi":
        jump natsumi1
Also. . . you seem to have indented everything 4 spaces to the left.
In natsumi1.rpy, the issue is that continued indentation. When you write a line, and have the next line below it indented in four times, it becomes a block. Hence, the 'Renpy does not expect a block on line 3' error. This is the same error on line three of shizune1.rpy Push everything back to the left margin to keep things straight. :)

The error for line 313 is that Renpy understands 'and' to mean something different. You can't use 'and' to have two characters talking simultaneously, you have to define a new character named Natsumi & Shizune to show them talking together.


Hope that helps with it, and good luck!

ksotaku100
Regular
Posts: 65
Joined: Fri Dec 25, 2009 8:12 pm
Contact:

Re: Indentation Errors and more errors; what should I do?

#7 Post by ksotaku100 »

A Terrible Rabbit wrote:Ok, here you are.
This should straighten out the line 318 error v
menus should look like this:

Code: Select all

menu:
    "Shizune":
        jump shizune1
    "Natsumi":
        jump natsumi1
Also. . . you seem to have indented everything 4 spaces to the left.
In natsumi1.rpy, the issue is that continued indentation. When you write a line, and have the next line below it indented in four times, it becomes a block. Hence, the 'Renpy does not expect a block on line 3' error. This is the same error on line three of shizune1.rpy Push everything back to the left margin to keep things straight. :)

The error for line 313 is that Renpy understands 'and' to mean something different. You can't use 'and' to have two characters talking simultaneously, you have to define a new character named Natsumi & Shizune to show them talking together.


Hope that helps with it, and good luck!
Yep. It did. Thanks.

pkt
Veteran
Posts: 322
Joined: Tue Jul 28, 2009 10:09 pm
Completed: I dunno
Projects: Something special
Contact:

Re: Indentation Errors and more errors; what should I do?

#8 Post by pkt »

Since python is what renpy is based on it makes a fuss about indentation on lines a lot.
Too many or too few spaces and you get those problems...
Try selecting a bunch of lines and using Tab or Shift+Tab...

Another one was fixed by using

"Natsumi and Shizune" "Yay!"

instead of

n and s "Yay!"

Keep in mind that the traceback has lot of useful info to help point these things out.
Here's the fixed versions anyhow. Hope you learned a bit.
Attachments
shizune2.rpy
(20.72 KiB) Downloaded 87 times
script.rpy
(7.9 KiB) Downloaded 80 times
natsumi1.rpy
(3.97 KiB) Downloaded 89 times
No Active Public Renpy Projects...

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]