Tool Ren'Py RenParse: Will show you The Broken Path

Mar 2, 2020
76
57
Hello. As you may know, renpy has that built-in Lint thingy to check your project for potential errors.
As you may also know, it doesn't check if the file paths you've set up are correct.

Enter RenParse, a simple python script that runs through all of your .rpy's and for each path within, checks if a file exists.
If it doesn't — you'll get an .rpy file path, a line number and the line with broken path in question.

It's not 100% fail-proof and can yield funny results:
1651282733758.png
However, most of these you can tweak-out down at RenParseConfig.json generated at first launch.



How-to:
0) download the git repo release .exe or grab a main.py & run as a python script. If you're using the .py, you can figure out the rest.
1) drop RenParse.exe into your project/game folder. If you end up using any other folder I'm not responsible for your results. : )
2) The config file will be created on first launch. You can either proceed with defaults or quit & tweak at this point.
3) Push y and enjoy.

Config options explained:
"skip comments": true/false, will skip #commented out lines
"jump one directory upwards": true/false, will jump one dir upwards so that you can keep RenParse stashed into game/devtools or a similar subdir.
"misc extensions" is a list of non-image file extensions to check path-likes for. For example, if you want RenParse to also check if your .opus audio paths are correct, add ".opus".
"image extensions" is a list of image-specific extensions to check for. Reason it's split from the rest is, both "image derp = images/derp.png" and "image derp = derp.png" are valid paths to the same file for renpy, so we double-check.
"strings to skip" is a list of symbols or substrings you want to omit from the results. If your project uses some interesting python prefixes/string vars, add those here.
As a general rule of thumb, start with default & tweak till you're satisfied.

Designed to be ran after you RenPy Lint and before you build, this program won't magically fix your gig but can save you some time.
Stay thirsty. <3
 
Last edited:
  • Like
Reactions: LightmanP

LightmanP

Well-Known Member
Modder
Game Developer
Oct 5, 2020
1,655
15,180
Not sure how useful this is because one does not usually use explicit image paths. Ren'Py automatically scans images in /images folder and defines them so they can be just used by their filename without the extension. And lint detects if an image used doesn't exist just fine. Thanks for sharing, though.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,111
14,790
Not sure how useful this is because one does not usually use explicit image paths. Ren'Py automatically scans images in /images folder and defines them so they can be just used by their filename without the extension.
There's also the ones that use dynamic images, like image whatever = "images/girls/anna/[annaCorruption]_idle.jpg", or directly the good old DynamicImages. And there's also those who decide the images in real time through scene expression "images/girls/anna/{}_idle.jpg".format( annaCorruption).
 
Mar 2, 2020
76
57
Not sure how useful this is because one does not usually use explicit image paths. Ren'Py automatically scans images in /images folder and defines them so they can be just used by their filename without the extension. And lint detects if an image used doesn't exist just fine. Thanks for sharing, though.
It's not just images. It parses anything that is a path, for any extension you set it up to.
Sounds, fonts, movies, whatever.
As for auto-images, as your project gets further away from a VN-like and/or overall thiccer, you'll have ever more need for explicit image paths.
Better usefulness argument still is, practices majority of the devs employ. You know, tons of image definitions all over the place.

There's also the ones that use dynamic images, like image whatever = "images/girls/anna/[annaCorruption]_idle.jpg", or directly the good old DynamicImages. And there's also those who decide the images in real time through scene expression "images/girls/anna/{}_idle.jpg".format( annaCorruption).
Currently the functionality is rather basic in this one, can't do much with path examples you've brought up. Parsing a path with string var usually means running a function that sets the var. Can't even imagine how an acceptable, say 95%+ success-rate code would look like for this...
But who knows, perhaps one night, under a freezing moon, an enlightening vision will come & yield a more high-tech update.
 
  • Like
Reactions: LightmanP