AutoModpack icon indicating copy to clipboard operation
AutoModpack copied to clipboard

Patch files

Open Hiusi opened this issue 1 year ago • 12 comments

Hi, I have been enjoying your mod! However, I encountered a problem. How can I set a custom default server keybind instead of using the default keybinds from the mod? For example, if I add more mods that introduce new keybinds, I want all players to replace their options.txt file once if there are changes. After that, players can customize it themselves.

I tried using the following configuration:

"allowEditsInFiles": [
    "/config/voicechat/*",
    "/options.txt",
    "/config/*",
    "!/config/excludeThisFile"
  ],

However, the client keybinds are still set to the mod's defaults, not from the options.txt file in automodpack/host-modpack/main/options.txt. When adding new mods that introduce hotkeys, some players experience conflicts because the keybinds default to the mod's settings, even though I already updated the options.txt in automodpack.

Hiusi avatar Aug 04 '24 07:08 Hiusi

I was just struggling with this trying to find a solution. It would be nice if there was some sort of feature to allow updating specific lines of text documents, but not sure how that would work.

I believe that many keybinds are only specified is options.txt if they are changed by the player manually, so maybe some way to specify only to push lines of the server's options.txt if the client's options.txt doesn't already contain a line specifying the option.

I don't know if that would be too complex to implement, but it would be nice!

danjustice2 avatar Aug 04 '24 08:08 danjustice2

I also want to know how, I have 100+ mods and it goes too complex to tell my players specifics keybind, I hope for solution

kusayu avatar Aug 04 '24 09:08 kusayu

Yes that's something which can't be really done by automodpack yet. It's because editable files to actually be editable are downloaded only once so player can edit them.

There are three solutions I can think of:

  • Reset modpack function by e.g. some gui button which would reset editable files to the latest provided by server (easy to use but frustrating because player actually need to know what to do and then reconfigure it all again to their needs) - That is something I want to implement anyway in the future.

  • Custom keybind automodpack specific configuration (worst idea since that would work for only that specific case)

  • File patcher we could implement this using e.g. .patch files which would be in the same place that you have options.txt right now. E.g. instead of full options.txt, you would provide options.txt.patch file. That patch would then be applied to client options.txt. Not sure if that would be actually duable since there could be conflicts so more reaserch is needed. (Best most powerful option, harder to use for admins but nothing is needed on player side to do)

Skidamek avatar Aug 04 '24 12:08 Skidamek

to be honest I can work with anything as long I can give fixed default keybind! thank you for the fast respond btw!

Hiusi avatar Aug 05 '24 03:08 Hiusi

  • File patcher we could implement this using e.g. .patch files which would be in the same place that you have options.txt right now. E.g. instead of full options.txt, you would provide options.txt.patch file. That patch would then be applied to client options.txt. Not sure if that would be actually duable since there could be conflicts so more reaserch is needed. (Best most powerful option, harder to use for admins but nothing is needed on player side to do)

This would be so helpful if possible! 🙏

danjustice2 avatar Aug 07 '24 01:08 danjustice2

I found this mod that has a similar functionality to what is discussed here if anyone was interested in knowing! Haven't tried it yet, so can't vouch for its functionality, but it seems like it should do the trick

https://modrinth.com/mod/default-options

danjustice2 avatar Aug 15 '24 00:08 danjustice2

I found this mod that has a similar functionality to what is discussed here if anyone was interested in knowing! Haven't tried it yet, so can't vouch for its functionality, but it seems like it should do the trick

https://modrinth.com/mod/default-options

It won't work with automodpack since it requires that you don't have options.txt at all yet, you do. And also it's only default options, so works only first time, you do the same thing with automodpack right now if you add options.txt as editable file to the modpack.

Skidamek avatar Aug 15 '24 06:08 Skidamek

Problem here is that we want to force edit specific lines of the same file few times remotely via server without destroying users other settings.

Skidamek avatar Aug 15 '24 06:08 Skidamek

Maybe it is possible to delete the original options.txt during the very first boot and download the one required for the modpack to work from the server? That is, so that it works once at the very beginning, when the player first connects to the server.

j-tap avatar Jan 17 '25 14:01 j-tap

Maybe it is possible to delete the original options.txt during the very first boot and download the one required for the modpack to work from the server? That is, so that it works once at the very beginning, when the player first connects to the server.

@j-tap That's actually how it supposed to work right now. Doesn't it? Please check if you have the options.txt set as editable in config and then try to download modpack on fresh instance only with automodpack. It should replace your current options.txt to the servers' and let you edit it from this point on. If it doesnt work, please create separate issue.

Skidamek avatar Jan 17 '25 14:01 Skidamek

@j-tap That's actually how it supposed to work right now. Doesn't it? Please check if you have the options.txt set as editable in config and then try to download modpack on fresh instance only with automodpack. It should replace your current options.txt to the servers' and let you edit it from this point on. If it doesnt work, please create separate issue.

Unfortunately it doesn't work like that, the first loading of the game is done without assembly. And only then the player connects to the server and downloads the necessary files using AutoModpack.

j-tap avatar Jan 23 '25 09:01 j-tap

Unfortunately it doesn't work like that, the first loading of the game is done without assembly. And only then the player connects to the server and downloads the necessary files using AutoModpack.

Fixed in beta 23

Skidamek avatar Feb 15 '25 16:02 Skidamek