need help with code

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
Tiger Tech
Newbie
Posts: 3
Joined: Thu Mar 05, 2015 1:59 pm
Contact:

need help with code

#1 Post by Tiger Tech » Thu Mar 05, 2015 2:05 pm

It is giving me a pop up about indentation. I am new and stuck Thanks! :D

Where are my indentations wrong?
It gives me pop ups about line 52, 62 and 78.



# You can place the script of your game in this file.

# Declare images below this line, using the image statement.
# eg. image eileen happy = "eileen_happy.png"
image Barton standing= "Tall-skinny-man-1-.jpg"
image street ="sokaklambasnnindawallpa.jpg"
image arrow ="images.jpeg"
image helicopter = "how-to-draw-a-helicopt...50_5.jpg"
image highway = "highway_401_night_lapse_busy.jpg"
image mans car = "force-one-inside-of-drivers-side-open-door-039.jpg"
image down highway = "stock-footage-timelapse-shot-driving-at-night-on-a-wet-toronto-highway.jpg"
image co-op city = "images copy 2.jpeg"
image outside building = "outsidebuilding.jpg"
image elevator = "6.jpg"
image floor= "floor.jpg"
image machine ="coff.jpg"
image hall = "hotel.jpg"
image dark = "black.jpg"
image wife = "lil.jpg"
image apartment = "apart.jpg"
image game over = "go.jpeg"
image tv = "Unknown.jpeg"
image room = "bedroom.jpg"
image theater = "snapple.jpg"
image barton inside = "brandon-neutral.png"
image dan = "denzel.jpg"
image dansit = "dansit.jpeg"
# Declare characters used by this game.
define b = Character('Barton', color="#c8ffc8")
define a = Character ('???', color= "#c8ffc8")
define mys = Character ('Mystierious Man', color= "#c8ffc8")
define me = Character ('Me', color= "#477c82")
define l = Character ('Lilita', color= "#FF69B4")
define n = Character ('Newscaster', color= "#d45b19")
define manage = Character ('Manager', color= "#c8ffc8")
define dan = Character ('Daniel', color= "#34DDDD")
# The game starts here.
label start:
scene street
show Barton standing
b "Listen to me."
b "My name is Barton."
b "I'm here to tell you a few things about how to play this game."
label arrow:
show arrow
b " on the bottom, you can see your prefrences."
b " you can change the text speed, the volume and save, the game."
b " If you want to skip, you can do that as well."
hide arrow
b " In the game you will be presented with menus, much like this one."

menu:
"yes, I do.":
jump choice1
label choice1:
b "These are used constantly throughout the game, so remember them."
b "(Also, when a character speaks in perenthesis it means they are thinking)"
b " Now, are you ready to enter the world?"
menu:
"yes.":
jump yeschoicebarton
"no.":
jump arrow
label yeschoicebarton:
b " Good, welcome to live at 11. We will meet again"
scene street
with dissolve
pause (2.0)
scene highway
play music "car.mp3"
a "What do you know about life..."
a "One day, You're standing there, happy, and the next, your buisness is failing, and your on the highway trying to get a rid."
a " And everyone just ignores you, right there as life just passess by."
a " Soon, you just think. Too much. Until the absolute complexity of your thinking explodes, and every last second can be sensed"
label thoughts:
a "Have you ever felt that way?"
menu:
"Yes, for sure":
jump yesforsurechoice
$ highway = "yeahforsure"
"No, I haven't":
jump noforsurechoice
$ highway = "noihavent"
"what?":
jump thoughts
label yesforsurechoice:
a "I know how all these thoughts correspond."
a "It's a science, really."
a "Just a way of figuring out the way time is, just standing there."
a "Sometimes life can be amazing."
a "God,I'm cold."
a "Why does no one care about me?!"
a "There's a car, I think it's stopping for me."
a "Oh, thank god!"
show mans car
mys "get in."
hide mans car
jump inthecartime
label noforsurechoice:
a "Well, that is unfortunate."
a " I find it's just a science, a guideline that life must follow"
a "God,I'm cold."
a "Why does no one care about me?!"
a "There's a car, I think it's stopping for me."
a "Oh, thank god!"

User avatar
xavimat
Eileen-Class Veteran
Posts: 1458
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

Re: need help with code

#2 Post by xavimat » Thu Mar 05, 2015 2:10 pm

Please, to show your code in this forum put it inside the code tags: [ code ] ...your code... [ /code ] (without the spaces).
The result is:

Code: Select all

 ...your code... 
and we'll be able to see your indentation.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

Tiger Tech
Newbie
Posts: 3
Joined: Thu Mar 05, 2015 1:59 pm
Contact:

Re: need help with code

#3 Post by Tiger Tech » Thu Mar 05, 2015 2:41 pm

# You can place the script of your game in this file.

# Declare images below this line, using the image statement.
# eg. image eileen happy = "eileen_happy.png"
image Barton standing= "Tall-skinny-man-1-.jpg"

Code: Select all

image street ="sokaklambasnnindawallpa.jpg"
image arrow ="images.jpeg"
image helicopter = "how-to-draw-a-helicopt...50_5.jpg"
image highway = "highway_401_night_lapse_busy.jpg"
image mans car = "force-one-inside-of-drivers-side-open-door-039.jpg"
image down highway = "stock-footage-timelapse-shot-driving-at-night-on-a-wet-toronto-highway.jpg"
image co-op city = "images copy 2.jpeg"
image outside building = "outsidebuilding.jpg"
image elevator = "6.jpg"
image floor= "floor.jpg"
image machine ="coff.jpg"
image hall = "hotel.jpg"
image dark = "black.jpg"
image wife = "lil.jpg"
image apartment = "apart.jpg"
image game over = "go.jpeg"
image tv = "Unknown.jpeg"
image room = "bedroom.jpg"
image theater = "snapple.jpg"
image barton inside = "brandon-neutral.png"
image dan = "denzel.jpg"
image dansit = "dansit.jpeg"
# Declare characters used by this game.
define b = Character('Barton', color="#c8ffc8")
define a = Character ('???', color= "#c8ffc8")
define mys = Character ('Mystierious Man', color= "#c8ffc8")
define me = Character ('Me', color= "#477c82")
define l = Character ('Lilita', color= "#FF69B4")
define n = Character ('Newscaster', color= "#d45b19")
define manage = Character ('Manager', color= "#c8ffc8")
define dan = Character ('Daniel', color= "#34DDDD")
# The game starts here.
label start:
scene street
show  Barton standing
b "Listen to me."
b "My name is Barton." 
b "I'm here to tell  you a few things about how to play this game."
label arrow:
show  arrow
b " on the bottom, you can see your prefrences."
b " you can change the text speed, the volume and save, the game."
b " If you want to skip, you can do that as well."
hide  arrow
b " In the game you will be presented with menus, much like this one."

    menu:
    "yes, I do.":
    jump choice1
label choice1:
b "These are used constantly throughout the game, so remember them."
b "(Also, when a character speaks in perenthesis it means they are thinking)"
b " Now, are you ready to enter the world?"
menu:
    "yes.":
        jump yeschoicebarton
            "no.":
            jump arrow
                label yeschoicebarton:
        b " Good, welcome to live at 11. We will meet again"
        scene street
        with dissolve
        pause (2.0)
        scene highway
        play music "car.mp3" 
        a "What do you know about life..."          
        a "One day, You're standing there, happy, and the next, your buisness is failing, and your on the highway trying to get a rid."  
        a " And everyone just ignores you, right there as life just passess by."  
        a  " Soon, you just think. Too much. Until the absolute complexity of your thinking explodes, and every last second can be sensed"
        label thoughts:
        a "Have you ever felt that way?"
        menu:
            "Yes, for sure":
            jump yesforsurechoice
            $ highway = "yeahforsure"
                "No, I haven't":
                jump noforsurechoice
                $ highway = "noihavent"
                    "what?":
                    jump thoughts
                        label yesforsurechoice:
                        a "I know how all these thoughts correspond."
                        a "It's a science, really."
                        a "Just a way of figuring out the way time is, just standing there."
                        a "Sometimes life can be amazing."
                        a "God,I'm cold."
                        a "Why does no one care about me?!"
                        a "There's a car, I think it's stopping for me."
                        a "Oh, thank god!"
                        show mans car
                        mys "get in."
                        hide mans car
                        jump inthecartime
                            label noforsurechoice:
                              a "Well, that is unfortunate."
                              a " I find it's just a science, a guideline that life must follow"
                              a "God,I'm cold."
                              a "Why does no one care about me?!"
                              a "There's a car, I think it's stopping for me."
                              a "Oh, thank god!" 

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: need help with code

#4 Post by trooper6 » Thu Mar 05, 2015 3:23 pm

This question should be in the Question thread, not the development thread.

Anyway. There are a lot of indentation errors in the code you posted. A lot.
You should note the following--after you have a colon, ":", you must indent. When you are done with the subsection that took the indent, you indent back out one level again. This is especially important with menus. Don't throw in indents randomly otherwise.

Also, I like having blank spaces in-between my larger blocks of code just to make things a bit clearer.

Here is my take on your code. Study seriously the differences between your original code and mine. Hopefully that will help you figure out what you need to do in the future:

Code: Select all

# You can place the script of your game in this file.

# Declare images below this line, using the image statement.
# eg. image eileen happy = "eileen_happy.png"
image Barton standing= "Tall-skinny-man-1-.jpg"
image street ="sokaklambasnnindawallpa.jpg"
image arrow ="images.jpeg"
image helicopter = "how-to-draw-a-helicopt...50_5.jpg"
image highway = "highway_401_night_lapse_busy.jpg"
image mans car = "force-one-inside-of-drivers-side-open-door-039.jpg"
image down highway = "stock-footage-timelapse-shot-driving-at-night-on-a-wet-toronto-highway.jpg"
image co-op city = "images copy 2.jpeg"
image outside building = "outsidebuilding.jpg"
image elevator = "6.jpg"
image floor= "floor.jpg"
image machine ="coff.jpg"
image hall = "hotel.jpg"
image dark = "black.jpg"
image wife = "lil.jpg"
image apartment = "apart.jpg"
image game over = "go.jpeg"
image tv = "Unknown.jpeg"
image room = "bedroom.jpg"
image theater = "snapple.jpg"
image barton inside = "brandon-neutral.png"
image dan = "denzel.jpg"
image dansit = "dansit.jpeg"

# Declare characters used by this game.
define b = Character('Barton', color="#c8ffc8")
define a = Character ('???', color= "#c8ffc8")
define mys = Character ('Mystierious Man', color= "#c8ffc8")
define me = Character ('Me', color= "#477c82")
define l = Character ('Lilita', color= "#FF69B4")
define n = Character ('Newscaster', color= "#d45b19")
define manage = Character ('Manager', color= "#c8ffc8")
define dan = Character ('Daniel', color= "#34DDDD")

# The game starts here.
label start:
    scene street
    show  Barton standing
    b "Listen to me."
    b "My name is Barton." 
    b "I'm here to tell  you a few things about how to play this game."

label arrow:
    show  arrow
    b " on the bottom, you can see your prefrences."
    b " you can change the text speed, the volume and save, the game."
    b " If you want to skip, you can do that as well."
    hide  arrow
    b " In the game you will be presented with menus, much like this one."

    menu:
    "yes, I do.":
        jump choice1

label choice1:
    b "These are used constantly throughout the game, so remember them."
    b "(Also, when a character speaks in perenthesis it means they are thinking)"
    b " Now, are you ready to enter the world?"
    menu:
        "yes.":
            jump yeschoicebarton
        "no.":
            jump arrow
            
label yeschoicebarton:
    b " Good, welcome to live at 11. We will meet again"
    scene street
    with dissolve
    pause (2.0)
    scene highway
    play music "car.mp3" 
    a "What do you know about life..."          
    a "One day, You're standing there, happy, and the next, your buisness is failing, and your on the highway trying to get a rid."  
    a "And everyone just ignores you, right there as life just passess by."  
    a "Soon, you just think. Too much. Until the absolute complexity of your thinking explodes, and every last second can be sensed"
        
label thoughts:
    a "Have you ever felt that way?"
    menu:
        "Yes, for sure":
            jump yesforsurechoice
            $ highway = "yeahforsure"
        "No, I haven't":
            jump noforsurechoice
            $ highway = "noihavent"
        "what?":
            jump thoughts
                    
label yesforsurechoice:
    a "I know how all these thoughts correspond."
    a "It's a science, really."
    a "Just a way of figuring out the way time is, just standing there."
    a "Sometimes life can be amazing."
    a "God,I'm cold."
    a "Why does no one care about me?!"
    a "There's a car, I think it's stopping for me."
    a "Oh, thank god!"
    show mans car
    mys "get in."
    hide mans car
    jump inthecartime
                            
label noforsurechoice:
    a "Well, that is unfortunate."
    a " I find it's just a science, a guideline that life must follow"
    a "God,I'm cold."
    a "Why does no one care about me?!"
    a "There's a car, I think it's stopping for me."
    a "Oh, thank god!"
    
label inthecartime:
    a "This game is over now"
    return
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

Tiger Tech
Newbie
Posts: 3
Joined: Thu Mar 05, 2015 1:59 pm
Contact:

Re: need help with code

#5 Post by Tiger Tech » Thu Mar 05, 2015 5:16 pm

Thank you so much!

Post Reply

Who is online

Users browsing this forum: Hojoo