[SOLVED] Images in gallery that don't lock

For discussion and support of other visual novel engines.
Post Reply
Message
Author
Oceane_Kudo
Newbie
Posts: 2
Joined: Tue Mar 22, 2022 5:09 am
Deviantart: TheXlize
Contact:

[SOLVED] Images in gallery that don't lock

#1 Post by Oceane_Kudo » Thu Sep 15, 2022 2:04 pm

Hello there!
I have a problem and I can't figure out how to fix it... I created a gallery where images are locked in the first place and then unlocked after you discover them. I figured out how to do it with gallery.condition however for a reason, my images don't want to lock at all. Here is the code, maybe someone can help?

Code: Select all

$ persistent.boss_unlocked = False
$ persistent.bottom_unlocked = False
init python:
    gallery = Gallery()
    gallery.button("boss")
    gallery.image("bg office_boss")
    gallery.condition("persistent.boss_unlocked")

    gallery.button("Test2")
    gallery.image("office_PP.jpg")
    gallery.condition("persistent.bottom_unlocked")
screen illustrations1:
    tag menu
    hbox:
        xalign 0.5
        yalign 0.5
        spacing 80
        grid 3 2:
            add gallery.make_button(name="boss", unlocked="office_boss_mini.png", locked="Lock_mini.png")
            add gallery.make_button(name="Test2", unlocked="office_PP_mini.png", locked="Lock_mini.png")
            add gallery.make_button(name="Test2", unlocked="Chibi_Alex.png", locked="Lock_mini.png")
            add gallery.make_button(name="Test2", unlocked="Chibi_Alex.png",locked="Lock_mini.png")
            add gallery.make_button(name="Test2", unlocked="Chibi_Alex.png", locked="Lock_mini.png")
            add gallery.make_button(name="Test2", unlocked="Chibi_Alex.png", locked="Lock_mini.png")
I precise that "Lock_mini.png" indeed exists. The images don't want to lock, even though I already tried to lock them in the first place (I also precise that everything is well indented). Can someone please help?

Oceane_Kudo
Newbie
Posts: 2
Joined: Tue Mar 22, 2022 5:09 am
Deviantart: TheXlize
Contact:

Re: [SOLVED] Images in gallery that don't lock

#2 Post by Oceane_Kudo » Mon Sep 19, 2022 4:56 pm

I figured out on my own. What you have to do is that at some point you have to run your script with « $ persistent.boss_unlocked = False » so it will lock your image again. Then you can erase «$ persistent.boss_unlocked = False» to definitely lock it (it won't unlock you image again). Then you can put your «$ persistent.boss_unlocked = True» somewhere else.

Just so everyone knows, you can call the «persistent» thing however you want so «persistent.whetever_name = True/False»

Post Reply

Who is online

Users browsing this forum: No registered users