Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu crashing after 512 menu items #2

Open
Jek47 opened this issue Feb 24, 2023 · 9 comments
Open

Menu crashing after 512 menu items #2

Jek47 opened this issue Feb 24, 2023 · 9 comments
Assignees
Labels
Core Issue Issue with the core functionality of the Menu. WIP

Comments

@Jek47
Copy link

Jek47 commented Feb 24, 2023

Hi,

I've been developing a menu of my own for BO4 zombies using the Lucy Menu as a base for the last year or so, and was wondering if you could help with a problem I came across last night.

I want to create the most comprehensive menu out there for BO4z, with options for literally anything you can think of. Picking up specific craftable parts, teleport to precise locations, options to give any weapon available on the map, easter egg completions, etc etc. To that end, I think I've hit the limit for the number of self addOpt() lines you can have in a menu.

I noticed at around 500 or so menu options, the game would start giving me random UI errors whilst using the menu, on parts of the code that have worked fine for months. And once I exceed 512 menu options, the game just straight up crashes when you try to load a map after injecting.

I was hoping you had some idea how to get around this issue? I'm no programmer by any stretch of the imagination, but I recognise that 512 is the upper limit for 9-bit variables.

If not, this means that any menu using Lucy Menu as a base, will be limited to just 512 options, and I was going to have about 160 menu options for teleporting, alone! (20 per map). Plus 55 armory weapons, another 55 for PAP'd armory weapons, equipments, perks, elixirs, wonder weapons, auto-easter egg completions etc... 512 menu items ain't gonna be enough!

See for yourself, just keep adding:
self addOpt("BLANK MENU ITEM");
to your code, till the game breaks.

Thought I'd bring it to your attention as you seem to be the only person working on this menu base atm.

@TheUnknownCod3r
Copy link
Owner

I'm gonna assume it's memory related, but i'd need to look into it. I'm gonna keep this open, and I'll look at both the base itself and T7 Compiler, then let you know what I figure out. I haven't had this issue personally, but i've been trying to keep it compact while adding necessary features and fixing bugs mostly. If you would like to shoot me a message over discord too, I'd be happy to debug it with you! TheUnknownCoder#6310

@TheUnknownCod3r TheUnknownCod3r self-assigned this Feb 24, 2023
@TheUnknownCod3r TheUnknownCod3r added the Core Issue Issue with the core functionality of the Menu. label Feb 24, 2023
@Jek47
Copy link
Author

Jek47 commented Feb 24, 2023

Cheers, I've sent you a Discord fr.

@TheUnknownCod3r
Copy link
Owner

Can reproduce and confirm, and as we discussed via Discord, its an issue with the menu base, not the Injector. Im gonna keep this open in case I manage to fix it, but for right now its probably a won't fix, as i'll probably end up designing a new base for the menu in future. Issue temporarily locked, as im now aware of it.

Repository owner locked as resolved and limited conversation to collaborators Feb 26, 2023
@TheUnknownCod3r
Copy link
Owner

Im gonna unlock this and open for discussion, as im honestly unsure if i'll ever come across the error naturally, but I haven't forgotten it, im just looking into alternative ways to call the menu, or even draw it in general.

Repository owner unlocked this conversation Apr 7, 2023
@Jek47
Copy link
Author

Jek47 commented Apr 28, 2023

Hey, just thought I'd drop in and see if you'd had a chance to look any further into this? I kinda toyed with the idea of having a separate menu for each map to stay under the 512 threshold, but ultimately decided against it. It's kinda put a stop on me writing for BO4 any further.

I've noticed your menu is creeping close to 512 too.
image

Also, I was messing around trying to figure out some of the hashes earlier, since I noticed you figured out the spoon on BOTD, and found that the Riot Shield for the aether maps is: zhield_riot_dw :)

@TheUnknownCod3r
Copy link
Owner

Spork_alcatraz is the spork too, ;). I haven’t had a good chance to look into it lately due to moving, however I’ve been working in my off time on a rewrite of the base itself. The issue I’ve got is I still haven’t quite been able to figure out the cause for the crash, so I’m working pretty much blind.

@TheUnknownCod3r
Copy link
Owner

Can you give your code a shot and see if it works with the latest version of t7 compiler? Ive just done a test run there with a version of the menu that has 522 options, and it worked fine, not sure what that means :/

@Jek47
Copy link
Author

Jek47 commented May 3, 2023

After your previous reply I set about finding a way around the problem, and I now have a workaround that seems to be working for me. So unless the compiler has been updated in the last 24h, then it was still broken for me. I took a break scripting for a couple of months when I first came across this issue because it was driving me mad trying to figure it out, but I’ve started writing again this week.

I still don’t know why it was happening or what was causing it. The only thing that stopped the game crashing was removing any line that began “self addOpt”, and it didn’t matter where I removed them from either, which is the really confusing bit. Removing menu options for cheats, or for giving perks, or even weapons fixed it, as long as the total count was under 512.

To work around it, where before I had long lists of “self addOpt” lines, like for a list of weapons, or a list of locations to teleport to, instead of listing them all manually like:

self addOpt(“Location 1”, &teleportMeTo, origin, angles);
self addOpt(“Location 2”, &teleportMeTo, origin, angles);
etc…

I’ve just added all of the location’s names, origins and angles to an array, and said:

for(i=0;i<array.size;i++)
{
self addOpt(array[i][name], &teleportMeTo array[i][origin], array[i][angles]);
}

Which annoys the hell out of me because I still have the same number of menu options in the script, they’re just not written out manually… but whatever, it works for now. I guess you can close this issue if nobody else can replicate it anymore.

@TheUnknownCod3r
Copy link
Owner

That was actually one of the future changes I planned to make once everything in the menu was finished, lol. But yeah, it’s kinda weird that it works fine for me now, but I’m gonna keep it open for now until I’m certain it’s not gonna be an issue.

The update was just the one to fix the code injection, dunno why the version I’ve tested worked now, but it’s just the local copy I use for testing stuff, nothing different between that and the GitHub fork except for features I’m testing.

As I said, I’m still just looking into rewriting the code for the base, with moving and getting everything into place etc I haven’t had much time lately, so hopefully I’ll be able to sit down and have a good crack at it soon. It’s also open to others to look at if they want, I’m not gonna restrict progress anywhere if someone can fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Issue Issue with the core functionality of the Menu. WIP
Projects
None yet
Development

No branches or pull requests

2 participants