Jump to content

one TARGET SCRIPT FOR all A/C & switch STATES


Recommended Posts

For some time now I have been messing with various MODS and scripts to achieve some sort of commonality with my ever growing list of plane models.

I have tried the very good polaris_and_schnixsuite of MODS and profiles and this came close to what I would like but still some of the switches are not the way I want them. Switch behaviour, mods and lua coding appears to vary from model to model and DCS or their partners.

The recent updates to DCS 1.5 beta together with me forgetting to remove all the installed MODS with JMSME, caused some confusion and made me think about Thrustmasters TARGET again.

TARGET configuration for each aircraft using the GUI is a real pain and there are issues although pilot error is often the cause, at least with me.... and although I have some programming knowledge I would rather be flying than scripting.

To resolve this I have written ONE target script that will work FOR ALL switch states, buttons & axis for ANY AIRCRAFT model running in DCS.

TARGET, DX Codes and Keyboard characters

Without TARGET DCS will recognise the TMWH switch position by DX codes, that is, it will know when a switch is ON. A 2 pole switch has 2 states, ON & OFF and a 3 pole switch has 2 ON states with the middle position being OFF.

 

DCS A10C is programmed to interpret all inputs correctly and switches just workas they should.

Other modules are different. You have to configure them in DCS. Some Aircraft model switches will recognise both DX states and the switch works, others do not and you have to move the switch twice to toggle it and 3 position switches are even more awkward.

You can directly alter the .lua files and mod each aircraft switch behaviour separately by editing the LUA file and even then, correct switch behaviour is difficult to achieve. Often these MODS are overwritten on updates if not removed beforehand - in reality not a big deal if you are using JMSGE.

With TARGET you can program a script to send keyboard characters or DX codes to DCS when you move TMWH switches. You need to be a little bit careful with how keyboard characters are sent to DCS, generally they not should in a downstate for long periods of time. With DX codes it does not matter.

 

This target script is for the THROTTLE only and is written to send DX codes and keyboard Right Shift codes only. I have included a PDF diagram showing what is sent for each switch state.

Example 1

Consider a 2 position switch such as EACON. For on (up) a DX25 is sent, and for off (down) RSHIFT + DX25 is pulsed.

 

Example 2.

Consider the 3 position FLAP switch. FWD sends DX22, AFT sends DX23 and back to MIDDLE send a pulse of RIGHT SHIFT + DX22.

 

In DCS for any model, for any switch, you just configure how you want the switch to work.

 

For say the Dora flaps, configure Normal flight to DX22, Take Off position to RIGHT SHIFT + DX22 and for Landing position, DX23. Your flap switch will now work correctly without MODs to any files.

 

For say the Huey, there is a toggle for both opening and closing the doors. You can assign 2 inputs to one DCS control. Using EACON as an example, bind both DX25 & DX25 + RSHIFT so that moving the switch up - the doors open, move it down - the doors close. See the youtube video for an example.

 

A10C

Additionally because all the DX codes used in the script are the same as if TARGET is not being used, it will works fine with A10C straight away without any configuration. (The RShift inputs are ignored..)

 

To do this you need to copy the file C:\Program Files\Eagle Dynamics\DCS World OpenBeta\Mods\aircraft\A-10C\Input\A-10C\joystick\Throttle - HOTAS Warthog.lua to say your desktop, rename it to Thrustmaster Combined.lua and place it it the same directory, thus: C:\Program Files\Eagle Dynamics\DCS World OpenBeta\Mods\aircraft\A-10C\Input\A-10C\joystick\Thrustmaster Combined.lua

RUNNING TARGET SCRIPT

If you run the TARGET script from the command line via a BAT file, the memory used is very small. It is easiest if you place the file "Gizzys-profile.tmc" in the same directory as ‘TARGETGUI.exeA simple '.BAT' file for my system is included - you may need to configure it for your directories - in addition I use the same BAT file to start TRACKIR and DCS 1.5 OB.

 

TO SUMMARISE

ONE SCRIPT TO RULE THEM ALL - One simple script that will cater for all Aircraft models AND all TMWH throttle switch states and axis without code changes or MODS.

 

· The TMWH Stick remains separate.

· Run the script from a BAT file before starting DCS.

· Configure all aircraft model switches within DCS as normal, when you need them, for ALL states.

· A10C will run just fine, ignoring any of the RSHIFT + DX codes - BUT you can now switch to any aircraft model and continue.

· 1 target script for all aircraft.

 

The files have been updated.

Slight change to script.

Help file now has screen prints included and perhaps easier to understand.

BAT file edited.

 

Heres a simple video explaining setting up and configuring 3 different switch types.

 

Any probs - shout... Hope this helps...

 

[ame]https://www.youtube.com/watch?v=REfJKlzuLk8[/ame]

 

 

PS: The video shows the .bat file command as

[font=Arial][font=Arial][font=Arial]start "Gizzys Profile" TARGETGUI.exe -r Gizzys-profile.tmc[/font][/font][/font]

This may cause complie errors, the tmc file if listed with path as shown below, will be fine...

start "Gizzys Profile" TARGETGUI.exe -r "C:\Program Files (x86)\Thrustmaster\TARGET\x64\Gizzys-profile.tmc"

The .bat file in the zipped download is good....

Gizzys Profile HELP.pdf

gizzys-profile.zip


Edited by Gizzy
UPDATE files...

 

SIGBLOCK.png

Link to comment
Share on other sites

Ouh, might be just what I was looking for!!

I never became good friends with Target (pretty much dumped it in frustration) but this sounds promising, and pretty straightforward to use.

Will check it out and report back!

System: Asus z270 A Prime, Intel i7-7700K 4.8GHz, 32GB DDR4, RTX2080, Samsung 500GB 850 EVO SSD.

Valve Index VR, TM Warthog Throttle & Grip, Virpil MongoosT-50CM2 base, TM TPDR Rudders.

OS: Win10 Home

 

 

Link to comment
Share on other sites

Interesting concept.

A question if I may, why are the toggles "hold", do you set them in game as pulse if required?

 

would the hold function on toggles swamp the buffer as they are always giving an output?.... do I get that right?


Edited by Rogue Trooper

HP G2 Reverb, Windows 10 VR settings: IPD is 64.5mm, High image quality, G2 reset to 60Hz refresh rate as standard. OpenXR user, Open XR tool kit disabled. Open XR was a massive upgrade for me.

DCS: Pixel Density 1.0, Forced IPD at 55 (perceived world size), 0 X MSAA, 0 X SSAA. My real IPD is 64.5mm. Prescription VROptition lenses installed. VR Driver system: I9-9900KS 5Ghz CPU. XI Hero motherboard and RTX 3090 graphics card, 64 gigs Ram, No OC at the mo. MT user  (2 - 5 fps gain). DCS run at 60Hz.

Vaicom user. Thrustmaster warthog user. MFG pedals with damper upgrade.... and what an upgrade! Total controls Apache MPDs set to virtual Reality height with brail enhancements to ensure 100% button activation in VR.. Simshaker Jet Pro vibration seat.. Uses data from DCS not sound.... you know when you are dropping into VRS with this bad boy.

Link to comment
Share on other sites

The 'HOLD' and 'PULSE' function is set in TARGET - when using DX codes 'HOLD' is good... DCS just recognises the switch state, there is no buffer unlike in the keyboard, which say if a character like 'h' was continously pressed or in 'hold' mode.... then sure you could have issues...

 

For the shifted DX codes, the keyboard 'shift' key is used, hence only a 'pulse' is sent.

 

 

So far all is working fine for all my models... the only issue is configuring a switch within DCS, normally select the control and move the switch and DCS selects the DX Code or keyboard key pressed. With 1.5 beta this is flaky, at least with me on W10 it is..., but there are drop down menus which are easy to use and select the right input...


Edited by Gizzy

 

SIGBLOCK.png

Link to comment
Share on other sites

Original Files have been updated.

 

Script file changed slightly.

 

In response to PM's

 

PDF set up help file with screen shots now included.

 

Explanatory Video now included.

 

*** INITIAL POST REVISED ****

 

Hope this helps....


Edited by Gizzy

 

SIGBLOCK.png

Link to comment
Share on other sites

Gizzy,

Are you planning on making one for the joystick?

 

Also, I think you can modify the mappings w/o using the GUI of DCS' CONTROLs tab. But, as you said, you don't have to mess with MODs etc.

 

thanks

hsb

HW Spec in Spoiler

---

 

i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1

 

Link to comment
Share on other sites

Gizzy,

Are you planning on making one for the joystick?

No, there is no need being with the joystick independent of the throttle all switches are by default single DX push and release compared to a toggle which is either DX ON for one state and nothing for the other.... or 2 ONs and nothing for a 3 way - the off state being selected at a time determined by you rather than a default OFF such as a push button type....

Also, I think you can modify the mappings w/o using the GUI of DCS' CONTROL's tab. But, as you said, you don't have to mess with MODs etc.

Yes, you can modify in script, (TARGET GUI will not accept DX codes & keyboard input for one switch) but then you will not have the concept of being able to assign any function to any switch state within DCS, for any aircraft, at any time, without messing with MODS or changing the TARGET file... I was toying with the ideas of putting in layers within the script, having alternative commands available for long pushes similar to the coolie hat function within A10c but I would rather be flying...

 

if DCS 2.0 was out and stable, I'll probably just edit the lua files... it is cleaner...

 

SIGBLOCK.png

Link to comment
Share on other sites

Thanks Gizzy. Makes sense on the joystick. Thanks for all the hard work.

hsb

HW Spec in Spoiler

---

 

i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1

 

Link to comment
Share on other sites

  • 2 weeks later...

Hey Gizzy , do i have to start the profile with the bat file ,can i just double click the profile and then start DCS ??

 

If not , can i delete the 2 lines that start DCS and track ir in tha bat file and i start DCS and Track ir manually ??

also will it work with DCS 2.0

Link to comment
Share on other sites

Hey Gizzy , do i have to start the profile with the bat file ,can i just double click the profile and then start DCS ??

 

If not , can i delete the 2 lines that start DCS and track ir in tha bat file and i start DCS and Track ir manually ??

also will it work with DCS 2.0

 

 

You can just double click on the .tmc file and it will start OK in the script editor window.

 

Then, manually fire up TRACKIR and DCS - obviously .tmc before DCS.. :)

 

For me this uses about 80mb of memory.

 

Starting it from a command line, as in a bat file, reduces overheads and it uses about 35mb memory.

 

If you intend to use it regularly, use a .bat file to start and to save memory if desired.

 

CD\
CD "C:\Program Files (x86)\Thrustmaster\TARGET\x64\"
start "Gizzys Profile" TARGETGUI.exe -r "C:\Program Files (x86)\Thrustmaster\TARGET\x64\Gizzys-profile.tmc"

If ever you want to start TRACKIR and DCS in the same bat file then I find putting a pause between each start line helps. There is no pause in W10 that I am aware of so use ping > null command to do the same thing.

 

CD\
CD "C:\Program Files (x86)\Thrustmaster\TARGET\x64\"
start "Gizzys Profile" TARGETGUI.exe -r "C:\Program Files (x86)\Thrustmaster\TARGET\x64\Gizzys-profile.tmc"
ping 127.0.0.1 -n 2 > nul
start "Gizzys Profile" "C:\Program Files (x86)\NaturalPoint\TrackIR5\TrackIR5.exe" 
ping 127.0.0.1 -n 2 > nul
Start "" "C:\Program Files (x86)\VoiceAttack\VoiceAttack.exe"
ping 127.0.0.1 -n 2 > nul
start "DCS" "C:\Program Files\Eagle Dynamics\DCS World OpenBeta\bin\DCS_updater.exe"

 

Hope this helps some..

 

SIGBLOCK.png

Link to comment
Share on other sites

Hey Gizzy, i gave your profile a try yesterday and it worked flawlessly , I though im obligated to tell you thank you for the effort and time you put in this so guys like me with little knowledge about programming can still enjoy the ability of a warthog hotas . you saved me hours of fiddling with TARGET .

Thank you

Link to comment
Share on other sites

  • 1 month later...

thanks Gizzy for your great work, I can't fly without it.

 

I have question and let me first quote this from your post

 

Consider the 3 position FLAP switch. FWD sends DX22, AFT sends DX23 and back to MIDDLE send a pulse of RIGHT SHIFT + DX22
So by referring to this statement I can say:

 

on Up position it will send DX22

now going down to MVR position and it will send RIGHT SHIFT + DX22

ok one more down to DN position and it will send DX23

now if I go up one click (i.e. MVR), it will send nothing! how I can make it send DX so flaps will go to retract middle. maybe RIGHT SHIFT + DX23?

i7-6700K | MSI Z170A Gaming M7 | Dominator 32GB 3000MHz | MSI GTX 1070 GAMING Z | 2TB SSD & 1TB HDD | Acer H277HU 27" WQHD | Audeze Mobius | TM Warthog | MFG Crosswind | TrackIR 5 | Windows 10 Pro

Link to comment
Share on other sites

......

So by referring to this statement I can say:

 

on Up position it will send DX22

now going down to MVR position and it will send RIGHT SHIFT + DX22

ok one more down to DN position and it will send DX23

now if I go up one click (i.e. MVR), it will send nothing! how I can make it send DX so flaps will go to retract middle. maybe RIGHT SHIFT + DX23?

 

For this script, its for 3 positions.. i.e. the flap switch

 

UP is DX22

MID is RSHIFT+DX22

DWN is DX23

 

Going from either the UP or the DWN position to the MID position will pulse RSHIFT+DX22

 

You could modify this is you wish to give 4 actions by using a release function..

 

i.e.

 

Going to UP sends DX22

Releasing UP pulses RSHIFT+DX22

 

Going to DWN sends DX23

Releasing DWN pulses RSHIFT DX23

 

Hope this helps a little :)


Edited by Gizzy

 

SIGBLOCK.png

Link to comment
Share on other sites

For this script, its for 3 positions.. i.e. the flap switch

 

UP is DX22

MID is RSHIFT+DX22

DWN is DX23

 

Going from either the UP or the DWN position to the MID position will pulse RSHIFT+DX22

 

You could modify this is you wish to give 4 actions by using a release function..

 

i.e.

 

Going to UP sends DX22

Releasing UP pulses RSHIFT+DX22

 

Going to DWN sends DX23

Releasing DWN pulses RSHIFT DX23

 

Hope this helps a little :)

 

exactly, you just gave me the hint :)

 

so this will be like this as per my understating:

MapKeyRIOUMD(&Throttle, FLAPU, PULSE+R_SHIFT+DX22, PULSE+R_SHIFT+DX22, PULSE+R_SHIFT+DX22, PULSE+R_SHIFT+DX22, PULSE+R_SHIFT+DX22, PULSE+R_SHIFT+DX22);
MapKeyRIOUMD(&Throttle, FLAPD, PULSE+R_SHIFT+DX23, PULSE+R_SHIFT+DX23, PULSE+R_SHIFT+DX23, PULSE+R_SHIFT+DX23, PULSE+R_SHIFT+DX23, PULSE+R_SHIFT+DX23);

i7-6700K | MSI Z170A Gaming M7 | Dominator 32GB 3000MHz | MSI GTX 1070 GAMING Z | 2TB SSD & 1TB HDD | Acer H277HU 27" WQHD | Audeze Mobius | TM Warthog | MFG Crosswind | TrackIR 5 | Windows 10 Pro

Link to comment
Share on other sites

Not sure where you are going aABSO but your insert will just add a RSHIFT to the DX codes for up and down ....

 

This line will send a DX22 when the FLAP moves into the UP position and when it leaves the UP position it will send a RSHIFT+DX22.... or whatever you want to use as an input..

 

Do something similar for the DOWN position using DX23 and you have 4 commands for a 3 way switch, but I am not sure why you would want such a thing... but good luck...

 

MapKeyIOUMD(&Throttle, FLAPU, CHAIN( DX22, D(), UP+R_SHIFT+DX22), CHAIN( DX22, D(), UP+R_SHIFT+DX22), CHAIN( DX22, D(), UP+R_SHIFT+DX22), CHAIN( DX22, D(), UP+R_SHIFT+DX22), CHAIN( DX22, D(), UP+R_SHIFT+DX22), CHAIN( DX22, D(), UP+R_SHIFT+DX22));

 

SIGBLOCK.png

Link to comment
Share on other sites

I will tell you the reason Gizzy, look at the attached photo which is the A-10A flaps DCS command.

 

the A-10A does not have the action for MVR Flaps, so using the action Flaps Up/Down twice will take you to MVR then DN Flaps. but the problem is in the way going up; as using Flaps Up/Down one time will take your flaps fully up.

 

What I want is to control my flaps to be on steps going down or up. The action Flaps Up is accepting to take the flaps MVR then full up. but this will make me need one more command from TARGET GUI

 

My solution is to make TARGET GUI send 4 commands and I will do the following:

 

Flaps Landing Position will take RSHIFT DX22 and DX23

Flaps Up will take RSHIFT DX23 and DX22

 

and this is the result:

 

[TABLE]At "Flaps Up"

DX22

down to "Flaps MVR"

RSHIFT DX22

down to "Flaps Dn"

DX23

up to "Flaps MVR"

RSHIFT DX23

up to "Flaps Up"

DX22[/TABLE]

 

So I have replaced your MapKeyIOUMD of FLAPM with the two MapKeyRIOUMD commands and it works nice :)

1824668517_A-10Aflap.png.4f98ff05d0d73c26cab917d6345cd88c.png


Edited by Rabso

i7-6700K | MSI Z170A Gaming M7 | Dominator 32GB 3000MHz | MSI GTX 1070 GAMING Z | 2TB SSD & 1TB HDD | Acer H277HU 27" WQHD | Audeze Mobius | TM Warthog | MFG Crosswind | TrackIR 5 | Windows 10 Pro

Link to comment
Share on other sites

  • 2 weeks later...

Gizzy,

 

Thanks a lot for the script. I do need your help. I want to basically map any 3-way switches to perform 3 actions. For DCS Huey, I would like to map the Autopilot switch on the Hog Throttle to the Huey Armament Control Panel to (Up - Armed, Middle - Safe, Down - Off).

I'm going to do the same for the FLAPS as well. I looked at rABSO's idea but I'm not sure if he's doing the same thing that I'm trying to do.

 

Thanks,

Gunny

Win 10 · i9900K@stock · 4070Ti· ASUS Z390-A · SSD · 64Gb · TM Warthog · CV1 · Quest 2

Link to comment
Share on other sites

The Huey is slightly different in that the DCS controls uses 2 toggles for your required action.

 

I suggest 2 possible choices... although there are other ways.....

 

Choice 1....

 

Tweek the script to so that...

 

on FLAPUP sends SHIFT+]

release FLAPUP sends SHIFT+[

 

on FLAPDOWN sends SHIFT+[

release FLAPDOWN sends SHIFT+]

 

FLAPMID set no commands.

 

This will work but of course the script will not be generic to other airframes.

 

Choice 2...

Modify your DCS or DCS openalpha Mods > aircraft > Uh-1H > Input > joystick > default.lua file to include...

 

{down = device_commands.Button_8, up = device_commands.Button_8, cockpit_device_id = devices.WEAPON_SYS, value_down = 1.0, value_up = 0.0, name = "Armament ARMED / SAFE", category = "Alternate Control"},
{down = device_commands.Button_8, up = device_commands.Button_8, cockpit_device_id = devices.WEAPON_SYS, value_down = -1.0, value_up = 0.0, name = "Armament OFF / SAFE", category = "Alternate Control"},

 

This will give you 2 new controls in DCS. In DCS controls set flapup to one and flapdown to the other... and you have your required action...

 

Once DCS stabilises to a solid DCW 2 personally for airframes that I regularly fly I would customise changes via lua files.

 

If you are not familiar with .lua if necessary I can send you a JSGME compatible file.

 

Hope this helps..

 

SIGBLOCK.png

Link to comment
Share on other sites

  • 6 months later...
  • 4 months later...

I have only just found this and have to say Gizzy thank you this is brilliant.

 

Just have one question how would I map the LED's to buttons with this script ?

 

For example I have Fuel Norm / Override set to Master Arm On / Off in the M2000C and would like LED 1 to light Up when the ARM Switch is in the on position.

 

I have tried using target and can get it working but when I try to add the lines to your profile it doesn't seem to like it

 

Thanks

Link to comment
Share on other sites

  • Recently Browsing   0 members

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