"Maximum recursion depth exceeded" when calling screen
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: 11
- Joined: Sun Oct 31, 2021 2:09 pm
- Contact:
"Maximum recursion depth exceeded" when calling screen
Hi! Keep getting this error from time to time in different screens. Looked through traceback but still have no idea how to fix it.
I would greatly appreciate some help!
I would greatly appreciate some help!
- Attachments
-
- traceback.txt
- (111.95 KiB) Downloaded 30 times
Re: "Maximum recursion depth exceeded" when calling screen
Is it a free-roam interface? If label cabins_level_door1 looks the same as cabins_level_hub, then with each move you add to the stack with Call action but never remove it from stack.
Likely, what you want is to use Jump action instead of Call action.
-
- Newbie
- Posts: 11
- Joined: Sun Oct 31, 2021 2:09 pm
- Contact:
Re: "Maximum recursion depth exceeded" when calling screen
Hi! Fixed it, but not sure if it helped.
It appeared again in other place: After I chose to ignore, it happened again on other screen (where I've already changed Call() to Jump() )
Re: "Maximum recursion depth exceeded" when calling screen
Did you use the old save? In your old save you likely have a long call stack that eventually may result in a recursion depth error.
Open console (Shift+O) and type renpy.get_return_stack() just to confirm that it is not coming from the call stack.
-
- Newbie
- Posts: 11
- Joined: Sun Oct 31, 2021 2:09 pm
- Contact:
Re: "Maximum recursion depth exceeded" when calling screen
The last error you get is likely caused by the same problem.BrotherKerubim wrote: ↑Fri Dec 09, 2022 12:36 pm Nope, I start a new game each time I try.
I guess you were right, renpy.get_return_stack() was filled with 10-15 calls.
I missed to change Call() to Jump() in one screen.
After fixing it I got slightly different error.
Likely, the recursion happens somewhere else. I don't see any direct problems that could lead to recursion(besides using Call action)
What is "ship_deck.rpyc", line 14, in script? Is it also call screen some_screen?
What function scene does? I'd recommend renaming it to avoid confusion with scene statements.
Check that you don't have functions that indirectly call themselves or variables that indirectly use themselves.
-
- Newbie
- Posts: 11
- Joined: Sun Oct 31, 2021 2:09 pm
- Contact:
Re: "Maximum recursion depth exceeded" when calling screen
It calls function scene_deck() which starts playing background noise and shows a layered scene with a certain offset of its images. Also it defines default transition for this scene.
It does almost the same as default scene but it defines what background noise file should start or keep playing and shows transition. These are definitely not the best code examples, but I don't see anything that would cause the discussed matters.
I looked trough all functions, images and transitions defined by me, didn't see any noticable recursions. I hoped there is some way to catch what exactly causes problem, without all this guessing. Something like renpy.get_return_stack() but for cases like this.
Re: "Maximum recursion depth exceeded" when calling screen
One way is to localize the code where the problem occurs. As I understand the error occurs occasionally and not specifically at a particular point which is what is making it hard to track.
Looking at the traceback, one thing you can find in common. Repetition of the following lines:
Probably, someone can point out where to start looking based on this.File "C:\Users\Goka\Downloads\WetSand-0.2.7-win\WetSand-0.2.7-win\renpy\display\transform.py", line 747, in render
return transform_render(self, width, height, st, at)
File "accelerator.pyx", line 187, in renpy.display.accelerator.transform_render
File "render.pyx", line 266, in renpy.display.render.render
Likely, the problem is related to the rendering of a displayable. I suggest double-checking your images, looking at the image declarations, transform declarations. For example, declaration of ship_deck_sea_horizon_4, ship_deck_sea_bg4_pos, blurred
It is also possible that the error in the displayable that not even related to the current statement.
-
- Newbie
- Posts: 11
- Joined: Sun Oct 31, 2021 2:09 pm
- Contact:
Re: "Maximum recursion depth exceeded" when calling screen
Okay, I think I got it.
I put this line in \renpy-8.0.3-sdk\renpy\display\transform.py to log what's going on in there and got my game crashed with recursion error.
log file was overfilled with logs like this I checked what's in ('renpy/common/00definitions.rpy', 45) and there was a truecenter declaration
I remembered that I used it in my custom scene() function So problem was that I misunderstood how default arguments work in Python. at list was not created each time anew when the function was called, but continued to accumulate truecenter instances in itself.
I hope the way I solved the problem will help someone else. Thanks _ticlock_, you helped a lot!
Who is online
Users browsing this forum: Google [Bot]