Ren'Py Wierd type of error - no traceback

kotte

Member
Feb 11, 2018
182
318
I am playing "The Roommate", and when I try to load save from the previous release (0.6.1) in the latest version (0.6.6) this wierd thing happens:

I get to the scene where the save was done, but on next click (or any interaction), I just return to the main menu.

This is definitely because I was using a WT mod when I did the saves, but that is not the reason I post here.
The thing is that I get no error message at all, no traceback.txt file, no indication that the application has misbehaved.
It jus jumps back to the main menu.

This makes me curious.
Does anyone have any idea on conditions that can kick you back to the main menu without an exception?
I can enter the dev console after loading the save, is there anything interesting I can check from there?

So, I repeat, I am not trying to fix the "can load save that was made with a mod", I can totally replay the game again or something.
I just want to understand what Ren'py is doing...
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,302
15,172
I get to the scene where the save was done, but on next click (or any interaction), I just return to the main menu.
It happen sometimes yeah.


Does anyone have any idea on conditions that can kick you back to the main menu without an exception?
I'm interested if someone have the validated answer, because I never achieved to have more than a (strong) guess and I'm too lazy to verify it.
There's three things that intervene here:
  1. The way Ren'Py find where it should start back the game.
    When the line where the save file was created do not exist anymore, Ren'Py rely on the rollback stack to find a place that still exist. Normally this place is always an interaction, but I guess that a return is also a valid point, since it's supposed to lead to an interaction.
  2. The way the call stack is handled.
    I seem to remember that it proceed to through the stack when label(s) disappeared. It's not too important if an intermediary label isn't here anymore, the label one level above is still a valid guess and you would end there anyway at a moment or another.
  3. The behavior of the return statement.
    When the calling stack is empty, it mean that you've reached the end of the game, so Ren'Py send you back to the main menu.
Therefore, my guess is that what happen here is that there were a big change in the code (due to the missing mod), what make Ren'Py start back on a return statement. But it also lead to the call stack only having now missing labels, what make Ren'Py believe that this return is the last statement of the game.


I can enter the dev console after loading the save, is there anything interesting I can check from there?
Not really sure. At most you would have the game values as defined in the save file, but I do believe that most of Ren'Py's internal values would be reset at this moment.
 

kotte

Member
Feb 11, 2018
182
318
Thanks! This was exactly the type of reply I was hoping for.

If the call stack looks like this:
Code:
[(u'game/ch40.rpy', 1650653915, 13419), (u'game/functions.rpy', 1653826164, 12916)]
...am I right to assume that these are not labels, but positions, expressed as tuples of "filename, line_hash, something"?
(or perhaps these tuples are called "labels"?)

Also, when I saw the filenames, I suddenly remembered that the previous version had a bug in "functions.rpy", that I fixed while playing. No surprise that restoring those saves in a non-modified later version will be hard.
I don't know why I didn't think about breaking my saves, perhaps I was just triggerhappy, wanting to learn more about Ren'py coding.
 

osanaiko

Engaged Member
Modder
Jul 4, 2017
2,243
3,831
Please Can anyone help me?i dont know how to fix this,thankyou a lot.
Make a new thread, your question is completely unrelated to the OP (and this thread was dead for more than 1 year.)

Edit: not even the same game engine lol.