RPG Maker VX Ace

RPG Maker VX Ace

View Stats:
Vitowns May 3, 2017 @ 10:01am
Stack error level too deep
So i did my research on this but i can't figure it out in my prototype game, i made my own combat system calling events and when i fight for a long time (By trying to escape and failing) or by (Hitting enemy but missing) etc... I seem to end up with a stack error level too deep error, but not always. I verified that none of my events are named the same or call an event twice etc... But i really need help please
< >
Showing 1-8 of 8 comments
Kio Kurashi May 3, 2017 @ 12:42pm 
Stack level too deep errors occur when the stack gets too deep. To understand the stack you must understand how the processes cumulate.
Idle > you attack > damage is calculated > enemy health is decreased > reset to idle.
In that example you return to the first layer of the stack which would mean that you have sucessfully prevented the error. Now lets say you have another system (Using your example).
Idle > you try to run but are unscessful > you are attacked > damage is calculated > your health is decreased > you try to run but are unsucessful > [Repeat as neccessary]
Here you se that you never truely return to the base level. Even if you were to not return to step 1 at idle you should still return to whatever is right before your action. Because of these kinds of loops that could go on indefinitly until they are broken (And usually cleaned up at that point) you get an increasingly larger stack size until you get the error. I don't recall just how deep the stack can go, but it is pretty small (like 32 or something).

Try to adjust your system to always run off a single process and only call the the other parts when needed while also waiting for those parts to complete and return to the first main part before continuing on.
Vitowns May 3, 2017 @ 1:16pm 
Originally posted by Kurashi:
Stack level too deep errors occur when the stack gets too deep. To understand the stack you must understand how the processes cumulate.
Idle > you attack > damage is calculated > enemy health is decreased > reset to idle.
In that example you return to the first layer of the stack which would mean that you have sucessfully prevented the error. Now lets say you have another system (Using your example).
Idle > you try to run but are unscessful > you are attacked > damage is calculated > your health is decreased > you try to run but are unsucessful > [Repeat as neccessary]
Here you se that you never truely return to the base level. Even if you were to not return to step 1 at idle you should still return to whatever is right before your action. Because of these kinds of loops that could go on indefinitly until they are broken (And usually cleaned up at that point) you get an increasingly larger stack size until you get the error. I don't recall just how deep the stack can go, but it is pretty small (like 32 or something).

Try to adjust your system to always run off a single process and only call the the other parts when needed while also waiting for those parts to complete and return to the first main part before continuing on.
Wow thanks for the detailed reply sir, much appreciated :D I'll work on it and try to fix everything!
Vitowns May 3, 2017 @ 1:50pm 
I have to rewrite combat from scratch, i call too many events i guess
Lordfulger May 3, 2017 @ 7:29pm 
Simplified answer....you have two of the same scripts...
Last edited by Lordfulger; May 3, 2017 @ 7:30pm
Kio Kurashi May 3, 2017 @ 9:37pm 
Originally posted by Lordfulger:
Simplified answer....you have two of the same scripts...
Wrong.
Lordfulger May 4, 2017 @ 4:02am 
Originally posted by Kurashi:
Originally posted by Lordfulger:
Simplified answer....you have two of the same scripts...
Wrong.
Hmm...that's what it always means for me. Guess it's a different problem. Then ignore what I said :D May the divine one-eyed hippoes heal your problems....make sure to pay them back with marbles...little buggers will steal them otherwise.
Lordfulger May 4, 2017 @ 4:03am 
Originally posted by vitowns:
I have to rewrite combat from scratch, i call too many events i guess
Couldn't you use common events as well? Just a thought...or what type of combat system is it?
Vitowns May 4, 2017 @ 4:12am 
Originally posted by Lordfulger:
Originally posted by vitowns:
I have to rewrite combat from scratch, i call too many events i guess
Couldn't you use common events as well? Just a thought...or what type of combat system is it?
I was callign too many common events etc... for the combat system. But i fixed it now it seems fine no stack error so far. You can fire your spaceship cannons hit or miss and also launch missiles also view your ship stats and try to escape combat. The enemy also has hit n miss chances as we take potshots at eachothers.
< >
Showing 1-8 of 8 comments
Per page: 1530 50

Date Posted: May 3, 2017 @ 10:01am
Posts: 8