(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.
- Open up GSC Studio. Locate your project, if it is not already opened.
- 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.
- 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.
- It should now look like this: You must login or register to view this content.
- 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)
- 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;
}
}
- 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.
- 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)
- 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.
- 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.
- 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.
- 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!