My problem so far is having variations of a single CG, and wanting both of them to show up in one thumbnail (aka: 1 thumbnail for CG1, when clicked shows CG1a, clicked again transitions to CG1b, clicked again returns to gallery), or just multiple images of a button as defined in the cookbook.
I've used The quick and easy CG Gallery code here, and read his reply to multiple images here, which didn't do anything.
So I looked up past questions on multiple images and found this thread and attempted to merge it with the quick and easy CG Gallery code, but it's been popping up errors about strings and such and I have no idea where I went wrong.
I'm guessing the issue is defining two images in that [ ] when adding items to the gallery. The code isn't reading it since it's a string.
Here's my code so far:
Code: Select all
init python:
#Galleries settings - start
#list the CG gallery images here:
gallery_Char1cg_items = [["CG1a", "CG1b"], "cg2", "cg3", "cg4", "cg5"]
#how many rows and columns in the gallery screens?
gal_rows = 3
gal_cols = 3
#thumbnail size in pixels:
thumbnail_x = 200
thumbnail_y = 150
#the setting above (267x150) will work well with 16:9 screen ratio. Make sure to adjust it, if your are using 4:3 or something else.
#Galleries settings - end
gal_cells = gal_rows * gal_cols
g_cg = Gallery()
for index, imgList in enumerate(gallery_Char1cg_items):
g_cg.button(str(index) + " butt")
for gal_item in imgList:
if isinstance(gal_item, basestring):
g_cg.unlock(gal_item)
else:
g_cg.unlock(gal_item[0]. gal_item[1])
init +1 python:
#Here we create the thumbnails. We create a grayscale thumbnail image for BGs, but we use a special "locked" image for CGs to prevent spoilers.
for gal_item in gallery_Char1cg_items:
renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
I'm sorry, but an uncaught exception occurred.
While executing init code:
File "game/screens.rpy", line 649, in script
init +1 python:
File "game/screens.rpy", line 655, in <module>
renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
TypeError: can only concatenate list (not "str") to list
Thanks in advance for any help OTL I've been working this code for 10 hours now
EDIT I'm an idiot and forgot to include the codes where the error is popping up OTL