Call Scene From Unlocked Gallery Image [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
MrRogerSmith
Newbie
Posts: 22
Joined: Fri Jan 21, 2022 8:58 pm
Projects: Leaving DNA
itch: impiousmonk
Contact:

Call Scene From Unlocked Gallery Image [SOLVED]

#1 Post by MrRogerSmith » Wed Aug 31, 2022 5:11 pm

I'm trying to create a screen, accessible from the Main Menu, which enables the player to access nine bonus scenes. The scenes are unlocked during gameplay. These are bonus scenes, not replay scenes.

I've got a pretty generic gallery set up showing nine "locked" images and when the condition is met in the game the gallery will show an "unlocked" image that can then be clicked on to show another image. But instead of showing the new image, I want the player to be able to click on the unlocked image and be taken to the bonus scene.

I'm trying to somehow attach a "call" action to the unlocked images, but I can't figure out how to do it. Can anyone help? Am I wrong to be using this gallery structure in the first place?

Code: Select all

init python:
    dreams = Gallery()

    dreams.button("bonus1")
    dreams.condition("persistent.unlock_1")
    dreams.image("bonus1") # this is the line I want to replace with code that calls the bonus scene

    dreams.button("bonus2")
    dreams.condition("persistent.unlock_2")
    dreams.unlock_image("bonus2")

    dreams.button("bonus3")
    dreams.condition("persistent.unlock_3")
    dreams.unlock_image("bonus3")

    dreams.button("bonus4")
    dreams.condition("persistent.unlock_4")
    dreams.unlock_image("bonus4")

    dreams.button("bonus5")
    dreams.condition("persistent.unlock_5")
    dreams.unlock_image("bonus5")

    dreams.button("bonus6")
    dreams.condition("persistent.unlock_6")
    dreams.unlock_image("bonus6")

    dreams.button("bonus7")
    dreams.condition("persistent.unlock_7")
    dreams.unlock_image("bonus7")

    dreams.button("bonus8")
    dreams.condition("persistent.unlock_8")
    dreams.unlock_image("bonus8")

    dreams.button("bonus9")
    dreams.condition("persistent.unlock_9")
    dreams.unlock_image("bonus9")

screen dreams:

    tag menu

    add gui.game_menu_background

    hbox:
        xalign 0.5
        yalign 0.5
        spacing 30
        grid 3 3:
            add dreams.make_button("bonus1",unlocked="unlocked1", locked="lock1")
            add dreams.make_button("bonus2",unlocked="unlocked2", locked="lock2")
            add dreams.make_button("bonus3",unlocked="unlocked3", locked="lock3")
            add dreams.make_button("bonus4",unlocked="unlocked4", locked="lock4")
            add dreams.make_button("bonus5",unlocked="unlocked5", locked="lock5")
            add dreams.make_button("bonus6",unlocked="unlocked6", locked="lock6")
            add dreams.make_button("bonus7",unlocked="unlocked7", locked="lock7")
            add dreams.make_button("bonus8",unlocked="unlocked8", locked="lock8")
            add dreams.make_button("bonus9",unlocked="unlocked9", locked="lock9")
            spacing 15
        textbutton "Return" action Return()
Last edited by MrRogerSmith on Thu Sep 01, 2022 1:44 am, edited 1 time in total.

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1882
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Call Scene From Unlocked Gallery Image

#2 Post by Ocelot » Wed Aug 31, 2022 5:16 pm

MrRogerSmith wrote:
Wed Aug 31, 2022 5:11 pm
Am I wrong to be using this gallery structure in the first place?
Yes. Gallery is a special-made class to simplify unlocking and displaying images. It doesn't do much else. Just make own custom buttons and conditions.
< < insert Rick Cook quote here > >

MrRogerSmith
Newbie
Posts: 22
Joined: Fri Jan 21, 2022 8:58 pm
Projects: Leaving DNA
itch: impiousmonk
Contact:

Re: Call Scene From Unlocked Gallery Image

#3 Post by MrRogerSmith » Wed Aug 31, 2022 5:28 pm

Ocelot wrote:
Wed Aug 31, 2022 5:16 pm
MrRogerSmith wrote:
Wed Aug 31, 2022 5:11 pm
Am I wrong to be using this gallery structure in the first place?
Yes. Gallery is a special-made class to simplify unlocking and displaying images. It doesn't do much else. Just make own custom buttons and conditions.
Gotcha. Alright, thanks for the response!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot]