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

Patch files #262

Open
Hiusi opened this issue Aug 4, 2024 · 8 comments
Open

Patch files #262

Hiusi opened this issue Aug 4, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@Hiusi
Copy link

Hiusi commented Aug 4, 2024

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.

@danjustice2
Copy link

danjustice2 commented Aug 4, 2024

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!

@kusayu
Copy link

kusayu commented Aug 4, 2024

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

@Skidamek
Copy link
Owner

Skidamek commented Aug 4, 2024

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 Skidamek changed the title [ASK] What is the best way to setup default keybind without forcing user to sync option.txt? Patch files Aug 4, 2024
@Skidamek Skidamek added the enhancement New feature or request label Aug 4, 2024
@Hiusi
Copy link
Author

Hiusi commented Aug 5, 2024

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

@danjustice2
Copy link

  • 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
Copy link

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

@Skidamek
Copy link
Owner

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants