My script changed, so now sometimes players will get the exception: "Couldn't find a place to stop rolling back. Perhaps the script changed in an incompatible way?" when loading a save file, I would like to handle this error by telling them that their save fils is incompatible and sending them to the main menu instead of showing an error screen and then hard-crashing. Is there any way for me to do this? I tried using after_load but the exception occurs before after_load takes place oddly enough.
Any help is appreciated!
[SOLVED] Handling an error
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.
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.
-
- Newbie
- Posts: 4
- Joined: Tue Sep 26, 2023 1:53 pm
- Contact:
[SOLVED] Handling an error
Last edited by Galo223344 on Tue Dec 19, 2023 4:41 pm, edited 1 time in total.
- Donmai
- Eileen-Class Veteran
- Posts: 1960
- Joined: Sun Jun 10, 2012 1:45 am
- Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
- Projects: Slumberland
- Location: Brazil
- Contact:
Re: Handling an error
Click the "force recompile" button on the RenPy Launcher screen, and see if it helps.
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)
TOIRE NO HANAKO (A Story About Fear)
-
- Newbie
- Posts: 4
- Joined: Tue Sep 26, 2023 1:53 pm
- Contact:
Re: Handling an error
Oh, I don't want to fix the "Couldn't find a place to stop rolling back" (Unless it's posible) since the script did in fact change between versions. I just want to tell something else to the player besides a big exception screen.
-
- Veteran
- Posts: 293
- Joined: Fri Sep 17, 2021 2:09 am
- Organization: enaielei
- Tumblr: enaielei
- Deviantart: enaielei
- Github: enaielei
- Skype: enaielei
- Soundcloud: enaielei
- itch: enaielei
- Discord: enaielei#7487
- Contact:
Re: Handling an error
https://www.renpy.org/doc/html/config.html#var-config.exception_handler
Also, you can compare your saves' version to the current config.version or list of incompatible versions and identify yourself whether that save is compatible or not.
Also, you can compare your saves' version to the current config.version or list of incompatible versions and identify yourself whether that save is compatible or not.
Code: Select all
define config.version = "2.0"
define incompatible_versions = ["1.0"]
screen file_slot(...):
...
if FileJson(slot)["_version"] in incompatible_versions:
text "Incompatible"
-
- Newbie
- Posts: 4
- Joined: Tue Sep 26, 2023 1:53 pm
- Contact:
Re: Handling an error
That's exactly what I was looking for, thank you very much!enaielei wrote: ↑Mon Dec 18, 2023 10:34 pm https://www.renpy.org/doc/html/config.html#var-config.exception_handler
Also, you can compare your saves' version to the current config.version or list of incompatible versions and identify yourself whether that save is compatible or not.
Code: Select all
define config.version = "2.0" define incompatible_versions = ["1.0"] screen file_slot(...): ... if FileJson(slot)["_version"] in incompatible_versions: text "Incompatible"
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot]