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.
exists does not perform data interpolation and looks for the file string literally (after all, "[PICTURES_CHARACTERS][idSpeaker]" is a valid file name). You must perfort interpolation.
Images are a special case because if given just a string instead of proper displayable, when expected, it tries to guess, what you probably meant, and create corresponding displayable — Image, Solid, DynamicImage... Most of the time it guesses correctly, and if not, you just have to specify, what do you want yourself.
Whaen you write "[PICTURES_CHARACTERS][idSpeaker]", text in braces is a marker, that you want that text replaced with actual value of a variable, whose name is written within. Some RenPy facilities, most importantly Text and DynamicDisplayable know this and do the replacement. For everything else it is just text in square brackets. You must do the replacement yourself before passing the string to such functions.
For example, your picture property could look like:
In fact, in my think, if renpy can interpolate, there is necessarily a way, a moment where the interpolate string is a real string. But I don't find the way to obtain this string (result of interpolation).
Ocelot wrote: ↑Wed Jun 02, 2021 2:51 am
If PICTURES_CHARACTERS is a list, you need to get element from it: str( PICTURES_CHARACTERS[0] ). Why is it a list though?
IT's not a list and it seems to be the source of problem. Thanks guy !!