Project Zomboid

Project Zomboid

94 ratings
Keys Stay Bound
3
3
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
1.768 MB
31 May, 2024 @ 12:47am
31 May, 2024 @ 12:51am
2 Change Notes ( view )

Subscribe to download
Keys Stay Bound

Description
I am on an indefinite hiatus from Project Zomboid. Feel free to use my code for future mods, and feel free to update my mods for B42. Please do not reuse their exact names or mod id's to avoid confusion and bugs for B41 players. I can only guarantee my mods worked when used alone before B42 dropped. I will no longer be retesting them when people have conflicts. Thanks for the support over the years.

In vanilla Project Zomboid, customized mod key bindings can be erased and therefore reset to defaults when you migrate from one server (or save file) to another. This fixes that. Just enable Keys Stay Bound in the MODS tab of the Main Menu and on any server you host. Encourage your players to also enable it locally for their own sake. This is how you bind.

You can add or remove this mod to an existing world. Works in singleplayer and multiplayer. When the mod is not loaded, its backup file will just sit in Zomboid/Lua waiting for an opportunity to be useful again.

The Problem in Detail

Every time Project Zomboid saves the key bindings for your current server configuration in keys.ini, it erases everything that used to be in that file. It does not merge new data with old data; it does not save anything that used to be there. Consequently, the game purges key bindings for mods that are not enabled whenever it saves keys.ini. As a result, key bindings for disabled mods will be reset to their defaults (which could leave them bound to problematic buttons or entirely unbound) if those mods are enabled again in the future. For many people, that's highly undesirable, because this can easily result in loss of custom key bindings every time they switch servers.

The Keyper of Immortal Bindings

It is the solemn duty of the Keyper to guard your keys for all time. As long as the Keyper stands, so shall your key bindings be remembered. No more will your bindings be lost in the sands of time. The Keyper does this by periodically merging the game's keys.ini file into keysThatShallNeverDie.ini, a file in which all of your key bindings (those of both active and inactive mods) are kept safely untouched by the callous and perhaps even brutal whims of vanilla Project Zomboid. It also loads missing fields from keysThatShallNeverDie.ini into the keys.ini file at appropriate times, so that disabled mods will properly reload their old settings when they are enabled again.

Maximum Bindings

By default, this mod saves up to 1000 key bindings instead of throwing them away when the mods that add them are inactive. The top setting of keysThatShallNeverDie.ini can be used to change the maximum number of stored keys up to 10000, which should be more than anyone would ever need. If this value is set to 0 (or less), no eternal keys will be stored in this ini.

Both of the aforementioned key binding files (keysThatShallNeverDie.ini and keys.ini) are found in %UserProfile%/Zomboid/Lua/ on Windows, or ~/Zomboid/Lua/ on Linux.

Modpacks

If and only if you change the name and mod ID of this mod in its mod.info file so that normal users don't fail to connect to servers as a result of your modpack's presence on their computers, then you have my permission to reupload this mod. If you do not follow this instruction, then you do not have my permission. If you don't change these things in a reuploaded version of this mod, it will remind you in-game.

Disclaimer: Immortal things are not necessarily invincible. Powerful though they may be, the spells of the Keyper cannot protect against physical damage to data storage devices, failure to enable Keys Stay Bound, inadvertent deletion of files due to boundless human excellence, or entropy.

Shout-out to theharber for providing the image of the Keyper of Immortal Bindings hard at work.

Like this mod? Feel free to check out my other stuff on the Steam Workshop. Also, thanks in advance to those of you who take the time to upvote this mod so that others can find it!

Follow the link below to help fund development of the Center For Keys That Can't Bind Good and Want To Learn To Do Other Stuff Good Too:

[ko-fi.com]

Workshop ID: 3258032107
Mod ID: KeysStayBound
6 Comments
TheDigimon 16 Aug, 2024 @ 2:24pm 
theharber you won best comment
Sleep Deprived Gaming 4 Jun, 2024 @ 3:01am 
God bless the Keyper
ELTR101 3 Jun, 2024 @ 4:13pm 
I love the name.
Burryaga  [author] 2 Jun, 2024 @ 6:37am 
Really appreciate all the support this mod received in its first 48 hours! Thanks to everyone who has helped let people know it exists!
theharber 1 Jun, 2024 @ 5:52pm 
This mod wasn't released late, nor was it early. It was released precisely as it was meant.
Kris 1 Jun, 2024 @ 7:05am 
🔥