This has been driving me a bit mad and I'm not sure what the issue is. I wanted to clean up my 'game' folder by organizing all my assets into sub-folders (images/sprites, audio/music, fonts, ect). My game was working fine before but I thought this would be easier to manage and look nicer as the assets are really starting to pile up. I have no idea what I am doing wrong but my attempts to organize the files seems to have broken my entire game and I wonder if I should just go back to being disorganized but functional.
I've looked at multiple tutorials and thought I had figured it out. What is driving me mad is that the game seems to be picking and choosing when it works and when it doesn't work.
For example, I organized the 'image' folder into subfolders 'sprites' and 'bgs.' At first this didn't work at all and Renpy couldn't find any of the images, but I heard this was something built ready-made into the program. Then bam, randomly it started working and it was loading sprites and bgs just fine without me having to do anything extra. Then suddenly it decided it no longer wanted to find certain bgs to the point it wouldn't load anything. (Like I would try and skip past the scene it was failing to load since I was troubleshooting something else but it wouldn't even let me go to a different scene that didn't use the image).
This particular bg is attached to an animation so I wondered if that was why? But then I don't understand why Renpy can't find the file as normal since it's called in the same way either way.
Code: Select all
I'm sorry, but an uncaught exception occurred.
While loading <'Image' 'Hall Lab Close.jpg'>:
File "game/d route.rpy", line 548, in script
show mal with hpunch
IOError: Couldn't find file 'Hall Lab Close.jpg'.
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/d route.rpy", line 548, in script
show mal with hpunch
File "/Applications/renpy-7.3.5-sdk/renpy/ast.py", line 1389, in execute
renpy.exports.with_statement(trans, paired)
File "/Applications/renpy-7.3.5-sdk/renpy/exports.py", line 1601, in with_statement
return renpy.game.interface.do_with(trans, paired, clear=clear)
File "/Applications/renpy-7.3.5-sdk/renpy/display/core.py", line 2251, in do_with
clear=clear)
File "/Applications/renpy-7.3.5-sdk/renpy/display/core.py", line 2702, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
File "/Applications/renpy-7.3.5-sdk/renpy/display/core.py", line 3194, in interact_core
self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
File "/Applications/renpy-7.3.5-sdk/renpy/display/core.py", line 2094, in draw_screen
renpy.config.screen_height,
File "renpy/display/render.pyx", line 490, in renpy.display.render.render_screen (gen/renpy.display.render.c:6805)
rv = render(root, width, height, st, st)
File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen/renpy.display.render.c:3520)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-7.3.5-sdk/renpy/display/layout.py", line 722, in render
surf = render(child, width, height, cst, cat)
File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen/renpy.display.render.c:4075)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen/renpy.display.render.c:3520)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-7.3.5-sdk/renpy/display/motion.py", line 179, in render
child = render(self.child, width, height, st, at)
File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen/renpy.display.render.c:4075)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen/renpy.display.render.c:3520)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-7.3.5-sdk/renpy/display/layout.py", line 722, in render
surf = render(child, width, height, cst, cat)
File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen/renpy.display.render.c:4075)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen/renpy.display.render.c:3520)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-7.3.5-sdk/renpy/display/layout.py", line 722, in render
surf = render(child, width, height, cst, cat)
File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen/renpy.display.render.c:4075)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen/renpy.display.render.c:3520)
rv = d.render(widtho, heighto, st, at)
File "accelerator.pyx", line 110, in renpy.display.accelerator.transform_render
File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen/renpy.display.render.c:3520)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-7.3.5-sdk/renpy/display/image.py", line 500, in render
return wrap_render(self.target, width, height, st, at)
File "/Applications/renpy-7.3.5-sdk/renpy/display/image.py", line 306, in wrap_render
rend = render(child, w, h, st, at)
File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen/renpy.display.render.c:4075)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen/renpy.display.render.c:3520)
rv = d.render(widtho, heighto, st, at)
File "accelerator.pyx", line 110, in renpy.display.accelerator.transform_render
File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen/renpy.display.render.c:3520)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-7.3.5-sdk/renpy/display/im.py", line 583, in render
return cache.get(self, render=True)
File "/Applications/renpy-7.3.5-sdk/renpy/display/im.py", line 266, in get
surf = image.load()
File "/Applications/renpy-7.3.5-sdk/renpy/display/im.py", line 628, in load
surf = renpy.display.pgrender.load_image(renpy.loader.load(self.filename), self.filename)
File "/Applications/renpy-7.3.5-sdk/renpy/loader.py", line 576, in load
raise IOError("Couldn't find file '%s'." % name)
IOError: Couldn't find file 'Hall Lab Close.jpg'.
Darwin-17.7.0-x86_64-i386-64bit
Ren'Py 7.3.5.606
Perchance to Dream 1.0
Fri Aug 12 08:25:37 2022
Code: Select all
define gui.name_text_font = "fonts/whitrabt.ttf"
Code: Select all
define fema = Character("Fema", color="779ed1", what_slow_cps=80, what_font="fonts/Hhenum-Regular.otf")
Code: Select all
n "{font=fonts/LongCang-Regular.ttf}{b}Why didn't you?{/b}{/font}"
Code: Select all
fema "You'll get to be the first {font=whitrabt.ttf}person{/font} ever to experience {font=whitrabt.ttf}artificial{/font} life!"
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/d route.rpy", line 594, in script
fema "You'll get to be the first {font=whitrabt.ttf}person{/font} ever to experience {font=whitrabt.ttf}artificial{/font} life!"
Exception: Could not find font u'whitrabt.ttf'.
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/d route.rpy", line 594, in script
fema "You'll get to be the first {font=whitrabt.ttf}person{/font} ever to experience {font=whitrabt.ttf}artificial{/font} life!"
File "/Applications/renpy-7.3.5-sdk/renpy/ast.py", line 708, in execute
renpy.exports.say(who, what, *args, **kwargs)
File "/Applications/renpy-7.3.5-sdk/renpy/exports.py", line 1345, in say
who(what, *args, **kwargs)
File "/Applications/renpy-7.3.5-sdk/renpy/character.py", line 1142, in __call__
self.do_display(who, what, cb_args=self.cb_args, **display_args)
File "/Applications/renpy-7.3.5-sdk/renpy/character.py", line 842, in do_display
**display_args)
File "/Applications/renpy-7.3.5-sdk/renpy/character.py", line 591, in display_say
rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
File "/Applications/renpy-7.3.5-sdk/renpy/ui.py", line 297, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "/Applications/renpy-7.3.5-sdk/renpy/display/core.py", line 2702, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
File "/Applications/renpy-7.3.5-sdk/renpy/display/core.py", line 3194, in interact_core
self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
File "/Applications/renpy-7.3.5-sdk/renpy/display/core.py", line 2094, in draw_screen
renpy.config.screen_height,
File "renpy/display/render.pyx", line 490, in renpy.display.render.render_screen (gen/renpy.display.render.c:6805)
rv = render(root, width, height, st, st)
File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen/renpy.display.render.c:3520)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-7.3.5-sdk/renpy/display/layout.py", line 722, in render
surf = render(child, width, height, cst, cat)
File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen/renpy.display.render.c:4075)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen/renpy.display.render.c:3520)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-7.3.5-sdk/renpy/display/layout.py", line 722, in render
surf = render(child, width, height, cst, cat)
File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen/renpy.display.render.c:4075)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen/renpy.display.render.c:3520)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-7.3.5-sdk/renpy/display/layout.py", line 722, in render
surf = render(child, width, height, cst, cat)
File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen/renpy.display.render.c:4075)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen/renpy.display.render.c:3520)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-7.3.5-sdk/renpy/display/screen.py", line 675, in render
child = renpy.display.render.render(self.child, w, h, st, at)
File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen/renpy.display.render.c:4075)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen/renpy.display.render.c:3520)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-7.3.5-sdk/renpy/display/layout.py", line 722, in render
surf = render(child, width, height, cst, cat)
File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen/renpy.display.render.c:4075)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen/renpy.display.render.c:3520)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-7.3.5-sdk/renpy/display/layout.py", line 1127, in render
st, at)
File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen/renpy.display.render.c:4075)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen/renpy.display.render.c:3520)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-7.3.5-sdk/renpy/display/layout.py", line 722, in render
surf = render(child, width, height, cst, cat)
File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen/renpy.display.render.c:4075)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen/renpy.display.render.c:3520)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-7.3.5-sdk/renpy/text/text.py", line 1996, in render
virtual_layout = Layout(self, width, height, renders, drawable_res=False, size_only=True)
File "/Applications/renpy-7.3.5-sdk/renpy/text/text.py", line 626, in __init__
glyphs = ts.glyphs(s, self)
File "/Applications/renpy-7.3.5-sdk/renpy/text/text.py", line 242, in glyphs
fo = font.get_font(self.font, self.size, self.bold, self.italic, 0, self.antialias, self.vertical, self.hinting, layout.oversample)
File "/Applications/renpy-7.3.5-sdk/renpy/text/font.py", line 699, in get_font
face = load_face(fn)
File "/Applications/renpy-7.3.5-sdk/renpy/text/font.py", line 640, in load_face
raise Exception("Could not find font {0!r}.".format(orig_fn))
Exception: Could not find font u'whitrabt.ttf'.
Darwin-17.7.0-x86_64-i386-64bit
Ren'Py 7.3.5.606
Perchance to Dream 1.0
Fri Aug 12 08:31:57 2022
Another thing I've tried and failed at is to define file routes separately to make it easier:
Code: Select all
define hhenum = "fonts/Hhenum-Regular.otf"
define white_rabbit = "fonts/whitrabt.ttf"
define long_cang = "fonts/LongCang-Regular.ttf"
Code: Select all
#Music
define moderato = "audio/music/Z/Moderato in G Minor.mp3"
I also thought that maybe
"define config.searchpath = [ ‘common’, ‘game’ ]"
https://www.renpy.org/doc/html/config.h ... searchpath
could work as I understand it allows you to set your own directories? But I admit I don't know enough about coding to understand it. If someone could explain it to me and if that is even a solution to my problems then I would be very thankful since I can't find much about this function on my own.
Anyways part of me is saying just screw it and go back to my disorganized but functional life but I just can't believe this is as complicated as it seems....there must be something I don't understand?? Anyways appreciate any help before I throw in the towel.
(I did my best to try and explain the issues but I can provide more if needed since it's like...an all-encompassing issue so it's hard to know how much to share to be helpful. Thank you!)