For context: I’m creating a turn-based fantasy game where magic spells are based on programming concepts. I’m currently attempting to implement a way to cast for-loop spells that cast on every turn, and allows for if-else commands to be nested within them.
To do this, I made a recursive command parser for my game, and I’ve run into a “maximum call stack size exceeded” crash. If on the app, the game loads endlessly, and on web and mobile, it shows this crash.
Here are screenshots of the event line that causes this issue:
Player Turn Logic External Event:
Parse Command Group External Event:
Parse If External Event:
Specifically, on the third image in the group named “Executing Correct Action Recursive”, the sub group named “causes crash” is the original event line that allows for recursion.
Replacing it with the normal “cast” event line in the next screenshot solves it, but will make it so that if else commands cannot be nested within the for loop.
I’m worried that this error won’t allow me to build the for-loop system that I want in game,and I’m currently looking for solutions or workarounds for this that doesn’t involve straight up rebuilding my game in a different engine due to IRL time constraints among other issues.
Any help would be appreciated!



