Need help with making a menu and creating choices. What am I doing wrong?

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
Zivio207
Newbie
Posts: 1
Joined: Thu Apr 02, 2020 4:22 pm
Contact:

Need help with making a menu and creating choices. What am I doing wrong?

#1 Post by Zivio207 »

Hey I need some help. I'm just starting out with Renpy and I'm trying to learn how to use it. I want to make 3 choices that all lead to an outcome.
When I launch the game it gives the following error:
menu statement expects a non-empty block.

How do I fix it?



menu:

"Who are you?"
jump choice_whoareyou

"I don't trust you"
jump choice_idonttrustyou

"Alright let's go!"
jump choice_alrightletsgo


label choice_whoareyou:
j "Excuse me but, who are you?"



label choice_idonttrustyou:
j "Sorry, but I don't even know who you are. I'm kinda hesitant going with you."


label choice_alrightletsgo:
j "Alright I'll join you."

label choice_done:

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Need help with making a menu and creating choices. What am I doing wrong?

#2 Post by Imperf3kt »

Take a look at the tutorial game accessible via the launcher.
Your issue is indentation (blank spacing)
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

verysunshine
Veteran
Posts: 339
Joined: Wed Sep 24, 2014 5:03 pm
Organization: Wild Rose Interactive
Contact:

Re: Need help with making a menu and creating choices. What am I doing wrong?

#3 Post by verysunshine »

I'm guessing your code is indented like this:

Code: Select all

	menu:

		"Who are you?"
		jump choice_whoareyou

		"I don't trust you"
		jump choice_idonttrustyou

		"Alright let's go!"
		jump choice_alrightletsgo


label choice_whoareyou:
	j "Excuse me but, who are you?"



label choice_idonttrustyou:
	j "Sorry, but I don't even know who you are. I'm kinda hesitant going with you."


label choice_alrightletsgo:
	j "Alright I'll join you."

label choice_done:
	"This just fills the label. If a label is empty, Ren'Py will crash."
The issue is that options in a menu need a colon after them, and everything inside a menu choice needs to be indented one more time.

Code: Select all

	menu:

		"Who are you?":
			jump choice_whoareyou

		"I don't trust you":
			jump choice_idonttrustyou

		"Alright let's go!":
			jump choice_alrightletsgo

Build the basics first, then add all the fun bits.

Please check out my games on my itch.io page!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], Ocelot