Jump to content

Recommended Posts

I did some digging and came up with a workaround.

Keys can be rebound by modifying the following script file: \Don't Starve\data\scripts\constants.lua

Tested in the following environment:

[*]Don't starve - GOG standalone version

[*]Version: 78281 (hit backspace in-game to see version info in the lower left corner)

[*]Operating System: Windows XP Pro (German)

[*]Keyboard: Standard desktop keyboard with numpad (German layout)

[*]Works with new games as well as saves

How-to:

[*]Make a backup-copy (name it constants.lua.BAK, so in case, it's easy to find)

[*]Open constants.lua with any text editor (e.g. WordPad, Editor or whatever)

[*]Bind the KEY_-constants concerned to new key codes and save the file (e.g. change the entry "KEY_A = 97" to "KEY_A = 260")

Examples

(In LUA-files, everything after "--" is just a comment, thus with preceding "--" you can transform the original entries into comments so that you can add the new bindings and keep track of the changes you make)

A) Remapping WASD movement:

[table=width: 500, class: grid, align: left]

[tr]

[td]Action[/td]

[td]Key[/td]

[td]Binding[/td]

[td]New key[/td]

[td]New binding[/td]

[/tr]

[tr]

[td]Move forward[/td]

[td]W[/td]

[td]KEY_W = 119[/td]

[td]Numpad 8[/td]

[td]KEY_W = 264[/td]

[/tr]

[tr]

[td]Move left[/td]

[td]A[/td]

[td]KEY_A = 97[/td]

[td]Numpad 4[/td]

[td]KEY_A = 260[/td]

[/tr]

[tr]

[td]Move backward[/td]

[td]S[/td]

[td]KEY_S = 115[/td]

[td]Numpad 5[/td]

[td]KEY_S = 261[/td]

[/tr]

[tr]

[td]Move right[/td]

[td]D[/td]

[td]KEY_D = 100[/td]

[td]Numpad 6[/td]

[td]KEY_D = 262[/td]

[/tr]

[/table]

B) Remapping camera rotation:

[table=width: 500, class: grid, align: left]

[tr]

[td]Action[/td]

[td]Key[/td]

[td]Binding[/td]

[td]New key[/td]

[td]New binding[/td]

[/tr]

[tr]

[td]Rotate left[/td]

[td]Q[/td]

[td]KEY_Q = 113[/td]

[td]Numpad 7[/td]

[td]KEY_Q = 263[/td]

[/tr]

[tr]

[td]Rotate right[/td]

[td]E[/td]

[td]KEY_E = 101[/td]

[td]Numpad 9[/td]

[td]KEY_E = 265[/td]

[/tr]

[/table]

C) Remapping further useful keys to numpad:

[table=width: 500, class: grid, align: left]

[tr]

[td]Action[/td]

[td]Key[/td]

[td]Binding[/td]

[td]New key[/td]

[td]New binding[/td]

[/tr]

[tr]

[td]Show/hide map[/td]

[td]Tab[/td]

[td]KEY_TAB = 9[/td]

[td]Numpad +[/td]

[td]KEY_TAB = 270[/td]

[/tr]

[tr]

[td]Spacebar action[/td]

[td]Spacebar[/td]

[td]KEY_SPACE = 32[/td]

[td]Numpad 0[/td]

[td]KEY_SPACE = 256[/td]

[/tr]

[tr]

[td]Shift key action[/td]

[td]Shift[/td]

[td]KEY_SHIFT = 402[/td]

[td]Numpad Period[/td]

[td]KEY_SHIFT = 266[/td]

[/tr]

[tr]

[td]Ctrl key action[/td]

[td]Ctrl[/td]

[td]KEY_CTRL = 401[/td]

[td]Numpad Enter[/td]

[td]KEY_CTRL = 271[/td]

[/tr]

[/table]

Remarks:

[*]Only do this, if you are certain of what you're doing

[*]Changes in game-files can corrupt your installation of Don't Starve (re-installation might be necessary)

[*]To avoid conflicts, rebind only to keys not serving any purpose yet

[*]Any update of Don't Starve could cancel your changes or result in conflicts (so keep a backup of the original constants.lua)

[*]Rebinding of the numeric keys 1-0 doesn't work this way

[*]The original key looses it's function throughout the whole game and is "dead" you always have to use the "new" key (e.g. when you rebind "A" to "Numpad 4" then Numpad 4 acts as if it were an A and the A key is "dead"

[*]The new bound key, acts like the original key (e.g. pressing Numpad 8 from above example yields a "W")

[*]Numlock must be on, using Windows, otherwise numpad keys act like arrow keys and the binding fails

[*]If you run the standalone updater (\Don't Starve\updater\16\updater.exe) and use the Check Consistency option, the constants.lua will be replaced by the original and the changes are lost, so keep a backup copy of the modified file

Reference - Numpad key-codes:

[table=class: grid]

[tr]

[td]Key[/td]

[td]Code[/td]

[/tr]

[tr]

[td]Numpad /[/td]

[td]267[/td]

[/tr]

[tr]

[td]Numpad *[/td]

[td]268[/td]

[/tr]

[tr]

[td]Numpad -[/td]

[td]269[/td]

[/tr]

[tr]

[td]Numpad +[/td]

[td]270[/td]

[/tr]

[tr]

[td]Numpad Enter[/td]

[td]271[/td]

[/tr]

[tr]

[td]Numpad 1[/td]

[td]257[/td]

[/tr]

[tr]

[td]Numpad 2[/td]

[td]258[/td]

[/tr]

[tr]

[td]Numpad 3[/td]

[td]259[/td]

[/tr]

[tr]

[td]Numpad 4[/td]

[td]260[/td]

[/tr]

[tr]

[td]Numpad 5[/td]

[td]261[/td]

[/tr]

[tr]

[td]Numpad 6[/td]

[td]262[/td]

[/tr]

[tr]

[td]Numpad 7[/td]

[td]263[/td]

[/tr]

[tr]

[td]Numpad 8[/td]

[td]264[/td]

[/tr]

[tr]

[td]Numpad 9[/td]

[td]265[/td]

[/tr]

[tr]

[td]Numpad 0[/td]

[td]256[/td]

[/tr]

[tr]

[td]Numpad decimal point[/td]

[td]266[/td]

[/tr]

[/table]

Edited by Mignon

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...