DFHack - Dwarf Fortress Modding Engine

DFHack - Dwarf Fortress Modding Engine

doom frog Feb 28, 2024 @ 2:06pm
Custom keybinding of DFhack commands not saving from one game session to the next
Loving DFhack, just started exploring it a week ago. One thing I've been doing is customizing the bindings on a gaming keypad I use. I am on Linux Mint steam version for both DF and DFhack.

My goal is simply to get "keybinding add" working. It does work, but when I close Dwarf Fortress and later open it again to the same save, the stuff I added is no longer there and I have to add the keybinding commands again.

For example some things I add in console:
keybinding add Ctrl-1@dwarfmode/Default "enable spectate"
and
keybinding add Ctrl-3@dwarfmode/Default "gui/autodump"

Both were working after adding them and I saw them listed when running "hotkeys" command. Very nice to press a button and pull it up. But both gone the next time I boot up the game (after saving after I created the hotkeys). Any suggestion on how to get them to remain saved from one gaming session to the next? Thank you.
< >
Showing 1-3 of 3 comments
Fel Feb 28, 2024 @ 2:12pm 
You need to add these key bindings to the file, not through the console if you want them to stay.

The best place is hack/init/dfhack.keybindings.init
doom frog Feb 28, 2024 @ 2:26pm 
Thanks Fel I figured it was something like that. I found a keybindings.init but it says in its notes to add it to a dfhack.init because keybindings.init is for the defaults: "Please do not edit this file directly. It will be overwritten with new defaults when you update DFHack. Instead, add your configuration to dfhack-config/init/dfhack.init".

Within dfhack.init I see the following notes: "This file runs when DFHack is initialized, when Dwarf Fortress is first started, before any world or save data is loaded. You can extend or override DFHack's default configuration by adding commands to this file."

Regardless of what the technically correct location to add it to I'm sure I can figure it out from here through trial and error.
Fel Feb 28, 2024 @ 2:28pm 
Oh yeah, sorry.
In the past dfhack didn't auto update so I always put my custom keys there since it made more sense for me (to remember where they were mostly).
< >
Showing 1-3 of 3 comments
Per page: 1530 50