Ren'Py I can't understand screen

DanStory

Newbie
Sep 30, 2021
50
66
I can't understand why the image always not found, even though the image on the folder is correct
can someone help me?

# for imagebutton day3
screen Freya_room_day3_money():
add "Freya_room_day3_money"

after this code i try to start there always 'image Freya_room_day3_money not found'

But in the other project it's work, i can't understand what happened here
 

Niv-Mizzet the Firemind

Active Member
Mar 15, 2020
573
1,119
I think the add statement only takes a path, not just a filename.
Try this for the third line:
add "images/Freya_room_day3_money.<extension>"
Where <extension> is the image's extension (jpg, png or whatever else)
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,256
Python:
    screen Freya_room_day3_money():
        add "Freya_room_day3_money"
after this code i try to start there always 'image Freya_room_day3_money not found'

The basic is that RenPy (well python) is case sensitive, but tends toward using lowercase, except where the various coding conventions recommend either .

When RenPy starts up it scans through the /game/images/ folder and sub folders and creates a displayable for each image it finds. That displayable is the filename in lower case, with the folder names and file extension removed.

So game/images/Freya_room_day1_money.jpg is known to RenPy as freya_room_day1_money.

You can override things by explicitly naming the file by name... for example add "Freya_room_day3_money.jpg" . But it has to be the exact case and include the file extension. If it's in a sub folder, that has to be included too.

By far the best way is to let RenPy do the heavy lifting for you and use the displayable name it assigns for you.
So add freya_room_day1_money

You can make life 99% easier for yourself by always using lower case for all filenames. Images, video, fonts, scripts, music, etc. including folder names.

Edit: As long as the image you are adding is in either the /game/ or /game/images/ folders, you don't need to specify the directory name as part of the filename... RenPy will find it in either of those two places automatically.
 
Last edited:

DanStory

Newbie
Sep 30, 2021
50
66
The basic is that RenPy (well python) is case sensitive, but tends toward using lowercase, except where the various coding conventions recommend either .

When RenPy starts up it scans through the /game/images/ folder and sub folders and creates a displayable for each image it finds. That displayable is the the filename in lower case, with the folder names and file extension removed.

So game/images/Freya_room_day1_money.jpg is known to RenPy as freya_room_day1_money.

You can override things by explicitly naming the file by name... for example add "Freya_room_day3_money.jpg" . But it has to be the exact case and include the file extension. If it's in a sub folder, that has to be included too.

By far the best way is to let RenPy do the heavy lifting for you and use the displayable name it assigns for you.
So add freya_room_day1_money

You can make life 99% easier for yourself by always using lower case for all filenames. Images, video, fonts, scripts, music, etc. including folder names.

Edit: As long as the image you are adding is in either the /game/ or /game/images/ folders, you don't need to specify the directory name as part of the filename... RenPy will find in in either of those two places automatically.
thanks dude i'll try it
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,565
7,378
I think the add statement only takes a path, not just a filename.
Try this for the third line:
add "images/Freya_room_day3_money.<extension>"
Where <extension> is the image's extension (jpg, png or whatever else)
No, this is not correct. You can use a fully path, but it isn't necessary. 79flavors identified the issue - the image Freya_room_day3_money.jpg will show up inside Ren'py as freya_room_day3_money (lower case "F") if you're relying on Ren'py's automatic image conversion.
 

DanStory

Newbie
Sep 30, 2021
50
66
No, this is not correct. You can use a fully path, but it isn't necessary. 79flavors identified the issue - the image Freya_room_day3_money.jpg will show up inside Ren'py as freya_room_day3_money (lower case "F") if you're relying on Ren'py's automatic image conversion.
Thanks for your help dude