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

Bot match settings reset after game restart #64

Open
xXRaptorSc0pezXx opened this issue Jan 22, 2023 · 4 comments
Open

Bot match settings reset after game restart #64

xXRaptorSc0pezXx opened this issue Jan 22, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@xXRaptorSc0pezXx
Copy link

xXRaptorSc0pezXx commented Jan 22, 2023

Whenever I restart the game, the bot match settings don't save, they always just revert to 5 bots, 50 minimum skill, 100 maximum skill. Sauer saves these settings by default but after installing p1x they no longer save.

@sauerbraten sauerbraten added the bug Something isn't working label Jan 23, 2023
@sauerbraten
Copy link
Owner

Interesting, I would expect the settings to be saved the same way. Can you try /usep1xbratenmenus 0, then change the bot match settings, quit, re-open and see if they are saved then?

@xXRaptorSc0pezXx
Copy link
Author

Just tried it but it still doesn't save them with the p1x menus off. It does however work when not using p1x at all (so just using the vanilla client).

@sauerbraten
Copy link
Owner

the problem is the timeline of executing the cubescript files:

  1. p1xbraten (like vanilla) always runs menus.cfg before any config files, and menus.cfg sets the default values for the botmatch parameters
  2. p1xbraten (like vanille) then executes config.cfg, which contains the values from last time the user interacted with the GUI, so these values are "restored" from the config
  3. p1xbraten runs its p1xbraten.cfg which contains usep1xbratenmenus (0 or 1, doesn't matter), and when that variable is changed, a function runs that executed either menus.cfg or data/p1xbraten/menus.cfg, and since both of these files contain the default values, the values from config.cfg are overwritten again

I think the fix here is to change usep1xbratenmenus from a VARFP to a pure C++ variable and a COMMAND with emuvar behavior...

@sauerbraten
Copy link
Owner

I'm pretty sure this will be fixed upstream by Nieb's menu overhaul.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants