IOError: Couldn't find file

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

IOError: Couldn't find file

#1 Post by ArizaLuca »

So, I'm trying to code a side image, and I wanted to scale it down. I defined the image in Ren'Py before image scaling it (since it's a LIveComposite and CompositeSwitch image), however in the image scaling shortly afterwards this exception popped up:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While loading <'Scale' <'Image' u'ri_side'> 240 360 True>:
  File "game/script.rpy", line 707, in script
    scene cg car nervous
IOError: Couldn't find file 'ri_side'.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 707, in script
    scene cg car nervous
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/ast.py", line 643, in execute
    renpy.exports.say(who, what, interact=self.interact, *args, **kwargs)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/exports.py", line 1176, in say
    who(what, *args, **kwargs)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/character.py", line 1013, in __call__
    self.do_display(who, what, cb_args=self.cb_args, **display_args)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/character.py", line 817, in do_display
    **display_args)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/character.py", line 566, in display_say
    rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/ui.py", line 287, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 2624, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 3098, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 2038, in draw_screen
    renpy.config.screen_height,
  File "render.pyx", line 485, in renpy.display.render.render_screen
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 711, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 711, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 711, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/screen.py", line 639, in render
    child = renpy.display.render.render(self.child, w, h, st, at)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 711, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "accelerator.pyx", line 108, in renpy.display.accelerator.transform_render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/image.py", line 414, in render
    return wrap_render(self.target, width, height, st, at)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/image.py", line 229, in wrap_render
    rend = render(child, w, h, st, at)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/im.py", line 580, in render
    return cache.get(self, render=True)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/im.py", line 266, in get
    surf = image.load()
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/im.py", line 805, in load
    child = cache.get(self.image)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/im.py", line 266, in get
    surf = image.load()
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/im.py", line 625, in load
    surf = renpy.display.pgrender.load_image(renpy.loader.load(self.filename), self.filename)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/loader.py", line 555, in load
    raise IOError("Couldn't find file '%s'." % name)
IOError: Couldn't find file 'ri_side'.

Darwin-17.2.0-x86_64-i386-64bit
Ren'Py 6.99.14.1.3218
PhantasmagoriaHotelDemo 1.0
Fri May 18 10:47:01 2018
Is there a way to fix this? Thanks...

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: IOError: Couldn't find file

#2 Post by kivik »

What's the code for your image declaration?

ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: IOError: Couldn't find file

#3 Post by ArizaLuca »

Ah, never mind! I actually fixed it by LiveCropping the image. (If someone needs me to elaborate, I'll explain in a different post!)

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: IOError: Couldn't find file

#4 Post by kivik »

You can also create a transform and apply it to the image when showing it:

Code: Select all

transform half_size:
    zoom 0.5

...

show eileen at half_size
Remember you can apply multiple transforms:

Code: Select all

show eileen at half_size, left

Post Reply

Who is online

Users browsing this forum: No registered users