Page 1 of 1

How to end the game? Return statement & call stack [Solved]

Posted: Fri May 07, 2021 10:12 am
by kafkaontheshore
Hello there,

I have a splashscreen which ends with the return statement which gets you to the menu. In my ending label is some text which appears and disappears. At the end is also a return statement. This worked days ago. I worked on some other things for awhile, I do not know when it stopped working, but now instead of getting to the menu, you jump to a random label. With that I mean that it jumped to a certain label every time I tried and after ignoring the issue for a while and working on other things it started to jump to a different label instead. I read about the return statement and it says that it pops the last thing from the call stack. If it is empty it gets you to the menu. How do I clear this call stack?

Thank you for your time :D

Re: How to end the game? Return statement & call stack

Posted: Fri May 07, 2021 10:22 am
by Ocelot
You structure your code properly and match amount of calls with amount of returns. While you are doing that, you can use quick hack, which does the same as "Return to main menu" option in pause menu:
renpy.full_restart(config.game_main_transition)

Re: How to end the game? Return statement & call stack

Posted: Sat May 08, 2021 8:52 am
by kafkaontheshore
Thank you so much! I will do that!