So I've got my very own CG gallery to work and it is wonderful. I have the first image locked when you open the game, then when you hit start after some dialogue the image is unlocked. Then you save the game, exit said game to the main menu, and peek into the cg gallery and there it is! Unlocked, accessible, just the way I like it.
Then I close the launcher, re-open it, and bam, it's locked again. I don't know if I'm using persistent data correctly or not, but I thought I was seeing as how it seems to save as I want it to up until the launcher closes...
Any ideas?
This is my code (and I'm sure it's terribly inelegant but it functions and I understand it, so...) we're looking at the img01 variable in particular.
In Screens:
Code: Select all
# CG Gallery
init:
$ gal_page = 1 #the page you begin on
#page 1
$ persistent.galimg01 = False
$ galimg02 = False
$ galimg03 = False
ETC. ....
....
if(gal_page == 1): #check to see what page to show
if(persistent.galimg01): #check to see if we should show the image or not
imagemap:
ground "gui/gallery/thumbnail/thumb01.png" #ground and idle can be the same
idle "gui/gallery/thumbnail/thumb01.png"
hover "gui/gallery/thumbnail/thumb01hov.png"
cache False
hotspot (32,170,200,201) action (SetVariable("star_image", gal1), ShowMenu("galleryfs")) activate_sound "sfx/menu/select.mp3" hover_sound "sfx/menu/hover.mp3"
Code: Select all
mc "Let's see if I can unlock an image in the image gallery now."
$ persistent.galimg01 = True
mc "Okay! Let's see how this works!"