$ renpy.call_screen('replay_screen')
On the replay screen, I have a series of buttons that jump players to a particular scene in the game. For instance, one of the buttons will call:
Start("option_a")
I chose to call Start() rather than Replay(), as the latter prevents the save game feature from working. Anyway, this usually works fine. However, if I do the following:
- Finish a route.
- call_screen takes players to the replay screen (so they can see which ending they have just unlocked).
- Attempt to jump to a scene in the game by clicking on one of the buttons on replay screen.
If I do the above, the game crashes saying there was an exception:
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 5973, in script
$ renpy.call_screen('replay_screen')
File "game/script.rpy", line 5973, in <module>
$ renpy.call_screen('replay_screen')
File "renpy/common/00action_menu.rpy", line 128, in __call__
renpy.jump_out_of_context(self.label)
JumpOutException: option_b
After doing some research, I think I know the reason for this error. When I run $ renpy.call_screen('replay_screen'), the game is still not in the main menu context, so when I then attempt to jump to an in-game scene, Renpy tries to leave the main menu context (which the code isn't in) and becomes confused. I might be completely wrong on this, but that is my guess. Would anyone know a solution for this? Thank you


