Option 1:
Leave all your images called stuff like /prolog/jonas_anruf.png
- even though the actual files are in *.webp
format.
That really depends on your image conversion software. But if you use
Cruncher, here on F95 - it does exactly that. Converts all the file to the new format, but leaves their filenames exactly the same.
(Obviously backup everything beforehand - to avoid potential fuck ups).
Some software would shit itself at that... but not RenPy. It doesn't really care what the file is called, only what the file header says the contents of the file contain.
Option 2:
Probably more like you were expecting... convert all the files to their new format (and new filenames) and then change your code for each file changed from .png
to webp
.
From what I can see in your code, most of your direct references to .png
files are part of image
statements. image
definitions are NOT part of your save file. They are purely a runtime construct. So if you change them between releases, the game won't mind.
If you are using the Atom editor, all you need to do is open the "[Find] -> [Find in Project]" menu (or press the [CTRL+SHIFT+f] shortcut) and do a search and replace.
- Find in Project :
.png
- Replace in Project:
.webp
- File/directory pattern :
*.rpy
- Click [Find All] followed by [Replace All] after you've reviewed the changes.
There may be a few places where you manually need to go back and change the filename back to .png
, depending on which folders you've converted. (I'm thinking the options.rpy
and gui.rpy
files - that use images RenPy created rather than yourself).
Alternatively, don't use the "in project". Instead just use the standard search and replace within each file and pick which files you want to do mass changes for.
As as side note... You have a LOT of unnecessary
image
statements.
You have lines like
image patreon_link = "/patreon_link/patreon_link.png"
.
(Unless you've disabled it) RenPy automatically generates
image
statements for any file stored in the
/images/
folder and its subfolders. It strips off the folder names and the file extension when it names things.
The end result is that an image called
/images/test/my_image_one.png
would automatically be accessible using
scene my_image_one with dissolve
without manually coding an
image
statement.
The process is introduced here :
You must be registered to see the links
As long as the filename and the image identifier are identical, you don't need to manually add that
image
statement. Things get a little trickier if you have two (or more) files named exactly the same in different folders. But if you had that, you'd already have
image
statements where the image identifier was different from the filename.
If you're renaming all your images. One way to simplify things would be to remove all those extraneous
image
statements from your code and let RenPy generate the correct
image
definition for you. Again,
image
definitions are NOT stored in save files - so removing them from your code won't affect save compatibility.