Making my first "game", help with scripting?

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
Guest

Making my first "game", help with scripting?

#1 Post 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?

Goonka
Newbie
Posts: 1
Joined: Sat Nov 29, 2008 3:52 am
Contact:

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

#2 Post by Goonka »

Heh heh! I forgot to login! Sorry for the double post by the way.

User avatar
Samu-kun
King of Moé
Posts: 2262
Joined: Mon Sep 03, 2007 3:49 pm
Organization: Love in Space Inc
Location: United States
Contact:

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

#3 Post 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

filsduloup
Regular
Posts: 65
Joined: Thu Aug 28, 2008 3:00 pm
Projects: Alchimical Girl -Homuncule-
Location: France
Contact:

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

#4 Post 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 !"

Twar3Draconis
Regular
Posts: 129
Joined: Thu Apr 19, 2007 12:07 am
Location: Michigan, United States, Terra
Contact:

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

#5 Post by Twar3Draconis »

Yep. Python (Or RenPy), unlike most languages, does NOT ignore whitespace. So, clean code is enforced, but it's good practice anyway.
Image

Post Reply

Who is online

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