[SOLVED] Unlocking an Alternate Menu Image

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
Tookipalooki
Newbie
Posts: 11
Joined: Tue Jan 03, 2017 9:38 pm
Completed: Chook & Sosig
Projects: Chook & Sosig : A Case of Murder
Tumblr: Tookipalooki
itch: TookiPalooki
Contact:

[SOLVED] Unlocking an Alternate Menu Image

#1 Post by Tookipalooki » Sat Jan 07, 2017 7:13 pm

edit:yay I cracked it!

Hello again, I'm very sorry for so many questions, I'm trying to add in the feature for having an alternate main menu background image but I'm having trouble with my code and I'm not sure what it is that I've done to upset it. I was reading some similar questions and examples but mine isnt playing as intended.

This is what I'm currently trying, this is the code in the script:


Code: Select all

   if air:
    ch"How come you chose the blue lantern anyway?"
    $ persistent.played = True
    jump end

if fire:
    ch"How come you chose the orange lantern anyway?"
    $ persistent.played = False
    jump end 
and on the screens:

Code: Select all

screen main_menu:
    


    # This ensures that any other menu screen is replaced.
    tag menu

    if persistent.played:
        use wonderful_menu
    else:
        use main_menu_default
which jumps to either of these 2:

Code: Select all

screen main_menu_default:
    tag menu
#stuff in-between clipped out#
image main_menu:
    "gui/game_menu2.png"
    pause 0.15
    "gui/game_menu.png"
    pause 0.15
    "gui/game_menu3.png"
    pause 0.15
    repeat
2nd:

Code: Select all

screen wonderful_menu:

    # This ensures that any other menu screen is replaced.
    tag menu

#stuff in-between clipped out#
image main_menu:
    "gui/wonderful_menu.png" 

I think I'm indenting the image part of the menu wrong, as it just reads the wonderful_menu background image last and uses that all the time. I'm not sure how to get this running as it should, would anyone be able to help me get this smoothed out?

any help is loved <3

User avatar
Tookipalooki
Newbie
Posts: 11
Joined: Tue Jan 03, 2017 9:38 pm
Completed: Chook & Sosig
Projects: Chook & Sosig : A Case of Murder
Tumblr: Tookipalooki
itch: TookiPalooki
Contact:

Re: [SOLVED] Unlocking an Alternate Menu Image

#2 Post by Tookipalooki » Sat Jan 07, 2017 9:23 pm

I'll add this in to show where I was messing up, I was overlooking something really simple:

replaced this:

Code: Select all

add gui.main_menu_background
with this:

Code: Select all

add gui.wonderful_menu_background

image wonderful_menu:
    "gui/wonderful_menu.png"
and added a new one in at the gui screen

Code: Select all

define gui.wonderful_menu_background = "wonderful_menu"

I didd'nt realize what I was doing was asking both menus to go and refer to "gui.main_menu_background" for its background

Post Reply

Who is online

Users browsing this forum: nyeowmi