Help! RuntimeError: maximum recursion depth exceeded

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
Musick
Regular
Posts: 62
Joined: Wed Jun 20, 2018 3:14 am
Completed: Ariane's Assistant Ariane Eldar's Rock Strip Quiz 1
Deviantart: SteampunkGorgon
itch: ritchierat
Contact:

Help! RuntimeError: maximum recursion depth exceeded

#1 Post by Musick »

Hello,
after my programmer deserted me I started writing my game myself. It is a rather long gamestory with many pictures, and I made good progress and hoped to finish the story within the next week, but as I tested the latest version, the game stopped and I got this message:
"RuntimeError: maximum recursion depth exceeded"
Who can help me?

User avatar
Karl_C
Veteran
Posts: 232
Joined: Sun Mar 31, 2013 6:18 am
Contact:

Re: Help! RuntimeError: maximum recursion depth exceeded

#2 Post by Karl_C »

Usually, the error message looks like this:
I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 1131, in script
with Dissolve(2.0)
RuntimeError: maximum recursion depth exceeded
In what line you get the error and what code does that line contain?

Musick
Regular
Posts: 62
Joined: Wed Jun 20, 2018 3:14 am
Completed: Ariane's Assistant Ariane Eldar's Rock Strip Quiz 1
Deviantart: SteampunkGorgon
itch: ritchierat
Contact:

Re: Help! RuntimeError: maximum recursion depth exceeded

#3 Post by Musick »

I am writing my Ren'py game in atom. I can start the game via the Ren_py launcher and it can testplay it, but when I reach a certain scene, it stops and I get this message:

I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 1829, in script
h "Wokka, wokka, wokka wokka! See the funniest man on stage."
File "renpy/common/000window.rpy", line 98, in _window_auto_callback
_window_show()
File "renpy/common/000window.rpy", line 60, in _window_show
renpy.with_statement(trans)
RuntimeError: maximum recursion depth exceeded

The code in 1829 in script.rpy is:

(line 1824)label comedian:
(line 1825) scene bg stage
(line 1826) show Harry costume2 at center
(line 1827) show Audience Normal
(line 1828)
(line 1829)h "Wokka, wokka, wokka wokka! See the funniest man on stage."
(line 1830)h "What's the difference between Chuck Norris and..."
(line 1831)
(line 1832)hide Audience Normal
(line 1833)show Audience Angry
(line 1834)
(line 1835)u "BOOOOO! BOOOOOOO! STOP IT!"

User avatar
Karl_C
Veteran
Posts: 232
Joined: Sun Mar 31, 2013 6:18 am
Contact:

Re: Help! RuntimeError: maximum recursion depth exceeded

#4 Post by Karl_C »

Code: Select all

label comedian:
    scene bg stage
    show Harry costume2 at center
    show Audience Normal
Check your image definitions for "stage", "Harry costume2" and "Audience Normal".
Example:

Code: Select all

image Harry costume2 = "Harry costume2"
will trigger a "RuntimeError: maximum recursion depth exceeded". Possibbly you forgot the file extension in your image declaration?

Musick
Regular
Posts: 62
Joined: Wed Jun 20, 2018 3:14 am
Completed: Ariane's Assistant Ariane Eldar's Rock Strip Quiz 1
Deviantart: SteampunkGorgon
itch: ritchierat
Contact:

Re: Help! RuntimeError: maximum recursion depth exceeded

#5 Post by Musick »

Thank you for taking your time, first.
Just before I went back to the forum I found the mistake, and it was indeed an image that caused the problem, although a different one.

The original script was

label comedian:
scene bg stage
show Harry costume2 at center
show Audience Normal

h "Wokka, wokka! See the funniest man on stage."
h "What's the difference between Chuck Norris and..."

hide Audience Normal
show Audience Angry

u "BOOOOO! BOOOOOOO! STOP IT!"

jump endlynched

and I changed it to

label comedian:
scene bg stage
show Harry costume2 at center

h "Wokka, wokka! See the funniest man on stage."
h "What's the difference between Chuck Norris and..."

hide Audience Normal
show Audience Angry

u "BOOOOO! BOOOOOOO! STOP IT!"

jump endlynched

and it worked again. The scene even looks better as the angry audience now pops up. I finished the game and will post it for testing soon.

User avatar
Karl_C
Veteran
Posts: 232
Joined: Sun Mar 31, 2013 6:18 am
Contact:

Re: Help! RuntimeError: maximum recursion depth exceeded

#6 Post by Karl_C »

Just curious: How did you define the image 'Audience Normal'?

Musick
Regular
Posts: 62
Joined: Wed Jun 20, 2018 3:14 am
Completed: Ariane's Assistant Ariane Eldar's Rock Strip Quiz 1
Deviantart: SteampunkGorgon
itch: ritchierat
Contact:

Re: Help! RuntimeError: maximum recursion depth exceeded

#7 Post by Musick »

Here is the original script:
image Audience Normal = "Audience Normal"
image Audience Cheering = "audiencecheer.png"
image Audience Angry = "AudienceAngry.png"
image Skull = "ObjectSkull.png"

Now I see that I missed the .png extension. Maybe this was the mistake after all!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Sugar_and_rice, voluorem