So, I am still a newbie and still struggling with Ren'Py...
I have this issue when implementing other gallery codes I've found out there. I have tried several but none have worked perfectly as of yet. The last one I implemented was this one right in this post: viewtopic.php?f=8&t=48056 with some tips from gas' gallery: viewtopic.php?t=50040
The problem lies in the definition of gallery buttons, or that's what Ren'Py says anyway
The following error occurs:
File "renpy/common/00gallery.rpy", line 330, in Action
raise Exception("{0!r} is not a button defined in this gallery.".format(name))
Exception: u'cg1button' is not a button defined in this gallery.
And this is my gallery code:
Code: Select all
init -1:
image cg1 = "images/cg1.png"
image cg2 = "images/cg2.png"
image cg3 = "images/cg3.png"
image cg4 = "images/cg4.png"
image cgk1 = "images/cgk1.png"
init python:
g = Gallery()
g.button("cg1button")
g.image("cg1")
g.unlock("cg1")
g.transition = dissolve
g.button("cg2button")
g.image("cg2")
g.unlock("cg2")
g.transition = dissolve
g.button("cg3button")
g.image("cg3")
g.unlock("cg3")
g.transition = dissolve
g.button("cg4button")
g.image("cg4")
g.unlock("cg4")
g.transition = dissolve
g.button("cgk1button")
g.image("cgk1")
g.unlock("cgk1")
g.transition = dissolve
g.locked_button=("gui/locked_cg.png")
screen cg_gallery():
tag menu
add "gui/gallery_background.png"
add "gui/gallery_title.png" xalign 0.5 yalign 0.1
vbox:
imagebutton auto "gui/gallery/knight_%s.png" xpos 210 ypos 270 action SetScreenVariable("curpage", "knight_cg") alt _("Main Gallery")
imagebutton auto "gui/gallery/prince_%s.png" xpos 210 ypos 270 action SetScreenVariable("curpage", "prince_cg") alt _("Sean's Gallery")
imagebutton auto "gui/gallery/cook_%s.png" xpos 210 ypos 270 action SetScreenVariable("curpage", "cook_cg") alt _("Sean's Gallery")
imagebutton auto "gui/gallery/extras_%s.png" xpos 210 ypos 270 action SetScreenVariable("curpage", "extras_cg") alt _("Sean's Gallery")
spacing 10
vbox:
imagebutton auto "gui/return_save_%s.png" xpos 160 ypos 950 action Return()
grid 2 3:
xfill True
yfill True
style_prefix "gslot"
xalign 0.5
yalign 0.5
spacing 30
add g.make_button("cg1button", "images/cg1_thumb.png")
add g.make_button("cg2button", "images/cg2_thumb.png")
add g.make_button("cg3button", "images/cg3_thumb.png")
add g.make_button("cg4button", "images/cg4_thumb.png")
null
null
style gslot:
xsize 256
ysize 144
I really don't know what I'm doing wrong
Thanks in advance!