Thanks for the help. I changed my character variable to something new. But now I am getting this error.
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/gallery.rpy", line 49, in execute
screen gallery_a():
File "game/gallery.rpy", line 49, in execute
screen gallery_a():
File "game/gallery.rpy", line 63, in execute
showif cg_page_a == 1:
File "game/gallery.rpy", line 64, in execute
grid 2 2:
File "game/gallery.rpy", line 69, in execute
add g.make_button("Button", "images/Next.png", "images/Next.png")
File "renpy/common/00gallery.rpy", line 382, in make_button
action = self.Action(name)
File "renpy/common/00gallery.rpy", line 335, in Action
raise Exception("{0!r} is not a button defined in this gallery.".format(name))
Exception: u'Button' is not a button defined in this gallery.
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script
python hide:
File "D:\Game Development\Renpy\renpy-7.3.0-sdk\renpy\ast.py", line 912, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "D:\Game Development\Renpy\renpy-7.3.0-sdk\renpy\python.py", line 2004, in py_exec_bytecode
exec bytecode in globals, locals
File "renpy/common/_layout/screen_main_menu.rpym", line 28, in <module>
python hide:
File "renpy/common/_layout/screen_main_menu.rpym", line 35, in _execute_python_hide
ui.interact()
File "D:\Game Development\Renpy\renpy-7.3.0-sdk\renpy\ui.py", line 295, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "D:\Game Development\Renpy\renpy-7.3.0-sdk\renpy\display\core.py", line 2699, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
File "D:\Game Development\Renpy\renpy-7.3.0-sdk\renpy\display\core.py", line 3091, in interact_core
root_widget.visit_all(lambda i : i.per_interact())
File "D:\Game Development\Renpy\renpy-7.3.0-sdk\renpy\display\core.py", line 541, in visit_all
d.visit_all(callback, seen)
File "D:\Game Development\Renpy\renpy-7.3.0-sdk\renpy\display\core.py", line 541, in visit_all
d.visit_all(callback, seen)
File "D:\Game Development\Renpy\renpy-7.3.0-sdk\renpy\display\core.py", line 541, in visit_all
d.visit_all(callback, seen)
File "D:\Game Development\Renpy\renpy-7.3.0-sdk\renpy\display\core.py", line 541, in visit_all
d.visit_all(callback, seen)
File "D:\Game Development\Renpy\renpy-7.3.0-sdk\renpy\display\screen.py", line 430, in visit_all
callback(self)
File "D:\Game Development\Renpy\renpy-7.3.0-sdk\renpy\display\core.py", line 3091, in <lambda>
root_widget.visit_all(lambda i : i.per_interact())
File "D:\Game Development\Renpy\renpy-7.3.0-sdk\renpy\display\screen.py", line 440, in per_interact
self.update()
File "D:\Game Development\Renpy\renpy-7.3.0-sdk\renpy\display\screen.py", line 625, in update
self.screen.function(**self.scope)
File "game/gallery.rpy", line 49, in execute
screen gallery_a():
File "game/gallery.rpy", line 49, in execute
screen gallery_a():
File "game/gallery.rpy", line 63, in execute
showif cg_page_a == 1:
File "game/gallery.rpy", line 64, in execute
grid 2 2:
File "game/gallery.rpy", line 69, in execute
add g.make_button("Button", "images/Next.png", "images/Next.png")
File "<screen language>", line 69, in <module>
File "renpy/common/00gallery.rpy", line 382, in make_button
action = self.Action(name)
File "renpy/common/00gallery.rpy", line 335, in Action
raise Exception("{0!r} is not a button defined in this gallery.".format(name))
Exception: u'Button' is not a button defined in this gallery.
Windows-8-6.2.9200
Ren'Py 7.3.2.320
Pure Love 0.1
Sat Sep 21 16:33:46 2019
This is my code:-
Code: Select all
#screen gallery: tag menu add "black"
###############################################################################################################################################
## Copy/Paste And Follow Instructions!
## DONT forget to define your CG's used in the gallery, like said at the very top of the Tutorial!
###############################################################################################################################################
####################################################################################
## Button to Copy/Paste into the Main Menu in screeny.rpy into the right place. No Edits Necsassary.
####################################################################################
#textbutton _("Gallery") action [ShowMenu("gallery_navigation"), Show("gallery_a")]
####################################################################################
## Gallery Elements and Gallerys. Copy/Paste this at the end of screens.rpy
####################################################################################
init python:
g = Gallery()
## Edit this with your stuff and create the rest according to tutorial.
g.button("Button_Name")
g.unlock_image("CG_Image")
g.transition = dissolve
screen gallery():
## Change with your image
add "bg_gallery"
vbox:
style_prefix "gallery_nav"
## Gallery Navigation to Character A, Character B and Character C gallery.
textbutton _("char1") action Show("gallery_a")
textbutton _(" char2") action Show("gallery_b")
textbutton _(" char3") action Show("gallery_c")
textbutton _("char4") action Show("gallery_d")
textbutton _("char5") action Show("gallery_e")
textbutton _("Return") action [Return(), Hide("gallery")] xalign 0.97 yalign 0.95
## The position of the vertical box containing the gallery navigation buttons
style gallery_nav_vbox:
xalign 0.5
yalign 0.5
spacing 100
screen gallery_a():
default cg_page_a = 1
zorder 100
tag menu
hbox:
style_prefix "gallery_stuff"
## Our buttons for the pages of Character A's Gallery section.
textbutton _("1") action SetLocalVariable("cg_page_a", 1)
textbutton _("2") action SetLocalVariable("cg_page_a", 2)
showif cg_page_a == 1:
grid 2 2:
style_prefix "gallery_stuff"
## Replace one null with one button created according to this structure:
## add g.make_button("CG_Button_Name", "path/Unlocked_Thumbnail.png", "path/Locked_Thumbnail.png")
add g.make_button("Button", "images/Next.png", "images/Next.png")
null
null
null
elif cg_page_a == 2:
grid 2 2:
style_prefix "gallery_stuff"
## Replace one null with one button created according to this structure:
## add g.make_button("CG_Button_Name", "path/Unlocked_Thumbnail.png", "path/Locked_Thumbnail.png")
null
null
null
null
screen gallery_b():
default cg_page_b = 1
zorder 100
tag menu
hbox:
style_prefix "gallery_stuff"
## Our buttons for the pages of Character B's Gallery section.
textbutton _("1") action SetLocalVariable("cg_page_b", 1)
textbutton _("2") action SetLocalVariable("cg_page_b", 2)
showif cg_page_b == 1:
grid 2 2:
style_prefix "gallery_stuff"
## Replace one null with one button created according to this structure:
## add g.make_button("CG_Button_Name", "path/Unlocked_Thumbnail.png", "path/Locked_Thumbnail.png")
null
null
null
null
elif cg_page_b == 2:
grid 2 2:
style_prefix "gallery_stuff"
## Replace one null with one button created according to this structure:
## add g.make_button("CG_Button_Name", "path/Unlocked_Thumbnail.png", "path/Locked_Thumbnail.png")
null
null
null
null
screen gallery_c():
default cg_page_c = 1
zorder 100
tag menu
hbox:
style_prefix "gallery_stuff"
## Our buttons for the pages of Character C's Gallery section.
textbutton _("1") action SetLocalVariable("cg_page_c", 1)
textbutton _("2") action SetLocalVariable("cg_page_c", 2)
showif cg_page_c == 1:
grid 2 2:
style_prefix "gallery_stuff"
## Replace one null with one button created according to this structure:
## add g.make_button("CG_Button_Name", "path/Unlocked_Thumbnail.png", "path/Locked_Thumbnail.png")
null
null
null
null
elif cg_page_c == 2:
grid 2 2:
style_prefix "gallery_stuff"
## Replace one null with one button created according to this structure:
## add g.make_button("CG_Button_Name", "path/Unlocked_Thumbnail.png", "path/Locked_Thumbnail.png")
null
null
null
null
screen gallery_d():
default cg_page_d = 1
zorder 100
tag menu
hbox:
style_prefix "gallery_stuff"
## Our buttons for the pages of Character d's Gallery section.
textbutton _("1") action SetLocalVariable("cg_page_d", 1)
textbutton _("2") action SetLocalVariable("cg_page_d", 2)
showif cg_page_d == 1:
grid 2 2:
style_prefix "gallery_stuff"
## Replace one null with one button created according to this structure:
## add g.make_button("CG_Button_Name", "path/Unlocked_Thumbnail.png", "path/Locked_Thumbnail.png")
null
null
null
null
elif cg_page_d == 2:
grid 2 2:
style_prefix "gallery_stuff"
## Replace one null with one button created according to this structure:
## add g.make_button("CG_Button_Name", "path/Unlocked_Thumbnail.png", "path/Locked_Thumbnail.png")
null
null
null
null
screen gallery_e():
default cg_page_e = 1
zorder 100
tag menu
hbox:
style_prefix "gallery_stuff"
## Our buttons for the pages of Character e's Gallery section.
textbutton _("1") action SetLocalVariable("cg_page_e", 1)
textbutton _("2") action SetLocalVariable("cg_page_e", 2)
showif cg_page_e == 1:
grid 2 2:
style_prefix "gallery_stuff"
## Replace one null with one button created according to this structure:
## add g.make_button("CG_Button_Name", "path/Unlocked_Thumbnail.png", "path/Locked_Thumbnail.png")
null
null
null
null
elif cg_page_e == 2:
grid 2 2:
style_prefix "gallery_stuff"
## Replace one null with one button created according to this structure:
## add g.make_button("CG_Button_Name", "path/Unlocked_Thumbnail.png", "path/Locked_Thumbnail.png")
null
null
null
null
## The position of our gallery images.
style gallery_stuff_grid:
xalign 0.5
yalign 0.5
xspacing 20
yspacing 20
## The position of the page-buttons.
style gallery_stuff_hbox:
xalign 0.5
yanchor 0.9
ypos 0.95