Renpy claim infinite loop while I dispute it. Need help [Solved]

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
Sehaf
Regular
Posts: 58
Joined: Thu Feb 25, 2010 9:22 pm
Projects: Demon Lord & Yuki Academy
Deviantart: Sehad
Location: Sweden
Contact:

Renpy claim infinite loop while I dispute it. Need help [Solved]

#1 Post by Sehaf »

Wrote this piece today. To check a list against another.
While I though it to be simple enough. Renpy Cracks down on me and say there is possible infinete loop and does not let me continue.
Anyone can see what I'm missing or can ammend to make the text editor stop jammering at me.

Code: Select all

    
    $ collorBreak = False
    $ numb_remember = col_se1 + 1
    while numb_remember < 7 or collorBreak == False:
        if collorBox[numb_remember][row_se1] == collorBox[col_se2][row_se2]:
            $ numb_remember += 1
            $ colloCount += 1
        else:
            $ collorBreak = True

EDIT: Found the issue. the program was right of course.
Last edited by Sehaf on Wed Dec 25, 2019 7:29 am, edited 1 time in total.
I'm a GameMaker!
My Portfolio: http://www.bluepipestudio.com

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Renpy claim infinite loop while I dispute it. Need help

#2 Post by trooper6 »

Looking at your code, it seems as if all you want is to know how many things are the same in both lists? (the colloCount variable). There are much easier ways to do that.

For example:

Code: Select all

default list1 = [1,7,7,8,5]
default list2 = [5,4,2,7,9]

# The game starts here.
label start():

    "Doing a quick list intersection test."
    "List 1: [list1]"
    "List 2: [list2]"
    $listI = set(list1).intersection(list2)
    "List Intersection: [listI]"
    $listIcount = len(listI)
    "Number of items that are the same: [listIcount]"
    "That's it."
You can find some documentation on Lists here: https://www.tutorialspoint.com/python/python_lists.htm
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: Renpy claim infinite loop while I dispute it. Need help

#3 Post by PyTom »

I'll also note that the infinite loop check is actually just a timer - it's more just a way of breaking out of a game that's been unresponsive for 10 seconds or so. So if you're just doing a huge amount of work, you can get the warning, even if it's not technically an infinite loop.
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
Sehaf
Regular
Posts: 58
Joined: Thu Feb 25, 2010 9:22 pm
Projects: Demon Lord & Yuki Academy
Deviantart: Sehad
Location: Sweden
Contact:

Re: Renpy claim infinite loop while I dispute it. Need help

#4 Post by Sehaf »

Thanks for fast reply.

Its not just comparing lists. It checks a selected color from one list agains a position from the other list (which is a grid of 7 nested lists) how many of the same color is in the selected spot. So the sulotion does work at all im afraid.

@pytom. Could be it. Though it should only check seven strings at most from a list. Unshure how that could take longer then 10 seconds. Also the program gives me the error message almost directly.
I'm a GameMaker!
My Portfolio: http://www.bluepipestudio.com

Post Reply

Who is online

Users browsing this forum: Google [Bot]