script menu items won't run

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
mearcat
Newbie
Posts: 3
Joined: Thu Jan 22, 2015 1:23 am
Tumblr: undeaddragonking
Contact:

script menu items won't run

#1 Post by mearcat »

my code looks like this :

label start:
"Choose your hero"
menu:
"Mike"
jump mike

"Harmony"
jump harmony

"Tyler"
jump tyler

label mike:

there is then a bunch of code after label mike. however, when i go to launch it, an error pops up saying
File"game/script.rpy", line 28:expected menuitem
jump mike

i'm not sure what's wrong. if you need me to show more of the code i can, this is just what i think applies to the problem.

User avatar
akemicchi
Veteran
Posts: 465
Joined: Mon Dec 31, 2007 11:22 pm
Projects: Magicians of Delphine, Panaderia: Ensaimada, SweetTooth!, XOXO Droplets
Deviantart: littlebabyshoes
Contact:

Re: script menu items won't run

#2 Post by akemicchi »

You'll want to post any code using the code tag.
[ code ] Code here. [/ code ]

You need a ":" right after all the menu items.

Code: Select all

label start:
    "Choose your hero"
    menu:
        "Mike":
            jump mike
        "Harmony":
            jump harmony
        "Tyler":
            jump tyler
Keep in mind the indentation! :)

mearcat
Newbie
Posts: 3
Joined: Thu Jan 22, 2015 1:23 am
Tumblr: undeaddragonking
Contact:

Re: script menu items won't run

#3 Post by mearcat »

thank i will remember the code tags for future use. that did solve that problem but now a new one has presented itself. it is now saying that choice menuitem expects a non-empty block, what does that mean?

User avatar
akemicchi
Veteran
Posts: 465
Joined: Mon Dec 31, 2007 11:22 pm
Projects: Magicians of Delphine, Panaderia: Ensaimada, SweetTooth!, XOXO Droplets
Deviantart: littlebabyshoes
Contact:

Re: script menu items won't run

#4 Post by akemicchi »

It means exactly what it says: you can't have an empty block following a menu item. I think you might just be having trouble with indentation; I don't know unless you post your code. xD

General format for menus are as follows:

Code: Select all

menu:
    "Choice.": # Make sure to follow with a ":" and observe the indentation!
        "Text." # Make sure to be four spaces in after following anything that ends with ":"!
    "2nd Choice.": # This line is on the same line as the other choice because it is also a choice for the menu.
        "Text."
You can't do something like:

Code: Select all

menu:
    "Choice.":
    "2nd Choice.":
You need something following the choice, whether it's a normal say statement, a jump, call, variable changes... anything.

mearcat
Newbie
Posts: 3
Joined: Thu Jan 22, 2015 1:23 am
Tumblr: undeaddragonking
Contact:

Re: script menu items won't run

#5 Post by mearcat »

yeah it did seem to be the idents. i reread your post last night and fixed it up a bit. the errors never seem to end though, you fix one and you get another, i might just have to doodle around with the program more and figure it out

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]