Jump to content

How to use GlovePIE and PPJoy to make 2- and 3-way switches functional again!


seikdel

Recommended Posts

I've started a couple of different threads on this recently. Although they haven't received much attention, I can't believe I'm the only one who wants a functional 3-way flaps switch in the FC3 A/C. After a couple hours of blood, sweat, and tears, I figured it out!

The problem

  • 2-way switches are only "on" when they're flipped up
  • 3-way switches are only "on" when they're not in their center position
  • FC3 (and some functions in other modules) can't respond to "off" events
  • This means that, if you have a 2-way switch set to control your landing gear, you have to flip it off and then on again to toggle the gear

The solution

  • Use PPJoy to install a virtual joystick, then use GlovePIE to map these "off" positions on the real controller to "on" positions on the virtual controller
  • Voila! DCS can now react to both "on" and "off" events!
  • P.S. T.A.R.G.E.T. is a total joke

 

Steps:

  1. Install PPJoy
  2. Create a virtual controller (mine has 0 axes, 0 HATs, and 16 buttons, because that's all I need it for)
  3. Install GlovePIE
  4. Create a script that maps key releases on the real controller to key presses on the virtual controller

 

I have a TM Warthog. The throttle block is controller #3, after a TM Cougar and the Hog Stick. To find out which number your preferred controller is, open up the "Game Controllers" dialog in windows (easiest way: start menu -> devices and printers -> right-click on whichever controller is displayed in there and select "Game controller settings"). The first controller in the list is #1, the second is #2, etc.

 

This is what my GlovePIE script looks like for my TM Warthog Throttle (remember, it's controller #3 on my computer):

[size="2"]if(joy3.button9 = false and joy3.button10 = false) then PPJoy1.Digital0 = true else PPJoy1.Digital0 = false [i]//Boat Switch[/i]
if(joy3.button16 = false) then PPJoy1.Digital1 = true else PPJoy1.Digital1 = false [i]//ENG L Fuel switch[/i]
if(joy3.button17 = false) then PPJoy1.Digital2 = true else PPJoy1.Digital2 = false [i]//ENG R Fuel switch[/i]
if(joy3.button20 = false) then PPJoy1.Digital3 = true else PPJoy1.Digital3 = false [i]//APU Switch[/i]
if(joy3.button22 = false and joy3.button23 = false) then PPJoy1.Digital4 = true else PPJoy1.digital4 = false [i]//Flaps[/i]
if(joy3.button27 = false and joy3.button28 = false) then PPJoy1.Digital5 = true else PPJoy1.Digital5 = false [i]//Autopilot Switch[/i]
if(joy3.button24 = false) then PPJoy1.Digital6 = true else PPJoy1.Digital6 = false [i]//EAC Switch[/i]
if(joy3.button25 = false) then PPJoy1.Digital7 = true else PPJoy1.Digital7 = false [i]//RDR ALTM Switch[/i]
if(joy3.button29 = false) then PPJoy1.Digital8 = true else PPJoy1.Digital8 = false [i]//Right Throttle[/i]
if(joy3.button30 = false) then PPJoy1.Digital9 = true else PPJoy1.Digital9 = false [i]//Left Throttle[/i]
keyboard.ScrollLock = joy3.Button4 [i]//Mic Switch, mapped to ScrollLock, which is my TS3 PTT Key[/i]
keyboard.ScrollLock = joy3.Button5 [i]//Mic Switch, mapped to ScrollLock, which is my TS3 PTT Key[/i]
keyboard.ScrollLock = joy3.Button6 [i]//Mic Switch, mapped to ScrollLock, which is my TS3 PTT Key[/i][/size]

 

Leave this running while DCS is up and you'll get the following results:

  • Boat switch center = Virtual button 1
  • ENG L OVERRIDE = Virtual button #2
  • ENG R OVERRIDE = Virtual button #3
  • APU Switch off = Virtual button #4
  • Flaps switch MV (center) = Virtual button #5
  • Autopilot switch ALT/HDG (center) = Virtual button #6
  • EAC OFF = Virtual button #7
  • RDR ALTM DIS = Virtual button #8
  • Right throttle idle (from the off position) = Virtual button #9
  • Left throttle idle (from the off position) = Virtual button #10
  • Mic switch forward, backward or down = ScrollLock

 

Now you can map these in DCS! For example, in the Su-25, I have the following mapped:

  • Flaps switch UP (button 22 on the real controller) = Flaps up
  • Flaps switch MV (button 5 on the virtual controller) = Flaps Up/Down
  • Flaps switch DN (button 23 on the real controller) = Flaps Landing Position
  • APU START (e.g. APU switch up, which is button 20 on the real controller) = Landing Gear Up
  • APU OFF (APU switch down, which is button 4 on the virtual controller) = Landing Gear Down

So now my 3-way flaps switch works perfectly in the Su-25, and the APU switch works as a gear lever (up and down actually correspond to the gear handle being up or down, instead of just toggling it).

 

Other controls in the game (e.g. Cut of Burst Select) don't have an "up" or "down" setting in the game - they can only be toggled. You can still map both the real switch and the virtual one, which allows you to use the switch as a true toggle switch. You can also map engine starts to the virtual buttons 8 and 9 (for right and left, respectively), and engine stops to the real buttons 29 and 30 (also for right and left, respectively).

 

That's it! A half hour of setup yields functional 2- and 3-way switches in the FC3 A/C! You can also script some keyboard macros pretty easily. The scripting language is a piece of cake to learn.

 

And best of all? No T.A.R.G.E.T.! This means you keep both controllers as discrete entities (instead of the stupid "Thrustmaster Combined" virtual controller). GlovePIE also boots up faster than T.A.R.G.E.T., and since it's not unplugging and replugging all manner of virtual shenanigans, you don't have to reboot DCS to switch from FC3 to DCS modules! I honestly haven't found a downside yet.

 

I hope this works for some folks. Please shoot me any questions you have.

 

P.S. If you have "Synchronize controls on mission start" selected, be aware that any toggle-only switches (e.g. close canopy, cut of burst select, RWR silence, etc.) will be toggled at mission start (because if the real button is off, the virtual button is on, and vice versa, so there will always be a button on). The easy fix is to toggle your controls the opposite of how you want them (e.g. if you want ENG L NORM to equal "open canopy" and ENG L OVERRIDE to equal "close canopy", before you unpause the mission or jump into the pit, set the switch to OVERRIDE). Alternatively, you can open up the arming window (which freezes all controls except mouse) and adjust your switches to match whatever you want. Alternatively alternatively, you can just hit each of the keyboard commands once to toggle the controls. You'll figure it out. Trust me; it's easy.

  • Like 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...