- Oct 14, 2021
- 626
- 2,808
I am trying to create a gallery of bonus scenes which a player unlocks by completing each of eight parts in the game. Taking baby steps, before I try to add the actual scenes I'm just trying to get simple images to unlock. But I am failing. Here is my code:
I'm using the bonus1 image as my testing image. I've set the
value in the code at the end of Part One of my script and played through it (multiple times). But there is no change in my gallery screen. I'm not sure if the first image is supposed to change automatically to the unlocked image or if I'm supposed to click on it to show the unlocked image. But either way, I still just get the locked image (labeled "Part One" below).
Can anyone help?
Code:
init python:
gallery = Gallery()
gallery.button("bonus1")
gallery.condition("persistent.unlock_1")
gallery.unlock_image("images/other/1-5.jpg")
gallery.button("bonus2")
gallery.condition("persistent.unlock_2")
gallery.unlock_image("bonus2")
gallery.button("bonus3")
gallery.condition("persistent.unlock_3")
gallery.unlock_image("bonus3")
gallery.button("bonus4")
gallery.condition("persistent.unlock_4")
gallery.unlock_image("bonus4")
gallery.button("bonus5")
gallery.condition("persistent.unlock_5")
gallery.unlock_image("bonus5")
gallery.button("bonus6")
gallery.condition("persistent.unlock_6")
gallery.unlock_image("bonus6")
gallery.button("bonus7")
gallery.condition("persistent.unlock_7")
gallery.unlock_image("bonus7")
gallery.button("bonus8")
gallery.condition("persistent.unlock_8")
gallery.unlock_image("bonus8")
screen gallery:
tag menu
hbox:
xalign 0.5
yalign 0.5
spacing 30
grid 4 2:
add gallery.make_button(name="bonus1",unlocked="images/s1_1/1-5.jpg", locked="images/other/gallery_lock1.jpg")
add gallery.make_button(name="bonus2",unlocked="1-6", locked="images/other/gallery_lock2.jpg")
add gallery.make_button(name="bonus3",unlocked="1-7", locked="images/other/gallery_lock3.jpg")
add gallery.make_button(name="bonus4",unlocked="1-8", locked="images/other/gallery_lock4.jpg")
add gallery.make_button(name="bonus1",unlocked="1-9", locked="images/other/gallery_lock5.jpg")
add gallery.make_button(name="bonus2",unlocked="1-10", locked="images/other/gallery_lock6.jpg")
add gallery.make_button(name="bonus3",unlocked="1-11", locked="images/other/gallery_lock7.jpg")
add gallery.make_button(name="bonus4",unlocked="1-12", locked="images/other/gallery_lock8.jpg")
spacing 15
textbutton "Return" action Return()
Code:
$ persistent.unlock_1 = True
Can anyone help?