Jump to content

Is it possible to bind a joystick / throttle controller for this game?


Chel

Recommended Posts

Recently purchased a split-system Thrustmaster HOTAS X as a little present. Would it be possible (in the future) for reading control inputs from systems like these? or is it already in and I am stupid

IIRC KSP 1 can do it. Little bit of immersion I suppose, would be nice with IVA as well.

- Rachel

Link to comment
Share on other sites

On 9/7/2023 at 2:22 PM, DancZer said:

I have a good news, I manage to setup the Joystick!

Steps to configure it:

  1. Go to the settings and setup the pitch, yaw, roll for your Joystick
  2. Save your settings
  3. Navigate to c:\Users\<Username>\AppData\LocalLow\Intercept Games\Kerbal Space Program 2\Global\
  4. Edit InputBindings.json
  5. Find every processors and add clamp(min=-1,max=0)  and clamp(min=0,max=1) for each axes. Make sure you add the highlighted text between \"
  6. Save the file
  7. Load the game
  8. Navigate to the Settings and click on Input
  9. Do not modify any settings, otherwise the InputBindings.json will be overwritten and you have to start from 5.
  10. Load you campaign and enjoy the flight

Background info:

The reason it was not working, because when you configure your Joystick axes for the flight they add your axis two times (eg.: pitch up, pitch down like W, S). You can test it if you remove one of your Flight/Pitch the path value. Let's say we keep the Flight/Pitch up binding. If you load the game the same way as I described you will notice that no matter that you move your Joystick forward or backward the pitch will always go up. Joystick axes value  moves in range -1 ... 1, but KSP2 internally transform this to absolute value. That's why no matter if you move it to -1 or 1 the end result will be always 1 and the pitch goes up. To solve the issue you can add clamp. This will remove the lower and upper part of your Joystick value range and it will not let the bindings go down in Pitch Up binding and up in Pitch Down binding. I hope it makes sense for you.

KSP 2 uses the Input System package for Unity to handle input: https://docs.unity3d.com/Packages/[email protected]/manual/Processors.html#clamp

Example:

"{\"bindings\":[{\"action\":\"Flight/Pitch\",\"id\":\"27397e14-6a24-4bbf-8830-e3cc4ad3db69\",\"path\":\"<Joystick>/stick/y\",\"interactions\":\"\",\"processors\":\"clamp(min=0,max=1)\"},{\"action\":\"Flight/Pitch\",\"id\":\"1eff4572-25e9-4520-bd55-07a5f4415db3\",\"path\":\"<Joystick>/stick/y\",\"interactions\":\"\",\"processors\":\"clamp(min=-1,max=0)\"},{\"action\":\"Flight/Roll\",\"id\":\"d273a7bf-6efa-4915-acaa-dab56c2719a8\",\"path\":\"<Joystick>/stick/x\",\"interactions\":\"\",\"processors\":\"clamp(min=-1,max=0)\"},{\"action\":\"Flight/Roll\",\"id\":\"3627ecee-69c2-45ca-8f78-c0dad13257ef\",\"path\":\"<Joystick>/stick/x\",\"interactions\":\"\",\"processors\":\"clamp(min=0,max=1)\"},{\"action\":\"Flight/Yaw\",\"id\":\"fe5396d2-4c1d-4bf9-915b-1bdfd3d5cc39\",\"path\":\"<HID::Thrustmaster T.16000M>/rz\",\"interactions\":\"\",\"processors\":\"clamp(min=-1,max=0)\"},{\"action\":\"Flight/Yaw\",\"id\":\"ce110cb9-c1f9-43cd-a91a-0a02bfdae364\",\"path\":\"<HID::Thrustmaster T.16000M>/rz\",\"interactions\":\"\",\"processors\":\"clamp(min=0,max=1)\"}]}"

I wish you the best!

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...