Jump to content

Recommended Posts

Posted

I have recently upgraded to a TMWH from the Cougar. I had a perfectly functioning Foxy profile, and I had no need to try to figure out this Target scripting. Until now.

 

For now I have not messed with any other aircraft except the A10C, mainly because the default DCS profile is really good and I am just getting used to the HOTAS. But I have discovered, and resolved, one very annoying problem. By default there is no way to assign the TMWH keys for TIR or voice comms. Pretty standard these days to have. The MIC switch is relatively unused, and so I decided to map this. The problem is, once you create a Target profile and run it, the script creates a new name for the devices and you lose the default key assignments. And what is even more frustrating, you lose specific toggle commands like EAC Arm/Off. I have figured this out so not only do I regain those lost commands, but DCS also recognizes the new device and assigns all the commands automatically. Now I am only mapping the throttle, but I am sure this can also be figured out for mapping both the JS and Throttle and for all the other aircraft as well. And I believe any other device one is using that is not by default included.

 

So first, here is the script I am using. First I have excluded all other devices except the Throttle. Then I have assigned all the throttle buttons to the default DX assignments except the MIC switch. Where I have a short press of the MIC center button (MSP) as TIR center, a long press is TIR pause, and MIC up (MSU) is CAPS which is what I use for TS3 PTT.

 

include "target.tmh"

//program startup
int main()
{
Configure(&Joystick, MODE_EXCLUDED);
Configure(&LMFD, MODE_EXCLUDED);
Configure(&RMFD, MODE_EXCLUDED);
Configure(&HCougar, MODE_EXCLUDED);
Configure(&T16000, MODE_EXCLUDED);
Configure(&T16000L, MODE_EXCLUDED);
Configure(&TWCSThrottle, MODE_EXCLUDED);
Configure(&TFRPRudder, MODE_EXCLUDED);
   
   if(Init(&EventHandle)) return 1; // declare the event handler, return on error

//set pulse and delay lengths
SetKBRate(50,100);

//////////////////////////////
//Throttle Axis Definitions///
//////////////////////////////

MapAxis(&Throttle, THR_LEFT, DX_ZROT_AXIS);
MapAxis(&Throttle, THR_RIGHT, DX_Z_AXIS);
MapAxis(&Throttle, SCX, DX_X_AXIS);
MapAxis(&Throttle, SCY, DX_Y_AXIS);
MapAxis(&Throttle, THR_FC, DX_SLIDER_AXIS); 

//////////////////////////////
//Throttle Button Definitions/
//////////////////////////////

MapKey(&Throttle,MSP,TEMPO(USB[0x6A],USB[0x6B],1000));
MapKey(&Throttle,MSU,CAPS);
MapKey(&Throttle,MSD,DX5);
MapKey(&Throttle,MSL,DX6);
MapKey(&Throttle,MSR,DX4);

MapKey(&Throttle,SPDB,DX8);
MapKey(&Throttle,SPDF,DX7);

MapKey(&Throttle,BSB,DX10);
MapKey(&Throttle,BSF,DX9);

MapKey(&Throttle,CHB,DX12);
MapKey(&Throttle,CHF,DX11);

MapKey(&Throttle,PSB,DX14);
MapKey(&Throttle,PSF,DX13);

MapKey(&Throttle,LTB,DX15);

MapKey(&Throttle,CSU,DXHATUP);
MapKey(&Throttle,CSD,DXHATDOWN);
MapKey(&Throttle,CSL,DXHATLEFT);
MapKey(&Throttle,CSR,DXHATRIGHT);

MapKey(&Throttle,EFLNORM,DX16);
MapKey(&Throttle,EFRNORM,DX17);
MapKey(&Throttle,EOLMOTOR,DX18);
MapKey(&Throttle,EORMOTOR,DX19);
MapKey(&Throttle,APUON,DX20);
MapKey(&Throttle,LDGH,DX21);
MapKey(&Throttle,FLAPU,DX22);
MapKey(&Throttle,FLAPD,DX23);
MapKey(&Throttle,EACON,DX24);
MapKey(&Throttle,RDRNRM,DX25);
MapKey(&Throttle,APENG,DX26);
MapKey(&Throttle,APPAT,DX27);
MapKey(&Throttle,APALT,DX28);
MapKey(&Throttle,IDLELON,DX29);
MapKey(&Throttle,IDLERON,DX30);
MapKey(&Throttle,EOLIGN,DX31);
MapKey(&Throttle,EORIGN,DX32);

//add initialization code here
}

//event handler
int EventHandle(int type, alias o, int x)
{
   DefaultMapping(&o, x);

//add event handling code here	

 

Now if you run this profile, and go in to DCS controllers you will see you no longer have the Throttle - HOTAS Warthog (long device ID). Instead you have a Thrustmaster Virtual Game Controller (root) (long device ID).

 

In the ...\DCS World OpenBeta\Mods\aircraft\A-10C\Input\A-10C\joystick folder you will see all the provided default profiles. These profile names are the exact same as the name in the DCS controller window, and in the Saved Game folder where the diff.lua files are just without the device ID. So I copied the 'Throttle - HOTAS Warthog.lua' and renamed it to 'Thrustmaster Virtual Game Controller (root).lua'.

 

Done. All default keys automatically assigned again.

  • Recently Browsing   0 members

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