Hey! In my game, I have a set of stats (which I have updated so that stat upgrades are saved so they do not reset if the player dies or progresses to a new level). I built a reset mechanism so that when you double click [u], you can reset your statistics and restart the game. The double click mechanism is working (I’ve tested it).
^ I put in the values that I want the save blocks to reset to but when I test it out, the system says:
“Sorry, an error has occured:
Behavior logic contains infinite loop
Please reload the page”
I have no idea what the infinite loop is because I am just updating the save blocks.
Here is a link to my game: https://flowlab.io/game/play/1529371
The reset mechanism is in its own object called “RESET.” You can see the problem if you go to Level 1 or Level 2 and double-click [u] (may not work the first few times idky).
Did you fix it? I just tried it out, and the stats reset just fine like 10 times in a row.
@grazer No, the stats still have not reset for me. It still shows the error message and the lvl is still 2 even though it should be reset to 0.
@kevinyang, the problem is that your looping the click into the hide input with the Alert behavior.
This is useless because the click already hides the behavior, that input is so you can close the alert by other means than to click it. Looping it like that means your closing it again after you click it; since it happens in a single frame, it doesn’t actually freeze the game. But it does trigger Grazer’s error detection.
And @grazer, this is the second time I’ve seen this. May I suggest to replace the input of hide to also be “click”? Since its not just acting like a hide, but as another way to click the Alert. Or swap the Click and Hide labels.
@JR01 omg thank you so much! I had so much trouble and I kept thinking it had something to do with my save behaviors. that probably just saved me 2 more hours of me dissecting my horrible jumble of behavior code to try to figure out the loop error haha! thank you so so much!