Indentation Error And Points System

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
User avatar
kalechips
Newbie
Posts: 7
Joined: Thu Nov 01, 2018 10:09 pm
Completed: Midnight on the Milky Way, Melting of the Winter Gears, and a bunch more :))
Projects: something with a ghost innit
Organization: Masked Circle
itch: kalechips
Location: Moonside
Contact:

Indentation Error And Points System

#1 Post by kalechips »

Hi everyone! I'm kalechips (I mean it says right on my username so I guess uh) and I am quite new to some of this stuff, so the solution might actually be really easy. I'm just having some indentation trouble.
I'm using this following tutorial to keep track of points for my game: viewtopic.php?t=22817
It seemed everything was fine but I was met with this error saying there was an indentation error with my code. I checked it out.

Code: Select all

# The game starts here.

label start:
    
    # Tea is important
    
$tea = 0
$mint = 0
$berry = 0
$beef = 0

    # Show a background. This uses a placeholder by default, but you can
    # add a file (named either "bg room.png" or "bg room.jpg") to the
    # images directory to show it.

    scene bg room
Apparenty the scene bg room line is not indented properly. When I indent it which way what, the indentation error just goes to the next line. It seems that the tea values are the thing causing this as the error was not present before.
If anybody knows how to fix this, I would love to hear! I'm sure it's actually quite simple.
Other than that, I am not detecting any errors.
Thank you very much!
Image A ghostly game dev who forgot how to sleep.Image

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: Indentation Error And Points System

#2 Post by IrinaLazareva »

Code: Select all

# The game starts here.

label start:
    
    # Tea is important but Indentation is more important
    
    $tea = 0
    $mint = 0
    $berry = 0
    $beef = 0

    # Show a background. This uses a placeholder by default, but you can
    # add a file (named either "bg room.png" or "bg room.jpg") to the
    # images directory to show it.

    scene bg room
https://www.renpy.org/doc/html/language ... and-blocks

or...

Code: Select all

default tea = 0
default mint = 0
default berry = 0
default beef = 0

# The game starts here.
label start:
    
    # Tea is not important
    # Show a background. This uses a placeholder by default, but you can
    # add a file (named either "bg room.png" or "bg room.jpg") to the
    # images directory to show it.

    scene bg room
https://www.renpy.org/doc/html/python.h ... -statement

User avatar
kalechips
Newbie
Posts: 7
Joined: Thu Nov 01, 2018 10:09 pm
Completed: Midnight on the Milky Way, Melting of the Winter Gears, and a bunch more :))
Projects: something with a ghost innit
Organization: Masked Circle
itch: kalechips
Location: Moonside
Contact:

Re: Indentation Error And Points System

#3 Post by kalechips »

Thank you so much! This worked well. :)
Image A ghostly game dev who forgot how to sleep.Image

Post Reply

Who is online

Users browsing this forum: No registered users