Hi all,
I have a game controller with an 8-position rotary switch.
I have mapped this to the UH-1H Armament Panel Rocket-Pair 8-position switch, but have some odd behaviour.
Hoping you can help.
In-game the switch positions are marked 0 to 7 (zero rocket pairs selected, to seven rocket pairs selected)
My game controller has the switch positions mapped to a button press, so within Windows/control-panel/gamecontroller-settings/properties we see that setting the switch position maps as follows:
Physical switch position 7 = game controller Button 18 depressed (only)
Physical switch position 6 = game controller Button 19 depressed (only)
Physical switch position 5 = game controller Button 20 depressed (only)
Physical switch position 4 = game controller Button 21 depressed (only)
Physical switch position 3 = game controller Button 22 depressed (only)
Physical switch position 2 = game controller Button 23 depressed (only)
Physical switch position 1 = game controller Button 24 depressed (only)
Physical switch position 0 = no buttons depressed
In the UH-1H/joystick/default.lua file, I create the following entry (and I suspect this is where I might have an issue):
{down = 3011, value_down = 0.1, up = 3011, value_up = 0.0, cockpit_device_id = devices.WEAPON_SYS, name = "ALT Rocket Pair 1", category = _("Armament System"), },
{down = 3011, value_down = 0.2, up = 3011, value_up = 0.0, cockpit_device_id = devices.WEAPON_SYS, name = "ALT Rocket Pair 2", category = _("Armament System"), },
{down = 3011, value_down = 0.3, up = 3011, value_up = 0.0, cockpit_device_id = devices.WEAPON_SYS, name = "ALT Rocket Pair 3", category = _("Armament System"), },
{down = 3011, value_down = 0.4, up = 3011, value_up = 0.0, cockpit_device_id = devices.WEAPON_SYS, name = "ALT Rocket Pair 4", category = _("Armament System"), },
{down = 3011, value_down = 0.5, up = 3011, value_up = 0.0, cockpit_device_id = devices.WEAPON_SYS, name = "ALT Rocket Pair 5", category = _("Armament System"), },
{down = 3011, value_down = 0.6, up = 3011, value_up = 0.0, cockpit_device_id = devices.WEAPON_SYS, name = "ALT Rocket Pair 6", category = _("Armament System"), },
{down = 3011, value_down = 0.7, up = 3011, value_up = 0.0, cockpit_device_id = devices.WEAPON_SYS, name = "ALT Rocket Pair 7", category = _("Armament System"), },
In-game I go to Settings/Controls and my new Options "Alt Rocket Pair X" are available.
I map my game controller buttons 18 - 24 to these new settings 7 - 1 as appropriate.
But here's the issue.
When I rotate the game-controller knob up, then down, through the full range I get the following behaviour:
Controller knob -> Result in-game
0 -> 0
1 -> 1
2 -> 0
3 -> 0
4 -> 0
5 -> 0
6 -> 0
7 -> 0
6 -> 6
5 -> 5
4 -> 4
3 -> 3
2 -> 2
1 -> 1
0 -> 0
So rotating down works perfect, rotating up only works on the first step. Why?
Any ideas?
If someone else has done it (I'm sure they have - happy just for a link).
Thanks for your time.