Page 1 of 1

Making my first "game", help with scripting?

Posted: Sat Nov 29, 2008 3:55 am
by Guest
I read the tutorial, played the game, and I'm not a n00b when it comes to scripting. I have most of the features down, but I'm having a bit of trouble. Okay, here is my game script.

Code: Select all

label start:
    scene bg background
    show person guy

    e "You're some punk kid in high school"

    e "Yeah, so... do something"
    
    e "C'mon! Do something already!"
    
    show person girl
    
    g "Hi! How's it going?"
    
menu:
"Go away!":
jump ok
   
"Go die!":
jump ok2
   
   label ok:
   scene bg background
   show person girl
   
   g "Okay. Bye!"
   
   e "You won. Congratulations!"
   
   return
   
   label ok2:
   scene  bg background
   show person girl
   
   g "Maybe I will!"
   
   e "You won! Congratulations!"
   
   return
And here's the traceback I keep getting

Code: Select all

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


On line 30 of C:\Documents and Settings\Schenk\Desktop\renpy-6.8.0-sdk\renpy-6.8.0\Lol First/game/script.rpy: menu statement expects a non-empty block.
menu:
    ^

On line 31 of C:\Documents and Settings\Schenk\Desktop\renpy-6.8.0-sdk\renpy-6.8.0\Lol First/game/script.rpy: expected statement.
"Go away!":
          ^

On line 34 of C:\Documents and Settings\Schenk\Desktop\renpy-6.8.0-sdk\renpy-6.8.0\Lol First/game/script.rpy: expected statement.
"Go die!":
         ^

On line 35 of C:\Documents and Settings\Schenk\Desktop\renpy-6.8.0-sdk\renpy-6.8.0\Lol First/game/script.rpy: jump statement does not expect a block. Please check the indentation of the line after this one.
jump ok2
    ^

Ren'Py Version: Ren'Py 6.8.0f
So, um... I did my spacing and indentations perfectly, at least I think I did. Help me?

Re: Making my first "game", help with scripting?

Posted: Sat Nov 29, 2008 3:59 am
by Goonka
Heh heh! I forgot to login! Sorry for the double post by the way.

Re: Making my first "game", help with scripting?

Posted: Sat Nov 29, 2008 4:35 am
by Samu-kun
Try this.

Code: Select all

label start:
    scene bg background
    show person guy

    e "You're some punk kid in high school"
    e "Yeah, so... do something"
    e "C'mon! Do something already!"

    show person girl
   
    g "Hi! How's it going?"
   
menu:
    "Go away!":
        jump ok
   
    "Go die!":
        jump ok2
   
label ok:
    scene bg background
    show person girl
   
    g "Okay. Bye!"   
    e "You won. Congratulations!"
   
   return
   
label ok2:
    scene bg background
    show person girl
   
    g "Maybe I will!"   
    e "You won! Congratulations!"
   
    return

Re: Making my first "game", help with scripting?

Posted: Tue Dec 02, 2008 7:21 am
by filsduloup
The renpy's langage uses a order system both horizontally and vertically.

bad exemple:

Code: Select all

label lovescene:
"i love you mike !"

Code: Select all

           label lovescene:
"i love you mike !"
good exemple:

Code: Select all

label lovescene:
     "i love you mike !"

Re: Making my first "game", help with scripting?

Posted: Tue Dec 02, 2008 8:03 am
by Twar3Draconis
Yep. Python (Or RenPy), unlike most languages, does NOT ignore whitespace. So, clean code is enforced, but it's good practice anyway.