menu statement expects a non-empty block.

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
sprinkledonuts

menu statement expects a non-empty block.

#1 Post by sprinkledonuts » Sun May 18, 2008 12:56 pm

Alright.
Used the tutorial. The demo.
Followed along. Tried to make a simple question. The kind that really doesn't affect the outcome of the game at all.
The kind where you say "A or B?"
And if you say A she says "YAY!" and if you say B she says "Aww..." but then it'll always continue on with the same course in the game.
Succeeded.

Tried to make the questions affect what she says later in the game.
(later she might say "Since you chose A, let's go over here. :3)
Failed.

Tried to make more complicated webs of events with answers leading to more menus.
Also failed.

I've read through the tutorials, and the one thing I really need right now is a "HOW TO IDENTIFY ERRORS" tutorial.
Ignoring the ones that don't tell you the error and just say there was an exception and then lists a bunch of seemingly random Ren'Py files, the one that baffles me the most are ones like the title there.
What the hell is a block, and what does it mean to have it empty or not empty? I'M LOSING MY MIND OVER HERE.

Thank you have a good day. ^_____^


PS: If you have an answer to my question, please e-mail it to me. sprinkledonuts@gmail.com
I'm not going to be checking these forums, because I have no idea how fast or slow they are.

Guest

Re: menu statement expects a non-empty block.

#2 Post by Guest » Sun May 18, 2008 1:00 pm

I don't see where you can attatch a file, so here's what the error looked like to me:



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


On line 77 of /Users/sarah/Desktop/renpy-6.6.2/Testing Sim/game/script.rpy: menu statement expects a non-empty block.
menu:
^

On line 79 of /Users/sarah/Desktop/renpy-6.6.2/Testing Sim/game/script.rpy: say statement does not expect a block. Please check the indentation of the line after this one.
c "This is a question."
^

On line 89 of /Users/sarah/Desktop/renpy-6.6.2/Testing Sim/game/script.rpy: expected 'name' not found.
label 1_okay:
^

On line 95 of /Users/sarah/Desktop/renpy-6.6.2/Testing Sim/game/script.rpy: expected 'name' not found.
label 1_nokay:
^

Ren'Py Version: Ren'Py 6.6.2b



This was what I was trying to get to work:


menu:

c "This is a question."

"okay.":

jump 1_okay

"Not okay":

jump 1_nokay

label 1_okay:

c "... is this the problem?"

jump choices_done

label 1_nokay:

c "Why ever not?"

c "... never mind."

jump choices_done

label choices_done:

c "Well, that was fun."

Guest

Re: menu statement expects a non-empty block.

#3 Post by Guest » Sun May 18, 2008 1:01 pm

don't see the edit button either.

The forums took out all the indentations and stuff, so kindly disregard the script I was trying to get to work. ><

User avatar
Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: menu statement expects a non-empty block.

#4 Post by Jake » Sun May 18, 2008 1:39 pm

sprinkledonuts wrote:PS: If you have an answer to my question, please e-mail it to me. sprinkledonuts@gmail.com
I'm not going to be checking these forums, because I have no idea how fast or slow they are.


I'm not going to email an answer to your question, because if you ask for help on a forum, it's pretty rude to then tell the people there that you're not going to bother checking for replies. As it goes, this forum is fairly active; most questions have an answer posted in a couple of hours.

Guest wrote:don't see the edit button either.


You don't see an edit button because you're not logged in; guests can't edit their posts. How would the software know it was definitely you, and not someone else?
You probably can't attach files as a guest, either. For registered users, at least, there's an "Upload Attachment" box directly under the "Post a reply" box.

Guest wrote:The forums took out all the indentations and stuff, so kindly disregard the script I was trying to get to work. ><


If you want indentation to show up, put it between 'code' tags, e.g.:

[code ]Some code[/code]

Code: Select all

Some code


(Remove space in first tag to make it work.)

As it goes, from the error, it looks like indentation is your problem, though. Each menu option should be indented further than the line where you wrote 'menu:', and each bit of code dependent on an option needs to be indented further than that option, e.g.:

Code: Select all

  menu:
    "Here's a menu."
    "Option 1":
      jump option_1_selected
    "Option 2":
      jump option_2_selected
Server error: user 'Jake' not found

Guest

Re: menu statement expects a non-empty block.

#5 Post by Guest » Sun May 18, 2008 7:59 pm

Jake wrote:
sprinkledonuts wrote:PS: If you have an answer to my question, please e-mail it to me. sprinkledonuts@gmail.com
I'm not going to be checking these forums, because I have no idea how fast or slow they are.


I'm not going to email an answer to your question, because if you ask for help on a forum, it's pretty rude to then tell the people there that you're not going to bother checking for replies. As it goes, this forum is fairly active; most questions have an answer posted in a couple of hours.

Guest wrote:don't see the edit button either.


You don't see an edit button because you're not logged in; guests can't edit their posts. How would the software know it was definitely you, and not someone else?
You probably can't attach files as a guest, either. For registered users, at least, there's an "Upload Attachment" box directly under the "Post a reply" box.

Guest wrote:The forums took out all the indentations and stuff, so kindly disregard the script I was trying to get to work. ><


If you want indentation to show up, put it between 'code' tags, e.g.:

[code ]Some code[/code]

Code: Select all

Some code


(Remove space in first tag to make it work.)

As it goes, from the error, it looks like indentation is your problem, though. Each menu option should be indented further than the line where you wrote 'menu:', and each bit of code dependent on an option needs to be indented further than that option, e.g.:

Code: Select all

  menu:
    "Here's a menu."
    "Option 1":
      jump option_1_selected
    "Option 2":
      jump option_2_selected

I'm sorry if I sounded rude and/or stupid. Don't usually post here. I figured I couldn't edit it because I wasn't a member, just never bothered to say it.

Anyway, that's what my friends said as well, but I checked and looked at how indented it was and honestly the indentation was perfect
I tried to change it and it really didn't do anything. Any other ideas or am I just stuck? ><

User avatar
Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: menu statement expects a non-empty block.

#6 Post by Jake » Sun May 18, 2008 8:13 pm

Guest wrote:Anyway, that's what my friends said as well, but I checked and looked at how indented it was and honestly the indentation was perfect


The most annoying thing about Python, IMO, is that you can't mix tabs and spaces when indenting things. I can understand why - there's no way for the compiler to tell how big your tabs are and whether a particular line indented with tabs is more or less indented than one indented with spaces - but it's frustrating to work with. Are you sure that all your indentations are indented with spaces, and not tabs?

Otherwise, post your script, and we can have a look at it; it's kind of hard to diagnose issues blind.
Server error: user 'Jake' not found

User avatar
PyTom
Ren'Py Creator
Posts: 14908
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: menu statement expects a non-empty block.

#7 Post by PyTom » Sun May 18, 2008 8:54 pm

Tabs shouldn't be a problem. All modern version of Ren'Py error out when faced with a tab.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama
https://www.patreon.com/renpytom

User avatar
Ilaine
Newbie
Posts: 9
Joined: Fri Mar 28, 2014 6:52 am
Contact:

Re: menu statement expects a non-empty block.

#8 Post by Ilaine » Fri Mar 28, 2014 12:16 pm

Hi guys,

I'm new here and thanks to ren'py I finally could start to make a otome game but it doesn't work out like I want to.
And I don't know where the problem lies.

#1. Decision 4 guys#####################################

menu:
"Piña Colada":
call charles1

"Sex on the beach" :
call one1

" Abstellglas":
call seth1

"Zombie":
call clow1


return

#####################################################

this is the code and I try to make more than 2 answer options for the player.
but when I open it with the launch of ren'py it only shows me errors and I have no clue what it could be.

It looks like this: http://img5.fotos-hochladen.net/uploads ... dtgscr.jpg

Thank you for advance I would be grateful if someone can help me to solve this problem. :oops:

User avatar
Alex
Eileen-Class Veteran
Posts: 1832
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: menu statement expects a non-empty block.

#9 Post by Alex » Fri Mar 28, 2014 1:27 pm

You need to fix the indentation in your code (http://www.renpy.org/wiki/renpy/FAQ#How ... _blocks.3F)

sxcb345t
Newbie
Posts: 2
Joined: Sun Jan 07, 2018 3:18 pm
Contact:

Re: menu statement expects a non-empty block.

#10 Post by sxcb345t » Sun Jan 07, 2018 3:22 pm

menu:
"Yes":
jump choice1_yes

"No":
jump choice1_no

label choice1_yes:

$ menu_flag = True

o "So you pick the mirror?"

jump choice1_done

label choice1_no:

$ menu_flag = False

o "The flint ey?"

t "That's a flint?"

label choice1_done:

^is there anything wrong with mine?
It keeps saying that menu statements expects a non-empty block
and "Yes" and "No" are an expected statement...

pew pew
Newbie
Posts: 4
Joined: Sun Jan 07, 2018 3:51 pm
Contact:

Re: menu statement expects a non-empty block.

#11 Post by pew pew » Sun Jan 07, 2018 4:08 pm

^is there anything wrong with mine?
It keeps saying that menu statements expects a non-empty block
and "Yes" and "No" are an expected statement...
I had the same problem. Found out that pyhton looks at indentation.

Code: Select all

menu:
	"Yes":
		jump choice1_yes
You need to build it up.
"menu:" 1 indentation (since its inside a lable) follows with 2 indentation just before "Yes": and then 3 before "jump to"


Should look something like this:

Code: Select all

label start
	"..."
	
	menu:
		"Yes":
			jump choice1_yes

		"No":
			jump choice1_no

label choice1_yes:

	$ menu_flag = True

	o "So you pick the mirror?"

	jump choice1_done

label choice1_no:

	$ menu_flag = False

	o "The flint ey?"

	t "That's a flint?"

label choice1_done:
Last edited by pew pew on Tue Jan 09, 2018 5:39 pm, edited 1 time in total.

sxcb345t
Newbie
Posts: 2
Joined: Sun Jan 07, 2018 3:18 pm
Contact:

Re: menu statement expects a non-empty block.

#12 Post by sxcb345t » Sun Jan 07, 2018 8:16 pm

pew pew wrote:
Sun Jan 07, 2018 4:08 pm
^is there anything wrong with mine?
It keeps saying that menu statements expects a non-empty block
and "Yes" and "No" are an expected statement...
I had the same problem. Found out that phyton looks at indentation.

Code: Select all

menu:
	"Yes":
		jump choice1_yes
You need to build it up.
"menu:" 1 indentation (since its inside a lable) follows with 2 indentation just before "Yes": and then 3 before "jump to"


Should look something like this:

Code: Select all

label start
	"..."
	
	menu:
		"Yes":
			jump choice1_yes

		"No":
			jump choice1_no

label choice1_yes:

	$ menu_flag = True

	o "So you pick the mirror?"

	jump choice1_done

label choice1_no:

	$ menu_flag = False

	o "The flint ey?"

	t "That's a flint?"

label choice1_done:
So i just need to add

label start
"..."

at the beginning? or Am i suppose to put in something else instead of "..."??

I tried it but it says that the indentations are incorrect before "menu"
I had to change all the number of tabs into spaces
but is there more than one indentation before menu?


Sorry Im so Noob I onlu started yesterday and I have no idea why its not working when Im copying the tutorials TT

pew pew
Newbie
Posts: 4
Joined: Sun Jan 07, 2018 3:51 pm
Contact:

Re: menu statement expects a non-empty block.

#13 Post by pew pew » Tue Jan 09, 2018 5:36 pm

Your "label start" is where your script or rather your story begins. You can look it up in the renpy tutorial.
The "..." was added by me. You don't need that.

Here a visualisation of what I mean by indentations (notice the ------ lines):

label start
-------menu:
--------------"Yes":
---------------------jump choice1_yes

"label start" has no Indentation
menu has 1 Indentation (hit Tab 1x)
the menuoption has 2 Indentations (hit Tab 2x)
the jump choice has 3 Indentations (hit Tab 2x)
This applies for this example. If "label start" happens to have already a Indentation, then all childs need to build up on this. (Think of +1x Tab for every following child)


Here is a code to copy and paste to try:

Code: Select all

label start

	menu:
		"Yes":
			jump choice1_yes

		"No":
			jump choice1_no

Post Reply

Who is online

Users browsing this forum: xavimat