Sorry but I am still having the same problem as Riku and Kindydos did:
I'm sorry, but an uncaught exception occurred.
While executing init code:
File "game/screens.rpy", line 567, in script
File "game/screens.rpy", line 570, in python
Exception: Expected an image, but got a general displayable.
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "E:\renpy-6.13.12\renpy\execution.py", line 265, in run
File "E:\renpy-6.13.12\renpy\ast.py", line 632, in execute
File "E:\renpy-6.13.12\renpy\python.py", line 972, in py_exec_bytecode
File "game/screens.rpy", line 570, in <module>
File "E:\renpy-6.13.12\renpy\display\im.py", line 607, in __init__
File "E:\renpy-6.13.12\renpy\display\im.py", line 1500, in image
File "E:\renpy-6.13.12\renpy\display\im.py", line 1515, in image
Exception: Expected an image, but got a general displayable.
Windows-7-6.1.7601-SP1
Ren'Py 6.13.12.1728
A Ren'Py Game 0.0
lines 567 to 570:
Code: Select all
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_cg_items:
renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
I replaced "cg1", "cg2" with my own images and also deleted all the lines that include the word bg
Here is the entire code that I copy pasted and edited:
Code: Select all
init python:
#Galleries settings - start
#list the CG gallery images here:
gallery_cg_items = ["kyandere", "kaisleep", "oni"]
#how many rows and columns in the gallery screens?
gal_rows = 3
gal_cols = 3
#thumbnail size in pixels:
thumbnail_x = 267
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 gal_item in gallery_cg_items:
g_cg.button(gal_item + " butt")
g_cg.image(gal_item)
g_cg.unlock(gal_item)
g_cg.transition = fade
cg_page=0
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_cg_items:
renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
screen cg_gallery:
tag menu
use navigation
frame background None xpos 10:
grid gal_rows gal_cols:
ypos 10
$ i = 0
$ next_cg_page = cg_page + 1
if next_cg_page > int(len(gallery_cg_items)/gal_cells):
$ next_cg_page = 0
for gal_item in gallery_cg_items:
$ i += 1
if i <= (cg_page+1)*gal_cells and i>cg_page*gal_cells:
add g_cg.make_button(gal_item + " butt", gal_item + " butt", im.Scale("gallocked.png", thumbnail_x, thumbnail_y), xalign=0.5, yalign=0.5, idle_border=None, background=None, bottom_margin=24)
for j in range(i, (cg_page+1)*gal_cells): #we need this to fully fill the grid
null
frame:
yalign 0.97
vbox:
if len(gallery_cg_items)>gal_cells:
textbutton _("Next Page") action [SetVariable('cg_page', next_cg_page), ShowMenu("cg_gallery")]
I didn't really understand Kindydos's solution and I don't wanna have to download "All-In-One RenPy Framework" just for a cg gallery so please help and sorry for being such a bother...