Ren'Py New images not being found [SOLVED]

cupofteat

Member
Nov 21, 2019
134
230
Hope some wise sage will be able to give some advice on the problem I'm facing. I've tried searching extensively but maybe I'm alone here?

I'm currently modding a game and adding a gallery mode.

I have created a new directory, gallery, inside game/images, and this all works when launching with the Renpy Launcher. But when I produce a distribution (Windows in this case), I get the following error:

Python:
While loading <'Image' u'images/gallery/gallery bg.png'>:
IOError: Couldn't find file 'images/gallery/gallery bg.png'.
I noticed that when the archive is created, and subsequently extracted, I notice the folder is not being included.

In options.rpy I have:

Python:
build.classify('game/**.png', 'archive')
And it's being called within gallery1.rpy

Python:
screen cg_gallery_01():
    # Ensure this replaces the main menu.
    tag menu
    # The background.
    image "images/gallery/gallery bg.png"
    #add "images/gallery/gallery bg.png"
edit: corrected typo in extensions from .py to .rpy, formatting.
 
Last edited:

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,581
2,219
Something else is going on.

I just recreated what you've included in this post. A build.classify('game/**.png', 'archive') in options.rpy and a file called /game/images/gallery/gallery bg.png (including the space within the filename).

I built my test project and unpacked it with UnRen. There was no error when I did the build and the file was there when I unpacked it using UnRen.

Even if the image file was named wrongly, it should still build and include that folder/file.

I'm still building with 7.3.5 - so maybe that's it?

The only obvious point is that RenPy filenames are called *.rpy, not *.py. But I assume that is a typo on your part. However, if it is out of habit - maybe that habit extends to when you created your extra files? Though I don't see how you could have tested anything before the build process if you'd named the files wrongly.

Your image line looks wrong within the screen. There isn't an image statement as part of RenPy's . The commented out line of add is how you include an image by name. I can see how that might impact the build - but honestly I'd again expect problems testing before you got anywhere near the build process.

I don't want to be the "it's working for me" guy. But the information provided (baring typos) shouldn't give the problems you're describing. I can only guess there's something else going on, either more build.classify() lines that are accidentally tagging files as "None" or something else. Unfortunately the "something else" would require a crystal ball or a lot more detailed information.

This is my version of that section of the options.rpy file:
You don't have permission to view the spoiler content. Log in or register now.
 
Last edited:

cupofteat

Member
Nov 21, 2019
134
230
Something else is going on.
*snip*
Thanks for the detailed reply and going through the effort to test. You're correct that was a typo on my behalf, script files are using the .rpy extension.

The commented out text using the add call is what I've been using, but both seem to be working (when using Renpy Launcher) in this case.

I've tried using two different versions (6 & current) of the Launcher with the same results. It's really driving me a bit mad at this point.

Thanks for taking the time and appreciate your input 79flavors.
 

cupofteat

Member
Nov 21, 2019
134
230
So interestingly enough, I did a copy-pasta of your build.classify code, and wallah - it works! Strange that I don't understand what is really different in terms of the inclusion of images and folders. But I won't question the magic. Thanks 79flavors

I still can't get the icons to work, but that doesn't really concern me (yet). Maybe a thread for another day.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,581
2,219
So interestingly enough, I did a copy-pasta of your build.classify code, and wallah - it works! Strange that I don't understand what is really different in terms of the inclusion of images and folders. But I won't question the magic. Thanks 79flavors

I still can't get the icons to work, but that doesn't really concern me (yet). Maybe a thread for another day.

Yup. That will fall into the "something else" category.


Icons... there are lots.

The icon displayed in the corner of the game's window (and on the taskbar while the game is running) is part of the options.rpy file.
define config.window_icon = "gui/window_icon.png"

Details here:



The icon that becomes part of the executable (the icon shown when you see the .exe in the folder using Windows Explorer) is a special format. You place this special file in the game's project folder (the parent of /game/).

icon.ico is for Windows.
icon.icns is for the Mac.

It should be noted that using the icon.ico on Windows often leads to false positive antivirus problems. imo, it's not worth the extra hassle.

Details (and a link to a website that can convert .png files to these formats) here:



Similarly, Android has specially named (and sized) files for it's icons. It uses both a foreground and background image to allow for a bit of a 3rd feel when the icons are dragged around and other times.

Android can also show a full screen "pre-splash" image while the game is being loaded. It's shown immediately the game is started and stays on screen until the "real" game actually starts. Useful of slower/older devices. Actually useful on newer ones too.
Details here:
 
  • Red Heart
Reactions: cupofteat

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,581
2,219
Do you have a copy of the full options.rpy file before you fixed it?

I'm wondering if we can figure out what was actually wrong with it.
I appreciate knowing makes no difference that this point to your code. I'm just curious for my own sake.
 

cupofteat

Member
Nov 21, 2019
134
230
Sure no worries. I didn't delete anything, the only changes I've made to the original is commenting out the old build.classify calls and pasting in your example from yesterday down the very bottom of the file.