(SOLVED) Swapping Camera Movement Keys for WASD breaks PLAYERCFG.LUA


(Migz-DH) #1

Problem solved in v2.1


Original Post:

In the Steam forum, there have been a few threads lately 1 2 3 from people complaining that using the WASD keys or other pre-assigned keys to move the camera doesn’t work. As rebinding keys always worked for me previously, I was curious and tried it out today. Indeed, directly swapping WASD for Up, Left, Down, and Right arrows doesn’t work. (Edit: Presumably, the same thing happens with Pan Up and Pan Down as well. Edit2: Nope, not true. As Hell_Diguner mentioned below, the Pan Up and Pan Down work as expected after swapping.)

The problem is that the PLAYERCFG.LUA file’s “ControlOptions” section doesn’t fill in correctly when swapping the camera movement keys for keys which are already assigned to functions (such as WASD). This doesn’t happen when moving the pre-assigned functions to keys which don’t already have assignments such as the Number Pad keys first, then assigning the WASD keys (or similar) to the camera movement.

Inside of the PLAYERCFG.LUA file, entries should appear like this (example for W as Pan Forward):

{ 151, "Camera_PanCmd(INKE_KeyDown,PS_Up)", 0, 0, "Pan Forward", { 87, }, }, { 152, "Camera_PanCmd(INKE_KeyUp,PS_Up)", 1, 0, "Pan Forward", { 87, }, },

However, it doesn’t. Instead, it’s missing the key entry for W (“87,”) in the second part and it looks like this:

{ 151, "Camera_PanCmd(INKE_KeyDown,PS_Up)", 0, 0, "Pan Forward", { 87, }, }, { 152, "Camera_PanCmd(INKE_KeyUp,PS_Up)", 1, 0, "Pan Forward", { }, },

All four camera movement entries miss that second key causing the camera to fail to move correctly.

Of course, by entering the correct key values to PLAYERCFG.LUA, the camera works as intended with WASD, but these players don’t know that, and they shouldn’t have to do that anyway.

As mentioned above, this entry problem can be bypassed by first assigning the functions to other keys first. Then, assigning the camera movement to the new keys. So, for example, if I move Waypoints, Military Selection, Stop, and Dock to NumPad 4, 5, 6, and 7 respectively, then assign Pan Forward, Pan Left, Pan Backward, and Pan Right to W, A, S, and D respectively, the PLAYERCFG.LUA file fills out correctly, and the camera moves as expected.

So, here are the instructions for two workarounds I’ve begun writing to players who have this problem:

A. Change Waypoints, Military Selection, Stop, and Dock (WASD currently) to Number Pad numbers.
B. Change the camera movement keys to WASD.
C. Change Waypoints, Military Selection, Stop, and Dock to whichever other keys you want them to actually be.
D. Check the PLAYERCFG.LUA file to ensure all of the entries are filled correctly.

A. Change the camera movement keys to WASD while moving the Waypoints, Military Selection, Stop, and Dock functions to where you want them to be.
B. Check the PLAYERCFG.LUA file to ensure all of the entries are filled correctly and correct whatever problems occur.

I hope a solution to this can be included in the patch the GBX team has been working on.

(Oh, swapping the camera movement keys while in a match does nothing until exiting out of it btw. Did you know that?)


How to reproduce this problem:

  1. While in the Main Menu, go to the Options Menu, then the Controls Menu.
  2. Assign Military Selection to Left.
  3. Assign Waypoints to Up.
  4. Assign Stop to Down.
  5. Assign Dock to Right.
  6. Assign Pan Forward to W.
  7. Assign Pan Backward to S.
  8. Assign Pan Left to A.
  9. Assign Pan Right to D.
  10. Try to play a match in either the campaign or Player vs. CPU; it doesn’t matter which.
  11. You should find that pressing either W or A results in the camera moving forward and not stopping when the key is released. Hit the key again to stop the camera from moving.
  12. You should find that hitting any of the WASD keys afterwards results in no movement at all.
  13. Exit the game.
  14. Enter the PLAYERCFG.LUA file and scroll down to the “ControlsOptions” section.
  15. You should find the key number entries missing for the four camera pan stop functions.
  16. You should find that the key number entries are there for Military Selection, Waypoints, Stop, and Dock.
  17. Add the appropriate key entry to the four broken sections, and save the file.
    A. Pan Forward - “87,”
    B. Pan Backward - “83,”
    C. Pan Left - “65,”
    D. Pan Right - “68,”
  18. Repeat steps 10 through 12 to see if the camera works as expected… it should.
  19. Exit the match, and go to the Main Menu.
  20. While in the Main Menu, go to the Options Menu, then the Controls Menu.
  21. Set all of the controls to the default.
  22. Exit to Desktop.
  23. Boot up the game.
  24. While in the Main Menu, go to the Options Menu, then the Controls Menu.
  25. Assign Military Selection to Num 6.
  26. Assign Waypoints to Num 7.
  27. Assign Stop to Num 8.
  28. Assign Dock to Num 9.
  29. Assign Pan Forward to W.
  30. Assign Pan Backward to S.
  31. Assign Pan Left to A.
  32. Assign Pan Right to D.
  33. Repeat steps 10 through 12 to see if the camera works as expected… it should.
  34. Exit to Desktop.

(Migz-DH) #2

Here’s the complete entry from a broken version of the PLAYERCFG.LUA file.

ControlsOptions = { keys = { { 15, 15, 0, 0, "Dock", { 39, }, }, { 17, 2, 0, 0, "Stop", { 40, }, }, { 26, 55, 0, 0, "Military Selection", { 37, }, }, { 27, 55, 1, 1, "Military Selection", { 37, }, }, { 56, 73, 0, 0, "Set Waypoints", { 38, }, }, { 151, "Camera_PanCmd(INKE_KeyDown,PS_Up)", 0, 0, "Pan Forward", { 87, }, }, { 152, "Camera_PanCmd(INKE_KeyUp,PS_Up)", 1, 0, "Pan Forward", { }, }, { 153, "Camera_PanCmd(INKE_KeyDown,PS_Down)", 0, 0, "Pan Backward", { 83, }, }, { 154, "Camera_PanCmd(INKE_KeyUp,PS_Down)", 1, 0, "Pan Backward", { }, }, { 155, "Camera_PanCmd(INKE_KeyDown,PS_Left)", 0, 0, "Pan Left", { 65, }, }, { 156, "Camera_PanCmd(INKE_KeyUp,PS_Left)", 1, 0, "Pan Left", { }, }, { 157, "Camera_PanCmd(INKE_KeyDown,PS_Right)", 0, 0, "Pan Right", { 68, }, }, { 158, "Camera_PanCmd(INKE_KeyUp,PS_Right)", 1, 0, "Pan Right", { }, }, }, },


(BitVenom) #3

I want to say that I am 99.9% sure this is resolved in the patch. Most input was actually rewritten, and this was caught as an issue early on.


(Migz-DH) #4

Ah, good deal.


(Hell_Diguner) #5

Rebinding pan up/down still works, btw.


(Migz-DH) #6

This problem is solved in v2.1.
Thread title updated to reflect new status.


(meantek95) #7

I am hoping someone here can help me

I’m running HW-RM v1.3 beta as it’s a more enjoyable experience for me.

The problem is I can’t get my custom key bindings to work properly… I have reassigned the PAN Forward, Backwards, Left and Right commands to the W, A, S, D keys which works fine.

I also use a Shift modifier for panning Up and Down, this is where the problem presents.

I have assigned Shift+W and Shift+S for panning the camera Up and Down, but when I use these commands in the game the camera pans in the direction indicated irrespective of when the key is unpressed.

I know this problem has been resolved in the latest patch however I have a much more enjoyable experience in the former version, I have tired to patch v1.3beta with the LUA files from the latest version that correspond to key mappings and game controls, however this yields no effect.

Dose anyone know how to incorporate the key mapping fixes form the latest version into v1.3 beta?
Dose anyone know how I can get this configuration to work in 1.3Beta?

Would really appreciate if anyone can help me with this


(Is this thing on?) #8

Did you try manually editing the file mentioned in the OP? At first glance, this would appear to be your best bet.


(meantek95) #9

I’ve spent the most part of the last 2 days tweaking the “playercfg.lua” trying to get it to work. When I launch the game it modifys the file setting an invalid configuration. I set up the W and S keys to work and then when I set up the correct configuration for the Shift+W and Shift+S keys the game invalidates the setting for the W and S keys.

I’ve been going around in circles.

Here’s a sample of the code

 {
   151,
   "Camera_PanCmd(INKE_KeyDown,PS_Up)",
   0,
   0,
   "Pan Forward",
   {
     87,
   },
 },
 {
   152,
   "Camera_PanCmd(INKE_KeyUp,PS_Up)",
   1,
   0,
   "Pan Forward",
   {
     87,
   },
 },
 {
   153,
   "Camera_PanCmd(INKE_KeyDown,PS_Down)",
   0,
   0,
   "Pan Backward",
   {
     83,
   },
 },
 {
   154,
   "Camera_PanCmd(INKE_KeyUp,PS_Down)",
   1,
   0,
   "Pan Backward",
   {
     83,
   },
 },
 {
   155,
   "Camera_PanCmd(INKE_KeyDown,PS_Left)",
   0,
   0,
   "Pan Left",
   {
     65,
   },
 },
 {
   156,
   "Camera_PanCmd(INKE_KeyUp,PS_Left)",
   1,
   0,
   "Pan Left",
   {
     65,
   },
 },
 {
   157,
   "Camera_PanCmd(INKE_KeyDown,PS_Right)",
   0,
   0,
   "Pan Right",
   {
     68,
   },
 },
 {
   158,
   "Camera_PanCmd(INKE_KeyUp,PS_Right)",
   1,
   0,
   "Pan Right",
   {
     68,
   },
 },
 {
   159,
   "Camera_PanCmd(INKE_KeyDown,PS_ModUp)",
   0,
   0,
   "Pan Up",
   {
     16,
     87,
   },
 },
 {
   160,
   "Camera_PanCmd(INKE_KeyUp,PS_ModUp)",
   1,
   0,
   "Pan Up",
   {
     87,
   },
 },
 {
   161,
   "Camera_PanCmd(INKE_KeyDown,PS_ModDown)",
   0,
   0,
   "Pan Down",
   {
     16,
     83,
   },
 },
 {
   162,
   "Camera_PanCmd(INKE_KeyUp,PS_ModDown)",
   1,
   0,
   "Pan Down",
   {
     83,
   },
 },

(Is this thing on?) #10

My suspicion is that the problem lies in the actual game code, based on the comment by @BitVenom (one of the developers) in his post (#3). You may be out of luck. (Also, not sure if BitVenom still monitors this section - the thread you responded to is 2 years old at this point.)