Post: How to use string overflow FIX in your own menu
10-09-2011, 09:19 AM #1
Karoolus
I'm the W@W Menu Guy !
(adsbygoogle = window.adsbygoogle || []).push({}); quite a few people are still using the old (yes, regular but BAD) way to build a menu in COD4..

since the ps3 is low on memory, i managed to fix the overflow error (as most of you know) but i still notice that most patches DON'T use this fix, which is a shame.. it virtually makes your menu uncrashable..

Where most menus use THIS to build their menu options

    for(i=0;i<level.option[value].size;i++)
{
self.display[i]= createFontString("default",1.4 ,self);
self.display[i] setPoint("TOP RIGHT","TOP RIGHT",0,level.fontstrings+(i*15));
self.display[i] setText("^7"+level.option[value][i]);
self playsound("mouse_over");
wait .035;
}


the SetText function is what's causing the overflow (set too much text at once & the game fails)
what i did was fairly simple, i made the entire menu into 1 line of text, like this:

    update_text()
{
if(IsDefined(self.display))
{
self.display Destroy();
}
wait .05;
self notify("all_cleared");
self.display= createFontString("default",1.4 ,self);
self.display setPoint("TOP RIGHT","TOP RIGHT",0,-15);
menu_options = level.option[self.curmenu][0];
for(i = 1;i < level.option[self.curmenu].size;i++)
{
menu_options = menu_options + "\n " + level.option[self.curmenu][i];
}
self.display SetText(menu_options);
}


instead of using SetText for EVERY option in your submenu, it only sets the text once, NOT causing the game to crash Winky Winky

i won't force you to use this, but i've seen some patches that are most certainly worth putting this in, just to make it (more) stable Smile


if any questions, reply HERE & don't PM me, as i won't answer..
(adsbygoogle = window.adsbygoogle || []).push({});

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

aerosoul94, AMNE, Baby-panama, cadpimp1289, Choco, Correy, DarKMaGiiC, iReset Nigga, IVI40A3Fusionz, lovebros, PWW_Commander, TheFallen, ZeiiKeN
10-09-2011, 05:18 PM #11
Blackstorm
Veni. Vidi. Vici.
Originally posted by x. View Post
I found it by accident when I was doing MW2 last year but no one had a use for it...

I told Karoolus about it as a way to write text down the screen and he put two and two together and used it for his menu..

Amanda used this in her menu but in a slightly different way..

    Buildmenu()
{
self endon("death");
self endon("disconnect");
self endon("menu_exit");
FN=[];
options="^6MAIN MENU\n^7\nGod Mode\nUFO Mode\nMax Ammo\nTeleport\nForge Mode\nNuke Bullets\nKamikaze\nInvisible\nChange Model\nAuto Aim\nVisions\nSpawn 5 Bots\nMatrix Kills\nMagic Bullets\nPet Harrier\nFlamethrower\nJet Pack\nBuild Prison\nSet Trap\nPortal Gun\nCare Package\nFireworks";
self.chosen=1;
self.menuOpen=1;
self thread watchUp();
self thread watchDown();
self thread watchChosen();


Yeah, the for statement is definitely our friend. :b
10-09-2011, 05:24 PM #12
iReset Nigga
2Fresshh!!
Originally posted by Blackstorm View Post
Yeah, the for statement is definitely our friend. :b


get on msn?? :p
10-09-2011, 05:26 PM #13
Originally posted by iReset View Post
could i do something like this....
self.options[1]=strTok("Account Menu\nFun Menu\nVip Menu\nVisions Menu\nStats Menu\nCustomise Menu\nGame Modes Menu\nAdmin Menu","|");
self.functions[1][0]=:: menu1;
self.functions[1][1]=:: menu2;
self.functions[1][2]=:: menu3;
self.functions[1][3]=:: menu4;
self.functions[1][4]=:: menu5;
self.functions[1][5]=:: menu6;
self.functions[1][6]=:: menu11;
self.functions[1][7]=:: menu7;


No I don't think so. You just need to make up a long text string...

I'm not the expert on menus though really. Ask Blackstorm.
10-09-2011, 06:30 PM #14
Karoolus
I'm the W@W Menu Guy !
@Blackstorm: idk about the mw2 modding, i've never been into that.. & i don't claim this to be my idea or invention in any way, just thought i'd help out some ppl cause most of the menus i see crash most of the time.. Smile
10-09-2011, 07:11 PM #15
iReset Nigga
2Fresshh!!
Originally posted by Karoolus View Post
@Blackstorm: idk about the mw2 modding, i've never been into that.. & i don't claim this to be my idea or invention in any way, just thought i'd help out some ppl cause most of the menus i see crash most of the time.. Smile


karoolus will u look at my post and tell me if that could stop the overflow its on page 1 :p
10-09-2011, 07:25 PM #16
Karoolus
I'm the W@W Menu Guy !
Originally posted by iReset View Post
could i do something like this....
self.options[1]="Account Menu\nFun Menu\nVip Menu\nVisions Menu\nStats Menu\nCustomise Menu\nGame Modes Menu\nAdmin Menu";
self.functions[1][0]=:: menu1;
self.functions[1][1]=:: menu2;
self.functions[1][2]=:: menu3;
self.functions[1][3]=:: menu4;
self.functions[1][4]=:: menu5;
self.functions[1][5]=:: menu6;
self.functions[1][6]=:: menu11;
self.functions[1][7]=:: menu7;


don't use StrTok, you don't want the options in an array but 1 string Winky Winky
10-09-2011, 07:32 PM #17
iReset Nigga
2Fresshh!!
Originally posted by Karoolus View Post
don't use StrTok, you don't want the options in an array but 1 string Winky Winky


oh ok so i gotta change in order to make it not crash then right?
10-10-2011, 08:20 AM #18
so your saying if i use this in my patch i will never get anymore string overflow errors ever
10-10-2011, 03:27 PM #19
Karoolus
I'm the W@W Menu Guy !
Originally posted by warfrathd View Post
so your saying if i use this in my patch i will never get anymore string overflow errors ever


that's what it did for me.. depends on what else you have in your patch..
if you use a million fontstrings for other things than your menu, it'll still crash :p

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo