Post: Source Engine Mod Menu Base Overflow Errors
11-08-2015, 05:37 PM #1
BullyWiiPlaza
Climbing up the ladder
(adsbygoogle = window.adsbygoogle || []).push({}); I'm using the mod menu base You must login or register to view this content. and I'm still getting kicked due to String overflows. I'm not sure if it's broken by default or I broke it myself sometimes when editing. Enzo

Anyway, the overflow fix code is as follows:
    setupOverflowFixParameters()
{
level.result = 0;
level.isFirstSpawn = true;
}

initializeOverflowFix()
{
if(level.isFirstSpawn)
{
if (self isHost())
{
thread overflowFix();
}

level.isFirstSpawn = false;
}
}

recreateText()
{
self endon("disconnect");
self endon("death");

input = self.CurMenu;
title = self.CurTitle;

self thread submenu(input, title);
self thread doSourceHeart();
}

overflowFix()
{
level endon("game_ended");

level.test = createServerFontString("default", 1.5);
level.test setText("xTUL");
level.test.alpha = 0;

for(;Winky Winky
{
level waittill("textset");
if(level.result >= 40) // Decreased from 50 to do the overflow fix quicker
{
level.test clearAllTextAfterHudElem();
level.result = 0;

foreach(player in level.players)
{
if(player.menu.open)
{
player notify("failoverflow");
player recreateText();
}
}
}
wait 0.01;
}
}
I already changed the limit of 50 to 40 to run the overflow fix earlier/more frequently but I still got an overflow error.

I'm calling it as follows:
    init()
{
setupOverflowFixParameters(); // <-

level thread onPlayerConnected();
}

onPlayerConnected()
{
while(true)
{
level waittill("connecting", player);

player thread onPlayerSpawned();
}
}

onPlayerSpawned()
{
self endon("disconnect");
level endon("game_ended");

while(true)
{
self waittill("spawned_player");

initializeOverflowFix(); // <-
}
}

It's being used in the menu code here:
    doSourceHeart()
{
self endon("menu_exit");
self endon("destroyMenu");
self endon("failoverflow"); // <-

// ...
}

drawText(text, font, fontScale, align, relative, x, y, color, alpha, sort)
{
hud = self createFontString(font, fontScale);
hud setPoint( align, relative, x, y );
hud.color = color;
hud.alpha = alpha;
hud.hideWhenInMenu = true;
hud.sort = sort;

level.result += 1; // <-
hud setText(text);
level notify("textset");

return hud;
}

Why do I still get the error
    G_FindConfigstringIndex: overflow (48Cool Man (aka Tustin): 'Host Only'

where
    Host Only
is one of my sub menu names. The String referenced in the error message is different every time but always some text from the menu.

Thank you Smile
Last edited by BullyWiiPlaza ; 11-08-2015 at 06:08 PM.
11-09-2015, 04:32 AM #2
Adrian
Adrian is back!
Originally posted by BullyWiiPlaza View Post
I'm using the mod menu base You must login or register to view this content. and I'm still getting kicked due to String overflows. I'm not sure if it's broken by default or I broke it myself sometimes when editing. Enzo

Anyway, the overflow fix code is as follows:
    setupOverflowFixParameters()
{
level.result = 0;
level.isFirstSpawn = true;
}

initializeOverflowFix()
{
if(level.isFirstSpawn)
{
if (self isHost())
{
thread overflowFix();
}

level.isFirstSpawn = false;
}
}

recreateText()
{
self endon("disconnect");
self endon("death");

input = self.CurMenu;
title = self.CurTitle;

self thread submenu(input, title);
self thread doSourceHeart();
}

overflowFix()
{
level endon("game_ended");

level.test = createServerFontString("default", 1.5);
level.test setText("xTUL");
level.test.alpha = 0;

for(;Winky Winky
{
level waittill("textset");
if(level.result >= 40) // Decreased from 50 to do the overflow fix quicker
{
level.test clearAllTextAfterHudElem();
level.result = 0;

foreach(player in level.players)
{
if(player.menu.open)
{
player notify("failoverflow");
player recreateText();
}
}
}
wait 0.01;
}
}
I already changed the limit of 50 to 40 to run the overflow fix earlier/more frequently but I still got an overflow error.

I'm calling it as follows:
    init()
{
setupOverflowFixParameters(); // <-

level thread onPlayerConnected();
}

onPlayerConnected()
{
while(true)
{
level waittill("connecting", player);

player thread onPlayerSpawned();
}
}

onPlayerSpawned()
{
self endon("disconnect");
level endon("game_ended");

while(true)
{
self waittill("spawned_player");

initializeOverflowFix(); // <-
}
}

It's being used in the menu code here:
    doSourceHeart()
{
self endon("menu_exit");
self endon("destroyMenu");
self endon("failoverflow"); // <-

// ...
}

drawText(text, font, fontScale, align, relative, x, y, color, alpha, sort)
{
hud = self createFontString(font, fontScale);
hud setPoint( align, relative, x, y );
hud.color = color;
hud.alpha = alpha;
hud.hideWhenInMenu = true;
hud.sort = sort;

level.result += 1; // <-
hud setText(text);
level notify("textset");

return hud;
}

Why do I still get the error
    G_FindConfigstringIndex: overflow (48Cool Man (aka Tustin): 'Host Only'

where
    Host Only
is one of my sub menu names. The String referenced in the error message is different every time but always some text from the menu.

Thank you Smile


Thread has been moved to Black Ops 2 Mods and Scripts questions.
11-10-2015, 03:00 PM #3
EternalHabit
Former Staff
Originally posted by BullyWiiPlaza View Post
I'm using the mod menu base You must login or register to view this content. and I'm still getting kicked due to String overflows. I'm not sure if it's broken by default or I broke it myself sometimes when editing. Enzo

Anyway, the overflow fix code is as follows:
    setupOverflowFixParameters()
{
level.result = 0;
level.isFirstSpawn = true;
}

initializeOverflowFix()
{
if(level.isFirstSpawn)
{
if (self isHost())
{
thread overflowFix();
}

level.isFirstSpawn = false;
}
}

recreateText()
{
self endon("disconnect");
self endon("death");

input = self.CurMenu;
title = self.CurTitle;

self thread submenu(input, title);
self thread doSourceHeart();
}

overflowFix()
{
level endon("game_ended");

level.test = createServerFontString("default", 1.5);
level.test setText("xTUL");
level.test.alpha = 0;

for(;Winky Winky
{
level waittill("textset");
if(level.result >= 40) // Decreased from 50 to do the overflow fix quicker
{
level.test clearAllTextAfterHudElem();
level.result = 0;

foreach(player in level.players)
{
if(player.menu.open)
{
player notify("failoverflow");
player recreateText();
}
}
}
wait 0.01;
}
}
I already changed the limit of 50 to 40 to run the overflow fix earlier/more frequently but I still got an overflow error.

I'm calling it as follows:
    init()
{
setupOverflowFixParameters(); // <-

level thread onPlayerConnected();
}

onPlayerConnected()
{
while(true)
{
level waittill("connecting", player);

player thread onPlayerSpawned();
}
}

onPlayerSpawned()
{
self endon("disconnect");
level endon("game_ended");

while(true)
{
self waittill("spawned_player");

initializeOverflowFix(); // <-
}
}

It's being used in the menu code here:
    doSourceHeart()
{
self endon("menu_exit");
self endon("destroyMenu");
self endon("failoverflow"); // <-

// ...
}

drawText(text, font, fontScale, align, relative, x, y, color, alpha, sort)
{
hud = self createFontString(font, fontScale);
hud setPoint( align, relative, x, y );
hud.color = color;
hud.alpha = alpha;
hud.hideWhenInMenu = true;
hud.sort = sort;

level.result += 1; // <-
hud setText(text);
level notify("textset");

return hud;
}

Why do I still get the error
    G_FindConfigstringIndex: overflow (48Cool Man (aka Tustin): 'Host Only'

where
    Host Only
is one of my sub menu names. The String referenced in the error message is different every time but always some text from the menu.

Thank you Smile

why not just keep it the way it was in the base? it worked fine. Also you might not want to use while(true) for onplayerspawned and onplayerconnect

edit: if your using level.isfirstspawn, when someone spawns before you, you wont be able to call on the overflow fix
Last edited by EternalHabit ; 11-10-2015 at 03:03 PM.

The following user thanked EternalHabit for this useful post:

BullyWiiPlaza
11-10-2015, 06:09 PM #4
Exelo
Banned
Originally posted by xTurntUpLobbies View Post
why not just keep it the way it was in the base? it worked fine. Also you might not want to use while(true) for onplayerspawned and onplayerconnect

edit: if your using level.isfirstspawn, when someone spawns before you, you wont be able to call on the overflow fix


Not true. He will be able even if a player spawn before or after you.
Would just have to switch "level.isFirstSpawn = false;" inside if(self isHost())

call setupOverflowFixParameters that way : level thread setupblablabla.
Might fix your probs.

else take "level.result = 0; level.isFirstSpawn = true;" and put them in init.
Why make a thread just for it ? Waste of space.
11-10-2015, 06:20 PM #5
BullyWiiPlaza
Climbing up the ladder
Originally posted by xTurntUpLobbies View Post
why not just keep it the way it was in the base? it worked fine. Also you might not want to use while(true) for onplayerspawned and onplayerconnect

edit: if your using level.isfirstspawn, when someone spawns before you, you wont be able to call on the overflow fix

I just made it more structured, sorry. Thanks for replying :s

Also yes, I think you found the problem so I changed the code to the following:
    initializeOverflowFix()
{
if(level.isFirstSpawn)
{
if (self isHost())
{
thread overflowFix();
level.isFirstSpawn = false; // <-
}
}
}

Originally posted by Exelo View Post

Why make a thread just for it ? Waste of space.

It's ignorant to say that a thread is a waste of space like who cares really? There are 100's of useless noob threads and this one is easily one of the better ones. Thanks for your help though Smile
Last edited by BullyWiiPlaza ; 11-10-2015 at 06:30 PM.
11-11-2015, 06:26 AM #6
Exelo
Banned
Originally posted by BullyWiiPlaza View Post
I just made it more structured, sorry. Thanks for replying :s

Also yes, I think you found the problem so I changed the code to the following:
    initializeOverflowFix()
{
if(level.isFirstSpawn)
{
if (self isHost())
{
thread overflowFix();
level.isFirstSpawn = false; // <-
}
}
}


It's ignorant to say that a thread is a waste of space like who cares really? There are 100's of useless noob threads and this one is easily one of the better ones. Thanks for your help though Smile


Lol I was actually talking about your script where you set setupOverflowFixParameters() as a thread which is useless and take space for nothing
    setupOverflowFixParameters()
{
level.result = 0;
level.isFirstSpawn = true;
}
11-11-2015, 01:02 PM #7
BullyWiiPlaza
Climbing up the ladder
Originally posted by Exelo View Post
Lol I was actually talking about your script where you set setupOverflowFixParameters() as a thread which is useless and take space for nothing
    setupOverflowFixParameters()
{
level.result = 0;
level.isFirstSpawn = true;
}

It's not threaded but an own function to keep the file more clean. Space is not the only thing that counts, also readability. It's not really a waste of space, it's a better idea to remove silly/buggy scripts or shortening long/spammy scripts instead if you want to save space which has a much greater effect. Also, you can inject into multiple GSCs so space for scripts becomes literally unlimited.
Last edited by BullyWiiPlaza ; 11-11-2015 at 01:05 PM.
11-12-2015, 12:15 AM #8
Exelo
Banned
Originally posted by BullyWiiPlaza View Post
It's not threaded but an own function to keep the file more clean. Space is not the only thing that counts, also readability. It's not really a waste of space, it's a better idea to remove silly/buggy scripts or shortening long/spammy scripts instead if you want to save space which has a much greater effect. Also, you can inject into multiple GSCs so space for scripts becomes literally unlimited.


Someone who use a base isn't able to read so readability is useless.
If you were able to read the scripts / base ; this NGU thread wouldn't be created in the first place.

and no; if you inject too much files you'll overwrite the memory there's a limit. Depent about how much Byte you can use.
11-12-2015, 12:36 AM #9
jwm614
NextGenUpdate Elite
Originally posted by BullyWiiPlaza View Post
It's not threaded but an own function to keep the file more clean. Space is not the only thing that counts, also readability. It's not really a waste of space, it's a better idea to remove silly/buggy scripts or shortening long/spammy scripts instead if you want to save space which has a much greater effect. Also, you can inject into multiple GSCs so space for scripts becomes literally unlimited.


space does count u only have a limited amount of free space to inject my gsc modifier is the only injector that can inject more into memory(470kb/820kb)

all other injector are limited to 320kb no matter if its one gsc or multi gsc

The following user thanked jwm614 for this useful post:

Exelo
11-12-2015, 08:46 AM #10
BullyWiiPlaza
Climbing up the ladder
Originally posted by Exelo View Post
Someone who use a base isn't able to read so readability is useless.
If you were able to read the scripts / base ; this NGU thread wouldn't be created in the first place.

Lol, I was just wondering why it didn't work since I thought that I did it right but missed this one detail. About the ability to read code: I might be at least as good as you, alright? I almost have a degree in computer science while you're some random CoD modder kid who made an entire menu with just copied and pasted scripts alright (Red Dot City)? Better follow your own advice.
Originally posted by jwm614 View Post
space does count u only have a limited amount of free space to inject my gsc modifier is the only injector that can inject more into memory(470kb/820kb)

all other injector are limited to 320kb no matter if its one gsc or multi gsc

Well, I use my own injector so my statement probably holds.
Last edited by BullyWiiPlaza ; 11-12-2015 at 08:59 AM.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo