script.rpy indentation mismatch

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
Guestify
Newbie
Posts: 3
Joined: Wed Jan 17, 2018 4:11 pm
Github: Guestify
Contact:

script.rpy indentation mismatch

#1 Post by Guestify »

I tried to make a menu but it says indentation mismatch here is the code (I'm a complete noob to python and to Ren'Py sorry if this was dumb or anything)
menu:
"Okay we will make a club.":
jump choice1_yes

"No a club is a pain in the ass to make.":
jump choice1_no

label choice1_yes:
$menu_flag = True
m "Thanks I always dreamed of owning a club!"
(this one is the one that the game gives me error at) jump choice1_done

label choice1_no:
$ menu_flag = False
quit()
jump choice1_done

label choice1_done:

ReDZiX
Regular
Posts: 32
Joined: Thu Jan 04, 2018 12:42 pm
Contact:

Re: script.rpy indentation mismatch

#2 Post by ReDZiX »

Identation means you need to write the script by inserting a number of spaces (4 is the generally accepted best practice) after certain statements that end in colons (:), like labels and menus (Probably not a good explanation, you may want to google 'python identation' to find out more about it). And all lines below should be at the same amount of spaces if they belong to that statement.

So the code should look like this:

Code: Select all

menu: 
    "Okay we will make a club.": 
        jump choice1_yes

    "No a club is a pain in the ass to make.":
        jump choice1_no

label choice1_yes:
    $menu_flag = True
    m "Thanks I always dreamed of owning a club!"
    jump choice1_done

Post Reply

Who is online

Users browsing this forum: No registered users