DynamicImage error
Posted: Sun Jun 17, 2018 3:22 pm
Since several of the characters in my game have multiple outfits, I have all their sprites in a standardized naming format and used the DynamicImage function to swap them out with a variable.
So as an example, the character definitions are done like this:
where the "mari_wardrobe" bit is the part that changes in the sprites' filenames.
This works like a charm, but if the player tries to exit to the main menu when one of these characters is on screen then this error pops up:
Does anyone out there know how to get this to stop happening?
So as an example, the character definitions are done like this:
Code: Select all
image mari cross1 = "Full/[mari_wardrobe]_armcross_1.png"
This works like a charm, but if the player tries to exit to the main menu when one of these characters is on screen then this error pops up:
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
Exception: In DynamicImage u'Close/[mari_wardrobe]_default_close_1.png': Could not find substitution 'mari_wardrobe'.
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script
python hide:
File "C:\Users\Zenigame\Desktop\renpy-6.99.1-sdk\renpy\ast.py", line 862, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Users\Zenigame\Desktop\renpy-6.99.1-sdk\renpy\python.py", line 1912, 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 "C:\Users\Zenigame\Desktop\renpy-6.99.1-sdk\renpy\ui.py", line 287, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "C:\Users\Zenigame\Desktop\renpy-6.99.1-sdk\renpy\display\core.py", line 2649, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
File "C:\Users\Zenigame\Desktop\renpy-6.99.1-sdk\renpy\display\core.py", line 3033, in interact_core
root_widget.visit_all(lambda i : i.per_interact())
File "C:\Users\Zenigame\Desktop\renpy-6.99.1-sdk\renpy\display\core.py", line 511, in visit_all
d.visit_all(callback)
File "C:\Users\Zenigame\Desktop\renpy-6.99.1-sdk\renpy\display\core.py", line 511, in visit_all
d.visit_all(callback)
File "C:\Users\Zenigame\Desktop\renpy-6.99.1-sdk\renpy\display\core.py", line 511, in visit_all
d.visit_all(callback)
File "C:\Users\Zenigame\Desktop\renpy-6.99.1-sdk\renpy\display\core.py", line 511, in visit_all
d.visit_all(callback)
File "C:\Users\Zenigame\Desktop\renpy-6.99.1-sdk\renpy\display\core.py", line 511, in visit_all
d.visit_all(callback)
File "C:\Users\Zenigame\Desktop\renpy-6.99.1-sdk\renpy\display\core.py", line 511, in visit_all
d.visit_all(callback)
File "C:\Users\Zenigame\Desktop\renpy-6.99.1-sdk\renpy\display\core.py", line 511, in visit_all
d.visit_all(callback)
File "C:\Users\Zenigame\Desktop\renpy-6.99.1-sdk\renpy\display\core.py", line 511, in visit_all
d.visit_all(callback)
File "C:\Users\Zenigame\Desktop\renpy-6.99.1-sdk\renpy\display\core.py", line 513, in visit_all
callback(self)
File "C:\Users\Zenigame\Desktop\renpy-6.99.1-sdk\renpy\display\core.py", line 3033, in <lambda>
root_widget.visit_all(lambda i : i.per_interact())
File "C:\Users\Zenigame\Desktop\renpy-6.99.1-sdk\renpy\display\image.py", line 726, in per_interact
self.find_target()
File "C:\Users\Zenigame\Desktop\renpy-6.99.1-sdk\renpy\display\image.py", line 618, in find_target
raise Exception("In DynamicImage %r: Could not find substitution '%s'." % (self.name, unicode(ke.args[0])))
Exception: In DynamicImage u'Close/[mari_wardrobe]_default_close_1.png': Could not find substitution 'mari_wardrobe'.