Show image path error
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
RonPaul2020
- Newbie
- Posts: 5
- Joined: Mon May 30, 2022 12:18 am
- Contact:
Show image path error
I'm attempting to attach an image into an instance of a custom character class to be used for facial expression, but for reasons unknown if I do not put in the full path for the image up to the C drive, I receive the 'could not find file' exception.
I set the image during the creation of the instance, and all other parts of the class besides the image works so it likely isn't a problem with the class. I have double and triple checked paths, spellings, filetypes, parenthesis and quotation marks. I really don't understand why the game would need up to the C directory in order to find the image.
Any help would be greatly appreciated
I set the image during the creation of the instance, and all other parts of the class besides the image works so it likely isn't a problem with the class. I have double and triple checked paths, spellings, filetypes, parenthesis and quotation marks. I really don't understand why the game would need up to the C directory in order to find the image.
Any help would be greatly appreciated
Re: Show image path error
Check if your image is in 'your_game_folder/game' or subfolder(s). If image is in 'game' folder it shouldn't complain about path at all, and if it in subfolder(s), you need to specify path starting from subfolder of 'game' folder.
-
RonPaul2020
- Newbie
- Posts: 5
- Joined: Mon May 30, 2022 12:18 am
- Contact:
Re: Show image path error
Thanks Alex, but that doesn't work. I have tried every path possible and only the one that leads back to C: successfully shows the image.
With some experimentation I've got it so that there is no exception crashing the game, but the image still doesn't show.
Is there a limit to the number of sub-folders you can have in /game/? Currently the full path is /MyGame/game/images/character/clothes/image.png
With some experimentation I've got it so that there is no exception crashing the game, but the image still doesn't show.
Is there a limit to the number of sub-folders you can have in /game/? Currently the full path is /MyGame/game/images/character/clothes/image.png
- Ocelot
- Eileen-Class Veteran
- Posts: 1882
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Show image path error
And how do you specify you image in game?
< < insert Rick Cook quote here > >
-
rayminator
- Miko-Class Veteran
- Posts: 754
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: Show image path error
it's because you are putting it the wrong way
blah blah blah = hover "" action call
wrong:
right:
blah blah blah = hover "" action call
wrong:
Code: Select all
imagebutton idle "MyGame/game/images/character/clothes.png" blah blah blahCode: Select all
imagebutton idle "images/character/clothes/clothes_01.png" blah blah blah-
RonPaul2020
- Newbie
- Posts: 5
- Joined: Mon May 30, 2022 12:18 am
- Contact:
Re: Show image path error
The character object is defined and initalised correctly, using a 'None' as a placeholder for the face attribute.
$ character.face = "images/character/face/character_face.png"
show image character.face
On the scene where the show is called, the error is produced.
-
RonPaul2020
- Newbie
- Posts: 5
- Joined: Mon May 30, 2022 12:18 am
- Contact:
Re: Show image path error
Firstly, I'm not trying to do anything with imagebuttons. I'm just trying to show the image itself.rayminator wrote: ↑Tue May 31, 2022 8:43 amit's because you are putting it the wrong way
blah blah blah = hover "" action call
wrong:right:Code: Select all
imagebutton idle "MyGame/game/images/character/clothes.png" blah blah blahCode: Select all
imagebutton idle "images/character/clothes/clothes_01.png" blah blah blah
Secondly, I have tried literally every possible variant of the path, including both of the ones you have mentioned. All of them produce the error, except for the one leading back to C:/.
- m_from_space
- Veteran
- Posts: 302
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: Show image path error
There is no command "show image". You are doing it wrong. Just write:RonPaul2020 wrote: ↑Wed Jun 01, 2022 1:01 amThe character object is defined and initalised correctly, using a 'None' as a placeholder for the face attribute.
$ character.face = "images/character/face/character_face.png"
show image character.face
On the scene where the show is called, the error is produced.
Code: Select all
show expression character.face
https://www.renpy.org/doc/html/displaying_images.html
- Ocelot
- Eileen-Class Veteran
- Posts: 1882
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Show image path error
This is not an image. This is a string. Image displayable does a lot of things, like fixing relative paths, poking archives, doing substitution (if nessesary), etc. You do no such things, so it is no wonder that it didn't work.RonPaul2020 wrote: ↑Wed Jun 01, 2022 1:01 am
$ character.face = "images/character/face/character_face.png"
If you define objects at init time, I suggest you use Image displayable, otherwise use m_from_space suggestion and use show expression
< < insert Rick Cook quote here > >
-
RonPaul2020
- Newbie
- Posts: 5
- Joined: Mon May 30, 2022 12:18 am
- Contact:
Re: Show image path error
I see! Thanks, much appreciated.The command "image" is used to define images, not to show them.
https://www.renpy.org/doc/html/displaying_images.html
Who is online
Users browsing this forum: mold.FF