check_infinite_loop error in Ren'py 7.4.5

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
User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

check_infinite_loop error in Ren'py 7.4.5

#1 Post by zmook »

Huh. So this code worked fine in Ren'py 7.4.4, and now in 7.4.5 rollback has stopped working, and it throws this error when I reload:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 94, in script
    if not regressing:
Exception: Possible infinite loop.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 94, in script
    if not regressing:
  File "/Users/colin/dev/sdk/renpy-7.4.5-sdk/renpy/execution.py", line 61, in check_infinite_loop
    raise Exception("Possible infinite loop.")
Exception: Possible infinite loop.

Darwin-20.4.0-x86_64-i386-64bit
Ren'Py 7.4.5.1648
Pirates Logbook 1.0.4
Sun Jun  6 14:27:35 2021
Believe me -- I have downloaded separate copies of the SDK for 7.4.4 and 7.4.5, and it works with one and throws errors with the other.

The code is a simple comic viewer, sort of non-standard use of renpy, but it (used to) work:

Code: Select all

label start:
    scene black
    show screen comic_page(_layer="master")
    show screen metadata_overlay()
    show screen controls()
    
    while True:
        if current_page_n[1] == 1:
            $ renpy.choice_for_skipping()   # triggers autosave
        pause
        $ zoom = False
        if not regressing:
            $ advance_page()  # this method causes a new page to be shown
        $ regressing = False	# there's code under screen controls to handle going back a page

    return
Was the check_infinite_loop code changed on purpose, or has something else gone wrong?
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

User avatar
PyTom
Ren'Py Creator
Posts: 16093
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: check_infinite_loop error in Ren'py 7.4.5

#2 Post by PyTom »

Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: check_infinite_loop error in Ren'py 7.4.5

#3 Post by zmook »

PyTom wrote: Sun Jun 06, 2021 4:32 pm Just fixed this. https://github.com/renpy/renpy/commit/7 ... 446c9d9fee
Fantastic!
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

Victorius
Regular
Posts: 30
Joined: Thu Jan 14, 2021 7:02 pm
Projects: Astral Lust
Github: Victorius-Astral
Contact:

Re: check_infinite_loop error in Ren'py 7.4.5

#4 Post by Victorius »

PyTom wrote: Sun Jun 06, 2021 4:32 pm Just fixed this. https://github.com/renpy/renpy/commit/7 ... 446c9d9fee
I've tried latest release, 7.4.6.1693, and I got this error when rollbacking to/prior to a loop, I got this error in two loops on 7.4.5, now it's in only one, to clarify in 7.4.4 I can normally rollback to both.

Code: Select all

  File "game/events/explore/construction_shop.rpy", line 239, in script call
    $ exp_scav_girl.start_trade()
  File "game/functions/trade/trading.rpy", line 3, in script
    $renpy.pause(1.0)
  File "renpy/execution.py", line 61, in check_infinite_loop
    raise Exception("Possible infinite loop.")
Exception: Possible infinite loop.

User avatar
PyTom
Ren'Py Creator
Posts: 16093
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: check_infinite_loop error in Ren'py 7.4.5

#5 Post by PyTom »

What does the loop that's causing the problem look like?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Victorius
Regular
Posts: 30
Joined: Thu Jan 14, 2021 7:02 pm
Projects: Astral Lust
Github: Victorius-Astral
Contact:

Re: check_infinite_loop error in Ren'py 7.4.5

#6 Post by Victorius »

PyTom wrote: Wed Jun 16, 2021 4:52 pm What does the loop that's causing the problem look like?
It's indeed infinite loop, when I made it I was learning renpy, I didn't know how to make it another way, I guess I'll need to rewrite it, but still, it used to work, so I'm reporting this, it might be intended behaviour though. It uses trader.start_trade() ending with this:

Code: Select all

	# Adding to save system
        self.save()

        if not self.unique:
           renpy.show_screen("trade", tr = current_trader, gs_pl = sor_player, gs_tr = sor_trader)
           renpy.call("trading")

        return [sor_player, sor_trader]
and this trading label looks like this:

Code: Select all

label trading:
    while _in_trade:
        $renpy.pause(1.0)

    return
In trade screen once player exits it, it changes _in_trade to false, and exits loop. Pause was to not get infinite loop error, it just makes sure the game doesn't try to calculate it infinite times instantly.

This infinite loop doesn't cause error though:

Code: Select all

label walka:

    $ astral.show_help("Combat")

    while enemy.hp > 0:
        window hide
        if not hand:
            jump end_turn
        $renpy.pause(4.0)
        #$enemy_state = "idle"

    $ player.spirit = int(player.spirit_max)
    $_combat = False
    $_skipping = True
    $renpy.show_screen("battle_notify", message = "Enemy defeated!")

Post Reply

Who is online

Users browsing this forum: Google [Bot]