Matthew-J-Green / dv-loco-analogue-control-mod

Derail Valley mod for analogue control in locomotives
MIT License
5 stars 2 forks source link

dv-loco-analogue-control-mod

Derail Valley mod for analogue control in locomotives

REGENERATE THE CONFIG.JSON AFTER EVERY UPDATE TO PREVENT VERSION MIGRATION ISSUES

There is only one joystick configured in the game. Multiple attached controllers will fight each other. 99% Sure this wont work with VR.

This mod puts the value on your controller axis into the in game axis. You should use a controller which holds its current value such as a HOTAS throttle. Don't try and use something like an xbox controller.

For button mappings please use your joystick/controller utility or 3rd party software to map buttons to keys

Using the Mod

Understanding Joystick Mapping

The in game axis names need to be provided to the config json to grab the correct axis number from your controller. All controllers use the same axis names so multiple controllers are not supported unless the devs change this behaviour.

A simple way to find the controller axis numbers is through Windows game controllers test utility. This can be opened with WinKey + R then typing joy.cpl. Select the apropriate device (there should only be one connected) and select Properties followed by Test. You can then get the game axis name from the table.

Input Axis Number Game Axis Name Windows Axis Name Inverted in game
0 Oculus_GearVR_LThumbstickX X Axis False
1 Oculus_GearVR_LThumbstickY Y Axis True
2 Oculus_GearVR_RThumbstickX Z Axis False
3 Oculus_GearVR_RThumbstickY X Rotation True
4 Oculus_GearVR_DpadX Y Rotation False
5 Oculus_GearVR_DpadY Z Rotation True
11 Oculus_GearVR_LIndexTrigger False
12 Oculus_GearVR_RIndexTrigger False