Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
-
DrVoom
- Newbie
- Posts: 5
- Joined: Sat May 29, 2021 7:54 am
-
Contact:
#1
Post
by DrVoom » Sun Nov 14, 2021 3:00 pm
I have a python variable that leads to an image.
when i display the variable with
all is looking fine - i get D:\dir\image.jpg
when i set it as an image with
and show it with
i get
"Exception: DynamicImage u'[img]': could not find image. (u'D:\\dir\\image.jpg')
There are double \\'s in the Exception Statement. The image exists at that place. Any hints what newbie error i am making? Thanks!
-
rayminator
- Miko-Class Veteran
- Posts: 754
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
-
Contact:
#2
Post
by rayminator » Sun Nov 14, 2021 3:07 pm
it should look like this
you are including you hard driver directory in the code that other players don't have that drive letter
-
drKlauz
- Veteran
- Posts: 237
- Joined: Mon Oct 12, 2015 3:04 pm
-
Contact:
#3
Post
by drKlauz » Sun Nov 14, 2021 4:26 pm
Avoid using \ in paths, it is escape character in python. It is not obvious from your example, but if you use
it will print "D:\dig.jpg", because \b is converted to backspace character. In this case img will be "D:\\dir\x08g.jpg"
Use / instead.
Users browsing this forum: Google [Bot]