Page 1 of 1

"return" to specific label?

Posted: Fri Apr 01, 2022 6:53 pm
by Milkymalk
Is there a way to use the "return" statement to return not to the point where the label was called, but to any other label? Alternatively, is there a way to remove the last call from the stack so I can just "jump" where I want to be?

Otherwise I need to use variables and do strange checks after the "call" statement, which I would like to avoid.

The reason why I don't use an ordinary "jump" in the first place is that the player can be sent from various places to various places and not all of them return to the exact point where the player came from.

Re: "return" to specific label?

Posted: Fri Apr 01, 2022 7:09 pm
by Ocelot

Code: Select all

label start:
    call second

label second
    $ renpy.pop_call()
    jump ending

label ending:
    return
https://www.renpy.org/doc/html/other.ht ... y.pop_call

Re: "return" to specific label?

Posted: Fri Apr 01, 2022 7:24 pm
by Milkymalk
Oh, thank you, that's handy!
I've been absent for a while so I probably missed a lot of little additions.