So I was trying to adjust the formulas for critical attacks and I made an oopsie, see below.


Following Tutorial -- StackOverflowException: The requested operation caused a stack overflow.

I keep getting this message while following tutorials. it seems like this happens about 50-50 when I engage in a battle action...Is this a message saying there something wrong with the formula or the battle event?
This most recent one happened with a Attack Command..but it also happens when I cast Fire most of the time...And it almost always appears to be a player action and not an enemy.

StackOverflowException: The requested operation caused a stack overflow.
ORKFramework.Formulas.Formula.Calculate (Single initialValue, ORKFramework.Combatant user, ORKFramework.Combatant target)

I thought I followed the Formulas exactly...did i miss something?


I figured out the issue. So this is how I troubleshot this in case anyone is wondering.
Based on the error message: ORKFramework.Formulas.Formula.Calculate I realized it had to be because of a formula.

Once I sat down and realized how often it was happening, I realized since it wasn't 100% of the time it was not the default Attack or Magic Damage formula.

Based on that I determined it had to be the Criticals. Turns out you should not tell a formula to reference itself in the case of it needing to be called. It will in fact cause a loop of doom; and cause your formulas to crash and in turn...your game.

Moral of the story-- check your event loops 3 times even if you think they look perfect. Had I done that 1 simple thing, it would have saved me about and hour of me slamming my head on the table in frustration.

Hopefully this helps someone...if not, hope you got a laugh outta it instead. :D
  • Yep, a stack overflow error is usually caused by an eternal loop somewhere or by doing too many stuff in a frame (event system, a Wait step can help in that case).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.