In game menu errors(solved!)

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
User avatar
NeenoMay
Newbie
Posts: 21
Joined: Sat Oct 27, 2012 11:36 am
Completed: None yet, working on my first VN.
Projects: Vampire Masque
Contact:

In game menu errors(solved!)

#1 Post by NeenoMay »

Hello!

So right now I am having two issues that are bothering me really bad....

First off, my in game menus won't work, to me they look fine, but I don't know.

So the menu script is like this:

menu:
"Uh, hello."
jump anna

"this person seems really rude..."
jump ignore

"Who is here?"
jump who
The script errors.
The script errors.
When I load it it says that after menu should be "a non-empty block"

I have no idea what to do and the menus are very important in my VN.



Other thing I want to ask, I can't figure it out and feel kind of stupid.

I want to know how to change to main menu.

Specifically, I want to know how to change the button shapes, and placing and also I want to know how to change the background image.

Thanks for your time!

~Ratri
Last edited by NeenoMay on Sun Oct 28, 2012 11:19 pm, edited 4 times in total.

User avatar
specialtantei
Veteran
Posts: 269
Joined: Sun Sep 30, 2012 4:13 pm
Contact:

Re: Basic Help (I feel like I should know this but I sadly d

#2 Post by specialtantei »

I believe each choice needs to have '':'' before the jump statement. Something like this:

menu:

Code: Select all

"Uh, hello.":
     jump anna

"this person seems really rude...":
     jump ignore

"Who is here?":
     jump who
That should fix it...I guess.

You can change the Main Menu and Game Menu backgrounds here in the Options, here:

Code: Select all

 ## The background of the main menu. This can be a color
        ## beginning with '#', or an image filename. The latter
        ## should take up the full height and width of the screen.
        mm_root = "menu.jpg",

        ## The background of the game menu. This can be a color
        ## beginning with '#', or an image filename. The latter
        ## should take up the full height and width of the screen.
        gm_root = "menu2.jpg"
Just put the pictures in the game folder and name them there.

You can do basic changement of buttons like colors before the code mentioned about, but for a professional look you should check the screens .rpy and learn some GUI. I can't help with that, sorry.

User avatar
NeenoMay
Newbie
Posts: 21
Joined: Sat Oct 27, 2012 11:36 am
Completed: None yet, working on my first VN.
Projects: Vampire Masque
Contact:

Re: Basic Help (I feel like I should know this but I sadly d

#3 Post by NeenoMay »

specialtantei wrote:I believe each choice needs to have '':'' before the jump statement. Something like this:

menu:

Code: Select all

"Uh, hello.":
     jump anna

"this person seems really rude...":
     jump ignore

"Who is here?":
     jump who
That should fix it...I guess.

You can change the Main Menu and Game Menu backgrounds here in the Options, here:

Code: Select all

 ## The background of the main menu. This can be a color
        ## beginning with '#', or an image filename. The latter
        ## should take up the full height and width of the screen.
        mm_root = "menu.jpg",

        ## The background of the game menu. This can be a color
        ## beginning with '#', or an image filename. The latter
        ## should take up the full height and width of the screen.
        gm_root = "menu2.jpg"
Just put the pictures in the game folder and name them there.

You can do basic changement of buttons like colors before the code mentioned about, but for a professional look you should check the screens .rpy and learn some GUI. I can't help with that, sorry.

Wow, thank you so much! This helped a lot, and I really appreciate it, again thanks.

User avatar
thadeus
Regular
Posts: 56
Joined: Mon Aug 27, 2012 2:34 pm
Projects: Pointless
Location: Canada
Contact:

Re: Basic Help (halfway solved)

#4 Post by thadeus »

See, I'm having that same issue! My code is:

menu:
"You totally are.":
jump totally
"Yeh, you're not.":
jump not

And I'm having the "expects a non-empty block" for my menu line and I'm getting "expected statement" for the 'you are' and 'you arent' lines o_O
Image

User avatar
NeenoMay
Newbie
Posts: 21
Joined: Sat Oct 27, 2012 11:36 am
Completed: None yet, working on my first VN.
Projects: Vampire Masque
Contact:

Re: Basic Help (halfway solved)

#5 Post by NeenoMay »

thadeus wrote:See, I'm having that same issue! My code is:

menu:
"You totally are.":
jump totally
"Yeh, you're not.":
jump not

And I'm having the "expects a non-empty block" for my menu line and I'm getting "expected statement" for the 'you are' and 'you arent' lines o_O

*nods* I also tried adding the colons and it didn't help. It's starting to give me a headache, I've got three in game menus so far and can't figure it out, for now though I'm just trying to figure out my first menu...

tigerkidde
Regular
Posts: 155
Joined: Sun Mar 01, 2009 2:31 pm
Projects: Summer Tales of Katt and June
Contact:

Re: Basic Help (In game menu errors)

#6 Post by tigerkidde »

I think the code is space sensitive.

What I've liked to do is space all of my code maybe three spaces in from the label.
I think this lets the program know that all the text spaced in three times is grouped together, like one big block.

For a menu, you would have to create another block by adding even more space.
And for the results of any choice inside the menu, you will add even more space to that.

Label is 0 spaces.
Most dialogue and the "menu:" is 3 spaces in.
The choices for the menu are 6 spaces in.
The results for the choices are 9 spaces in.

Please note, you cannot use Tab to indent either.

What your code may currently look like:

Code: Select all

label start:
# All the code you had before this.
menu:
"You totally are.":
jump totally 
"Yeh, you're not.":
jump not
With spacing.

Code: Select all

label start:
    # All the code you had before this.
    menu:
        # extra space in to create the 'Menu' block
        "You totally are.":
            # Space in to indicate this is what happens if you choose "You totally are."
            jump totally 
        "Yeh, you're not.":
            # Space in to indicate this is what happens if you choose "Yeh, you're not." 
            jump not
I hope this helps some.

User avatar
NeenoMay
Newbie
Posts: 21
Joined: Sat Oct 27, 2012 11:36 am
Completed: None yet, working on my first VN.
Projects: Vampire Masque
Contact:

Re: Basic Help (In game menu errors)

#7 Post by NeenoMay »

tigerkidde wrote:I think the code is space sensitive.

What I've liked to do is space all of my code maybe three spaces in from the label.
I think this lets the program know that all the text spaced in three times is grouped together, like one big block.

For a menu, you would have to create another block by adding even more space.
And for the results of any choice inside the menu, you will add even more space to that.

Label is 0 spaces.
Most dialogue and the "menu:" is 3 spaces in.
The choices for the menu are 6 spaces in.
The results for the choices are 9 spaces in.

Please note, you cannot use Tab to indent either.

What your code may currently look like:

Code: Select all

label start:
# All the code you had before this.
menu:
"You totally are.":
jump totally 
"Yeh, you're not.":
jump not
With spacing.

Code: Select all

label start:
    # All the code you had before this.
    menu:
        # extra space in to create the 'Menu' block
        "You totally are.":
            # Space in to indicate this is what happens if you choose "You totally are."
            jump totally 
        "Yeh, you're not.":
            # Space in to indicate this is what happens if you choose "Yeh, you're not." 
            jump not
I hope this helps some.




Yay! It works! I thank you so much, it was much help. You prevented another day long scripting headache haha.
Image

Post Reply

Who is online

Users browsing this forum: Google [Bot]