Uhm hi! so I have a little problem--
I've read through the comments before finally decided to post a reply here.
first, here's the error:
Code: Select all
I'm sorry, but an uncaught exception occurred.
While executing init code:
File "game/gallery.rpy", line 36, in script
File "game/gallery.rpy", line 40, in python
Exception: Expected an image, but got a general displayable.
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "C:\Users\mmmkay\Desktop\renpy\renpy-6.16.3-sdk\renpy\bootstrap.py", line 265, in bootstrap
renpy.main.main()
File "C:\Users\mmmkay\Desktop\renpy\renpy-6.16.3-sdk\renpy\main.py", line 263, in main
game.context().run(node)
File "C:\Users\mmmkay\Desktop\renpy\renpy-6.16.3-sdk\renpy\execution.py", line 288, in run
node.execute()
File "C:\Users\mmmkay\Desktop\renpy\renpy-6.16.3-sdk\renpy\ast.py", line 720, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Users\mmmkay\Desktop\renpy\renpy-6.16.3-sdk\renpy\python.py", line 1304, in py_exec_bytecode
exec bytecode in globals, locals
File "game/gallery.rpy", line 40, in <module>
renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
File "C:\Users\mmmkay\Desktop\renpy\renpy-6.16.3-sdk\renpy\display\im.py", line 641, in __init__
im = image(im)
File "C:\Users\mmmkay\Desktop\renpy\renpy-6.16.3-sdk\renpy\display\im.py", line 1534, in image
return image(arg.target, loose=loose, **properties)
File "C:\Users\mmmkay\Desktop\renpy\renpy-6.16.3-sdk\renpy\display\im.py", line 1549, in image
raise Exception("Expected an image, but got a general displayable.")
Exception: Expected an image, but got a general displayable.
Windows-Vista-6.0.6001-SP1
Ren'Py 6.16.3.502
Fetish 2.0
here's the line 40:
Code: Select all
for gal_item in gallery_cg_items:
renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
but if I replace the original code with this (temporarily):
Code: Select all
for gal_item in gallery_cg_items:
renpy.image (gal_item + " butt", im.Scale("lockedcg.png", thumbnail_x, thumbnail_y))
IT WORKS! Although there's no thumbnail of my CGs, and shows the lockedcg.png image instead.
lockedcg.png by the way is my image during the time all CGs are still locked. In original code, it's the
gallocked.png right?
but I always get an error when I use the original code. >A<
here's my full code:
Code: Select all
##############################################################################
# CG Gallery
screen cg_gallery:
tag menu
init python:
#Galleries settings - start
#list the CG gallery images here:
gallery_cg_items = ["bg doll close", "cg1"]
#how many rows and columns in the gallery screens?
gal_rows = 3
gal_cols = 4
#thumbnail size in pixels:
thumbnail_x = 140
thumbnail_y = 106
#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)
if gal_item == "bg doll close":
g_cg.image("bg doll open")
g_cg.unlock("bg doll open")
g_cg.transition = dissolve
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("lockedcg.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")]
so yeah, my main problem is the common error I think everyone got at the
Code: Select all
for gal_item in gallery_cg_items:
renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
I've been browsing this thread over and over again but my problem isn't fixed.
though I somehow managed to partially make it work, no thumbnails are shown and the same old error pops out.
i feel stupid. OTL
thank you for your help in advance. >A<