PDA

View Full Version : Bypass max menus precached error



Ni3ls
12th August 2014, 07:23
******* script runtime error *******
Too many menus precached. Max allowed menus is 32

I need all the menus and all the menus are scriptmenus. Is there a way to fix this error and to have more menus? In the limits thread you were talking about 64 menus.

serthy
12th August 2014, 07:45
two suggestions:

reuse your menues (show/hide on dvar)
maybe multiple menus in one file

Ni3ls
12th August 2014, 07:52
Do I need to precache every menu? And I read somewhere about Loadmenu() but I cant find that anymore. This limit really sucks :(

Mitch
12th August 2014, 09:57
Do I need to precache every menu? And I read somewhere about Loadmenu() but I cant find that anymore. This limit really sucks :(

It appears they increased this limit after 1.0.
Edit: 1.3 is also limited to 32.


Selbie told me there is 32 limit of newHudElem and 32 of newClientHudElem.

And why 64 menus? On 1.0:

******* script runtime error *******
Too many menus precached. Max allowed menus is 32

Also use functions in menus. It will save you a lot of time when you want to reuse menus.
http://killtube.org/showthread.php?1082-CoD2-create-functions-in-menu-files!

Edit 2: I could try to increase the limit by changing hex values in the binary (this might cause problems)



int __cdecl sub_8110EC2()
{
int v1; // eax@13
char dest; // [sp+10h] [bp-418h]@4
char s[4]; // [sp+418h] [bp-10h]@1
int i; // [sp+41Ch] [bp-Ch]@1

*(_DWORD *)s = sub_808456A(0);
for ( i = 0; i <= 31; ++i )
{
sub_809107E(i - 34, &dest, 1024);
if ( !sub_80B5620(&dest, *(_DWORD *)s) )
return sub_8060B7C("Script tried to precache the menu '%s' more than once\n", s[0]);
}
for ( i = 0; ; ++i )
{
if ( i <= 31 )
{
sub_809107E(i - 34, &dest, 1024);
if ( dest )
continue;
}
break;
}
if ( i == 32 )
{
v1 = sub_80B59CE("Too many menus precached. Max allowed menus is %i", 32);
sub_8084DB4(v1);
}
return sub_8090E6C(i - 34, *(char **)s);
}


I uploaded a hexed version to 64. (untested)
(changed 32 to 64, 31 to 63)

Ni3ls
12th August 2014, 12:58
Can you also patch the windows file so i can test at home?

Mitch
12th August 2014, 13:55
Can you also patch the windows file so i can test at home?

(backup included)

Edit: and again untested

Ni3ls
12th August 2014, 14:18
Works like a charm!

Mitch
12th August 2014, 14:35
Works like a charm!

Have you tested the last menu that you added? (menu 33)

(i thought it might crash because array where it saves the menu names overflows)

Ni3ls
27th September 2014, 13:18
Didnt saw this reply, but I dont get any error now. Im going over the 32 menus now :P

php
28th September 2014, 07:41
I think he's asking whether the menu's actually work and if it doesn't just overwrite other CS_* indexes of the configstrings and pretty sure this max menu value is hardcoded in the client aswell.

Ni3ls
29th September 2014, 20:06
Ah im almost done implementing them and then I will reply with the answer ;)