Question Internal script stack overflow

Tyne

Member
Messages
11
Points
6
Making a Zombies menu for BO2, every time I attempt to enter a submenu, the game crashes, giving me a "Internal script stack overflow."

Not sure what the root of the problem is and I've tried multiple solutions.
 

Attachments

ReleaseTheMong

Well-Known Member
Messages
37
Points
218
Making a Zombies menu for BO2, every time I attempt to enter a submenu, the game crashes, giving me a "Internal script stack overflow."

Not sure what the root of the problem is and I've tried multiple solutions.
Most likely the issue lies in one of your many loops.
Internal script stack overflow occurs when the game is trying to add a new variable to the script stack, so if you are calling a function over and over within its self or you are running a loop that adds new script variables infinitely.

If your menu opens fine and the only issue is submenus, i would be willing to bet that the issue is in this line :
self thread [[self.Menu.Func[self.Menu.Current][self.cursor]]](self.Menu.Input[self.Menu.Current][self.cursor]);

Also heads up, you shouldnt name your give weapon function 'giveweapon', since it is the same as the built in function.

Other than that, the script looks fine. I would just trace it step by step and try to figure out if something is undefined.
 

Tyne

Member
Messages
11
Points
6
Most likely the issue lies in one of your many loops.
Internal script stack overflow occurs when the game is trying to add a new variable to the script stack, so if you are calling a function over and over within its self or you are running a loop that adds new script variables infinitely.

If your menu opens fine and the only issue is submenus, i would be willing to bet that the issue is in this line :
self thread [[self.Menu.Func[self.Menu.Current][self.cursor]]](self.Menu.Input[self.Menu.Current][self.cursor]);

Also heads up, you shouldnt name your give weapon function 'giveweapon', since it is the same as the built in function.

Other than that, the script looks fine. I would just trace it step by step and try to figure out if something is undefined.
I'll be sure to look through the loops. I'm new to GSC scripting but I have few experience in code.

I was looking at a menu a friend of mine made and that line seemed to work just fine in his code. I tried the same thing, making sure the variables were renamed appropriately with the names I had, but that wasn't working.
 

Similar threads


Top