eyza-cod2 / zpam3

Mod zPAM3.33 is remastered version of zPAM2.07 for COD2
51 stars 5 forks source link

Mod folder fs_game #13

Open hoesman opened 1 year ago

hoesman commented 1 year ago

Man can you put each mod version in its own fs_game folder like it used to be, the mod in the main folder is a fucking joke you cant join servers without getting "Impure Client Detected" from all the various versions 322, 331, public server with its modified version, annoying as fuck, not to mention all the different map fix versions.. Also upon downloading the mod for the first time the game freezes and crashes, that has been since you started working on this and never happened before zpam 3.0 or the older 2.07

eyza-cod2 commented 1 year ago

Problem with mod folder an fs_game in COD2 is that player's cvars changed in game wont get saved into config. Im using custom settings and i want them to be saved to the next game restart.

I know its very pitty and i hate it too, but im not able to save custom settings in any other way.

hoesman commented 1 year ago

They do save tho, you need to have execClientCommand( "writeconfig config_mp.cfg" ); after the changes with "setClientCvar" and the cvars save in the config thats in the mod folder

eyza-cod2 commented 1 year ago

I was considering it too, but in that way it wont replace the original config file in main/players/{name}/ folder and you would have to execute the config manually every time player connect. Ant it brings a lot of other problems.

hoesman commented 1 year ago

Why would you replace config from main anyways (its a good backup)? When you connect to a server with fs_game set the config from main is copied to that folder and used alongside that mod only, I dont understand "execute the config manually every time player connect"? Which other problems? Also which cvars are even needed to be persistent? The quickmessage ones, cvar forces and? My config for example is read-only so nothing is written and dont have any issues.

eyza-cod2 commented 1 year ago

When you connect a server with fs_mode set, config from main folder is used instead; config may be coppied into mods folder, but its pointless because the game never loads it (unless players run their game with fs_mode set, wich nobody does).

When you run a game, config from main folder is loaded. When you connect a server with fs_game set, mod folder is created and config is copied from main folder to mods folder. Every change to cvars is saved to config in mods folder, as expected.

When you run a game again later, config from main folder is loaded. When you connect a server with fs_game set, config from main folder is copied again replacing all changes you made in previous game session in mods folder.

Because of this game bug, its not possible to save cvar settings normal way as you would expect. Im aware of read-only configs, but then it just wont save the changes for people doing it. I think people are doing this read-only staff because of the problem i described above - config keep changing from main folder.

Im saving custom pam settings into archivable cvar /server16. If there is better way how to do it, im all in, but right now i didnt found better solution.

hoesman commented 1 year ago

You are wrong, the config from main is copied only once when the mod folder is created/downloaded and never again. Try it. Have a config_mp in main with empty server16, connect to server with fs_game zpamxx, the server16 cvar is then in that zpamxx/players/name/config_mp.cfg.

So here is what you do: when the cvar is changed, say toggle recording off, and you have the execClientCommand( "writeconfig config_mp.cfg" ); and that config is then in zpamxx/ folder instead since I dont know if you can get the profile name, but this works, you quit, connect again to that same fs_game and recording remains off

eyza-cod2 commented 1 year ago

You are right, the game tries to load config_mp.cfg from mods folder when player connects. I think it should load the config from players/{name}/ folder, but it does not.. When there is no config created yet, it prints "couldn't exec config_mp.cfg" Now i see why execClientCommand( "writeconfig config_mp.cfg" ); will save the settings and the game automatically loads them. Btw this config is beeing executed only when client's fs_game does not match with server's fs_game.

Anyway, this method brings following problems:

So Im still not sure about this method. This game works perfetly with main folder. Yes, it brings another problems with "Impure client detected errors" etc, but its solveable easly by allowing download. I never experienced that the game would crash. Also considering that alot of public servers also uses main folder, main folder is already a mess and its too late for changes. Developers of the game must notice this bug when developing COD4, because its handling configs and mods differently.