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

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.
Post Reply
Message
Author
kafkaontheshore
Newbie
Posts: 15
Joined: Thu Apr 22, 2021 8:57 am
Contact:

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

#1 Post by kafkaontheshore » Fri May 07, 2021 10:12 am

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
Last edited by kafkaontheshore on Sat May 08, 2021 8:52 am, edited 1 time in total.

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1072
Joined: Tue Aug 23, 2016 10:35 am
Skype: miinipaa
Contact:

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

#2 Post by Ocelot » Fri May 07, 2021 10:22 am

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)
< < insert Rick Cook quote here > >

kafkaontheshore
Newbie
Posts: 15
Joined: Thu Apr 22, 2021 8:57 am
Contact:

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

#3 Post by kafkaontheshore » Sat May 08, 2021 8:52 am

Thank you so much! I will do that!

Post Reply

Who is online

Users browsing this forum: mavyxdawn