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.
label notes:
foreach note in notes:
*Read out the note*
I do have some coding background but not with python. I know there is no foreach only a for, but I am stuck. This is probably a beginner question but I couldn't manage to find anything in the cookbook forum (maybe I just don't know what to look for)
Thanks in advance
Last edited by Mangescom on Mon Oct 16, 2017 7:14 am, edited 2 times in total.
I am honestly sorry but I can't get this to work. I started a new project to eliminate the rest of the script as error:
Whenever I use "for note in notes" it tells me
File "game/script.rpy", line 16: expected statement.
for note in notes:
Ren'Py Version: Ren'Py 6.99.12.4.2187
When I let it run under init python: it says "name 'notes' is not defined" after programm crashes.
I know how many entries there will be at any given point so I can use "[notes[0]]" to give out a specific entry. however it is just a workaround, not a solution.
My solution for now looks like this:
Just for some more detail, Ren’Py doesn’t have for loops in the main body. You can do for loops on screens, but not in the regular script. Ren’Py does do while loops, however.
So you can use a while loop, or you can put everything in a Python block and use for that way. But if you are in the python block you have to use Python equivalent statements for things like say, show, etc.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)