I have a question about the control flow of ren'py (7.4.1).
For a VN, I wanted to build kind of a replay function in which you can decide to view one or many scenes in one go.
The replayed scenes are called by label and have a return command to return to the gallery.
To view many scenes at once, I have created a python function which when it is called, should loop through many labels and call the scenes.
But the return of the scene-call goes not into the function-loop but rather directly after the function in the script.
I just found a workaround to that problem (saved the replay-labels in a global list and called an outside label from where I could call all the replays with a while-loop in ren'py code.
But I'm still interested in, why this happened and whether there is a solution, that is more clean.
I attach a simplified version of my problem as script:
Code: Select all
#function declaration
init python:
def testfunction():
for i in range(1,4):
renpy.call("repeat"+str(i))
#script
label start:
"Start of Loop."
$testfunction()
"End of Loop"
return
label repeat1:
"Loop 1"
return
label repeat2:
"Loop 2"
return
label repeat3:
"Loop 3"
return
Start of Loop
Loop 1
Loop 2
Loop 3
End of Loop
But what I get is:
Start of Loop
Loop 1
End of Loop
Does anybody know why this is?
Best regards
Living