Post: [Noob Friendly TUT] How to add overflow prevention to your mod menu
03-08-2015, 09:12 PM #1
Im_YouViolateMe
NextGenUpdate Elite
(adsbygoogle = window.adsbygoogle || []).push({});

You must login or register to view this content.
You must login or register to view this content.
(Shrek is love, shrek is life.)

Overflow fix originally by:[/size]
jwm614[/size]

Working overflow fix created by:[/size]
xTurntUpLobbies[/size]

Let's Begin!



Requirements


  • GSC Studio


  • A working mod menu with no syntax errors, and does not already have any overflow fix added.


  • The overflow fix code: You must login or register to view this content.


  • Some knowledge of Game Script Code


  • A brain



Tutorial

Ok so in this tutorial, I will be using the White Water Base. I know it already has the overflow fix incorporated, but I will be taking it out (as if it was a clean base with no overflow fix). I will also be detailing how to add this overflow fix to TheFallen's base. Let's get started.


  1. Open up GSC Studio. Locate your project, if it is not already opened.


  2. Create a new script and call it anything you want (such as overflowfix, xTUL_overflow, antioverflow, etc.) You must login or register to view this content.


  3. Go to the link with the overflow fix (You must login or register to view this content.), and paste in the code in the newly created script.


  4. It should now look like this: You must login or register to view this content.


  5. Here comes the fun part, getting it to support your base. If you are using shark's base, or my base, then this should be easy for you. If you are using TheFallen's then it might be tricky (due to how advanced the coding is in his menu)


  6. Firstly, what you want to do is write this code under onPlayerSpawned. It must be only called once by the host. This is what initiates/starts the overflow fix. You will need to create a boolean called isFirstSpawn before this code is called, and the boolean needs to be created before the for loop statement, so it doesn't always set to false.
        
    if(isFirstSpawn)
    {
    if (self isHost())
    {
    thread overflowfix();
    isFirstSpawn = false;
    }
    }



  7. This next step, you need to find your createText() function (or something similar such as drawText). The code inside this function calls the createFontString method. It should be easy to find, if you organize your functions.


  8. You will need to add this code inside the createText function.
        
    level.result += 1;
    textElem setText(text);
    level notify("textset");

    textElem is the name of the local element. This is not the actual name of the text element! (such as self.title or self.menu.options, etc)


  9. Next, under the init() function (which is usually in main), create a new level variable called result and set the value to 0.
        
    level.result = 0;

    You must login or register to view this content.


  10. Next, we will go into the overflow script again. Find this code in the overflowfix function You must login or register to view this content.


  11. player.menu.open is a boolean. It refers to the variable that checks whether or not the menu is open. It must be player and NOT self! Depending on the menu you use, the variable name will change. For Surge menu base, usually the variable is player.surge["menu"]["active"]. Change the name of the variable to the correct name, that your menu uses, and make sure the condition is true. You don't want the text to recreate when your out of the menu.


  12. The next and final step can be a little confusing, but it's the last step. In the recreatetext() function you will need to call the function that draws your options on the screen (such as submenu). self.curMenu and self.curTitle are 2 custom variables created that when submenu() is called, sets them to hold the current name of the menu and the current title of the menu. Surge, I believe, does not have the self.curTitle variable. So you will need to just create a variable to hold the current name of the menu, so submenu() knows which menu to open when recreatetext() is called.

    For surge menu base, just call self updatehud(); under recreateText()

    Think of it like this:

    You are inside the menu, in the "admin menu".
    The max amount of strings has been reached, so recreatetext() is called. All the text elements have been deleted.
    Recreatetext will then call submenu(menuname, titletext) with either 1 or 2 parameters (it just depends on the base).
    Your current menu options have been re-drawn to the screen.
    This occurs on a continuous loop of just deleting text, and redrawing the elements.

    You should not do this with anything other than text elements.



There you have it! You've successfully added the overflow fix to your menu!
Credits:

Jwm614
TheFallen
dtx12
Craig Christ
Shark
xTurntUpLobbies
YouViolateMe
JokerRey


You can add me on skype: nlovett218 if you have any questions. Thank you!
(adsbygoogle = window.adsbygoogle || []).push({});

The following 13 users say thank you to Im_YouViolateMe for this useful post:

/SneakerStreet/, FRINZ, BullyWiiPlaza, DF_AUS, Dj33dj33, EternalHabit, HiddenHour, iiioM, ksa_7ooo7, Patrick, Skonafid, V--JR7, Vondy Supreme
03-08-2015, 09:22 PM #2
Dj33dj33
Little One
not work on Zeikkens Base guys :( !!! xD thanks for the tutorial
03-08-2015, 09:35 PM #3
Im_YouViolateMe
NextGenUpdate Elite
Originally posted by Dj33dj33 View Post
not work on Zeikkens Base guys :( !!! xD thanks for the tutorial


Yes it does, I'm taking a look at it now.

self.MenuOpen is the menu boolean.

self.Menu.System["MenuRoot"] is the current menu variable

but Since ZeiiKens menu base doesn't have a create text function, you will need to edit LoadMenu and SubMenu. see where it has createFontString? take that and put it into a function called createText, and just call createText. then do step 8.

but do that for both the title and text. use createText for both the title and option text.
03-09-2015, 03:11 PM #4
EternalHabit
Former Staff
Originally posted by YouViolateMe View Post

You must login or register to view this content.
You must login or register to view this content.
(Shrek is love, shrek is life.)

Overflow fix originally by:[/size]
jwm614[/size]

Working overflow fix created by:[/size]
xTurntUpLobbies[/size]

Let's Begin!



Requirements


  • GSC Studio


  • A working mod menu with no syntax errors, and does not already have any overflow fix added.


  • The overflow fix code: You must login or register to view this content.


  • Some knowledge of Game Script Code


  • A brain



Tutorial

Ok so in this tutorial, I will be using the White Water Base. I know it already has the overflow fix incorporated, but I will be taking it out (as if it was a clean base with no overflow fix). I will also be detailing how to add this overflow fix to TheFallen's base. Let's get started.


  1. Open up GSC Studio. Locate your project, if it is not already opened.


  2. Create a new script and call it anything you want (such as overflowfix, xTUL_overflow, antioverflow, etc.) You must login or register to view this content.


  3. Go to the link with the overflow fix (You must login or register to view this content.), and paste in the code in the newly created script.


  4. It should now look like this: You must login or register to view this content.


  5. Here comes the fun part, getting it to support your base. If you are using shark's base, or my base, then this should be easy for you. If you are using TheFallen's then it might be tricky (due to how advanced the coding is in his menu)


  6. Firstly, what you want to do is write this code under onPlayerSpawned. It must be only called once by the host. This is what initiates/starts the overflow fix. You will need to create a boolean called isFirstSpawn before this code is called, and the boolean needs to be created before the for loop statement, so it doesn't always set to false.
        
    if(isFirstSpawn)
    {
    if (self isHost())
    {
    thread overflowfix();
    }
    isFirstSpawn = false;
    }



  7. This next step, you need to find your createText() function (or something similar such as drawText). The code inside this function calls the createFontString method. It should be easy to find, if you organize your functions.


  8. You will need to add this code inside the createText function.
        
    level.result += 1;
    textElem setText(text);
    level notify("textset");

    textElem is the name of the local element. This is not the actual name of the text element! (such as self.title or self.menu.options, etc)


  9. Next, under the init() function (which is usually in main), create a new level variable called result and set the value to 0.
        
    level.result = 0;

    You must login or register to view this content.


  10. Next, we will go into the overflow script again. Find this code in the overflowfix function You must login or register to view this content.


  11. player.menu.open is a boolean. It refers to the variable that checks whether or not the menu is open. It must be player and NOT self! Depending on the menu you use, the variable name will change. For Surge menu base, usually the variable is player.surge["menu"]["active"]. Change the name of the variable to the correct name, that your menu uses, and make sure the condition is true. You don't want the text to recreate when your out of the menu.


  12. The next and final step can be a little confusing, but it's the last step. In the recreatetext() function you will need to call the function that draws your options on the screen (such as submenu). self.curMenu and self.curTitle are 2 custom variables created that when submenu() is called, sets them to hold the current name of the menu and the current title of the menu. Surge, I believe, does not have the self.curTitle variable. So you will need to just create a variable to hold the current name of the menu, so submenu() knows which menu to open when recreatetext() is called.

    For surge menu base, just call self updatehud(); under recreateText()

    Think of it like this:

    You are inside the menu, in the "admin menu".
    The max amount of strings has been reached, so recreatetext() is called. All the text elements have been deleted.
    Recreatetext will then call submenu(menuname, titletext) with either 1 or 2 parameters (it just depends on the base).
    Your current menu options have been re-drawn to the screen.
    This occurs on a continuous loop of just deleting text, and redrawing the elements.

    You should not do this with anything other than text elements.



There you have it! You've successfully added the overflow fix to your menu!
Credits:

Jwm614
TheFallen
dtx12
Craig Christ
Shark
xTurntUpLobbies
YouViolateMe
JokerRey


You can add me on skype: nlovett218 if you have any questions. Thank you!


Underrated thread lol

The following user thanked EternalHabit for this useful post:

Im_YouViolateMe
03-10-2015, 08:42 AM #5
ksa_7ooo7
Maggbot timeout!
thanks a lot my friend but i have not understood >
It will better if you do it in short video please :(
03-10-2015, 06:38 PM #6
MrToxlcBooty
I defeated!
Originally posted by Dj33dj33 View Post
not work on Zeikkens Base guys :( !!! xD thanks for the tutorial

it works on anything... its literally adding a variable and it deletes at a certain number a monkey could do it...
03-10-2015, 06:57 PM #7
Dj33dj33
Little One
Originally posted by MrToxlcBooty View Post
it works on anything... its literally adding a variable and it deletes at a certain number a monkey could do it...


No, Jwm614 Tryed.. JokeyRey Tryed.. YouViolateMe Tryed.. Nothing works we have tryed some methods..
When you get it try first some rounds and make ingame a fast restart The result goes high and you get freeze..
03-10-2015, 07:53 PM #8
Originally posted by YouViolateMe View Post

You must login or register to view this content.
You must login or register to view this content.
(Shrek is love, shrek is life.)

Overflow fix originally by:[/size]
jwm614[/size]

Working overflow fix created by:[/size]
xTurntUpLobbies[/size]

Let's Begin!



Requirements


  • GSC Studio


  • A working mod menu with no syntax errors, and does not already have any overflow fix added.


  • The overflow fix code: You must login or register to view this content.


  • Some knowledge of Game Script Code


  • A brain



Tutorial

Ok so in this tutorial, I will be using the White Water Base. I know it already has the overflow fix incorporated, but I will be taking it out (as if it was a clean base with no overflow fix). I will also be detailing how to add this overflow fix to TheFallen's base. Let's get started.


  1. Open up GSC Studio. Locate your project, if it is not already opened.


  2. Create a new script and call it anything you want (such as overflowfix, xTUL_overflow, antioverflow, etc.) You must login or register to view this content.


  3. Go to the link with the overflow fix (You must login or register to view this content.), and paste in the code in the newly created script.


  4. It should now look like this: You must login or register to view this content.


  5. Here comes the fun part, getting it to support your base. If you are using shark's base, or my base, then this should be easy for you. If you are using TheFallen's then it might be tricky (due to how advanced the coding is in his menu)


  6. Firstly, what you want to do is write this code under onPlayerSpawned. It must be only called once by the host. This is what initiates/starts the overflow fix. You will need to create a boolean called isFirstSpawn before this code is called, and the boolean needs to be created before the for loop statement, so it doesn't always set to false.
        
    if(isFirstSpawn)
    {
    if (self isHost())
    {
    thread overflowfix();
    }
    isFirstSpawn = false;
    }



  7. This next step, you need to find your createText() function (or something similar such as drawText). The code inside this function calls the createFontString method. It should be easy to find, if you organize your functions.


  8. You will need to add this code inside the createText function.
        
    level.result += 1;
    textElem setText(text);
    level notify("textset");

    textElem is the name of the local element. This is not the actual name of the text element! (such as self.title or self.menu.options, etc)


  9. Next, under the init() function (which is usually in main), create a new level variable called result and set the value to 0.
        
    level.result = 0;

    You must login or register to view this content.


  10. Next, we will go into the overflow script again. Find this code in the overflowfix function You must login or register to view this content.


  11. player.menu.open is a boolean. It refers to the variable that checks whether or not the menu is open. It must be player and NOT self! Depending on the menu you use, the variable name will change. For Surge menu base, usually the variable is player.surge["menu"]["active"]. Change the name of the variable to the correct name, that your menu uses, and make sure the condition is true. You don't want the text to recreate when your out of the menu.


  12. The next and final step can be a little confusing, but it's the last step. In the recreatetext() function you will need to call the function that draws your options on the screen (such as submenu). self.curMenu and self.curTitle are 2 custom variables created that when submenu() is called, sets them to hold the current name of the menu and the current title of the menu. Surge, I believe, does not have the self.curTitle variable. So you will need to just create a variable to hold the current name of the menu, so submenu() knows which menu to open when recreatetext() is called.

    For surge menu base, just call self updatehud(); under recreateText()

    Think of it like this:

    You are inside the menu, in the "admin menu".
    The max amount of strings has been reached, so recreatetext() is called. All the text elements have been deleted.
    Recreatetext will then call submenu(menuname, titletext) with either 1 or 2 parameters (it just depends on the base).
    Your current menu options have been re-drawn to the screen.
    This occurs on a continuous loop of just deleting text, and redrawing the elements.

    You should not do this with anything other than text elements.



There you have it! You've successfully added the overflow fix to your menu!
Credits:

Jwm614
TheFallen
dtx12
Craig Christ
Shark
xTurntUpLobbies
YouViolateMe
JokerRey


You can add me on skype: nlovett218 if you have any questions. Thank you!


Btw, every player need to call the fix init.
03-10-2015, 08:39 PM #9
Im_YouViolateMe
NextGenUpdate Elite
Originally posted by maxiking913 View Post
Btw, every player need to call the fix init.


Actually, no. Doing that would cause the overflow fix thread to run multiple times causing errors, possible freezing, and instability. You only need to do it once....
03-10-2015, 08:42 PM #10
Im_YouViolateMe
NextGenUpdate Elite
Originally posted by Dj33dj33 View Post
No, Jwm614 Tryed.. JokeyRey Tryed.. YouViolateMe Tryed.. Nothing works we have tryed some methods..
When you get it try first some rounds and make ingame a fast restart The result goes high and you get freeze..


Then just don't restart. That shouldn't do that anyways because all HUD elements are reset and all variables are reset when the game ends or is restarted.

It's the code that causes you to freeze, or maybe you are injecting from an already compiled gsc file.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo