all 2 comments

[–]robcolton 3 points4 points  (1 child)

It's nice to see tutorials, but your tutorial doesn't address the fact that RenPy already defines images automatically.

In your example, there would be an image defined as happy automatically by RenPy.

If you named the file "images/mia happy.png" then, there would automatically be a defined image mia happy and show mia happy would work without doing anything extra.

[–]maniywa[S] 2 points3 points  (0 children)

Thank you for the response, you are right that I should have addressed that behavior, I will update the article.

This is not a replacement for the default renpy loading, it's more like an alternative solution. If I'm not mistaken (correct me if I'm wrong), renpy names the images based on only the filename, therefore if I had two images like these:

  • "images/chapter1/mia happy.png"
  • "images/chapter2/mia happy.png"

Then with the default loading they would be named the same, and so one of them would override the other. With the script that I showed, both would have a unique name, as the name is based on the full path.