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.
I showed this to a friend of mine and he suggested I implement a code that would automatically load all the images without me having to list them all. However, we couldn't get it to work as Renpy just threw error after error at us. So now I have taken to these forums to seek guidance.
The problem lies here: "image img = None" is NOT Python and can not be used inside a function. It is Ren'py script and can only used outside of functions or python blocks.
You need to be aware that there are actually four(!) languages used by Ren'py: Python, Ren'py script, screen language and ATL. While some things from Python, like loops, can be used in the others, the opposite is not true. Python has no idea how to interpret expressions from the three script languages.
Next: You can't .append a None type variable. .append is a method for lists only.
Also, the return statement needs to be indented one more instance. It belongs to the sub-block of def.
Unfortunately I can not help you with your initial problem. You can try using a for-loop directly inside the image declaration, but I doubt that it will work.
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)