Havner Posted February 8, 2015 Posted February 8, 2015 (edited) I wrote a simple program that converts DCS keyboard shortcuts to TM TARGET macros. It basically does what Sim2target was doing but works with current DCS and fixes few issues Sim2target had. Also I've tried the output to be as similar to Sim2target's as possible. The LUA part is based on Sim2target scripts, C++ is written from scratch by me. As I'm not really into GUI programming this is just a command line tool compiled using cygwin so there is little point to even post binaries. I think they won't work without Cygwin installed. For the brave the sources are here: https://github.com/Havner/dcs2target For those of you who can't compile it, here are files generated using it on my DCS installation. I have most modules released (I miss Mig-21 and C-101): http://vega.livecd.pl/~havner/dcs/dcs2target_output.zip Two versions of macros are there. One using usb keys remapped to human readable form and one using directly raw USB codes. The non-raw version requires inclusion of lib-usb.tmh header included in the package. EDIT (27.02.2017): The zip file has been regenerated and as of this date it includes all currently released modules. Edited February 28, 2017 by Havner 1 [sIGPIC][/sIGPIC]
hansangb Posted February 8, 2015 Posted February 8, 2015 Interesting. Thanks for that! I've been meaning to build a universal profile; maybe this will motivate me!! hsb 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
Havner Posted August 9, 2015 Author Posted August 9, 2015 Mig-21 added to the file linked in OP. [sIGPIC][/sIGPIC]
majapahit Posted August 11, 2015 Posted August 11, 2015 now, if only I could find time to get to know TARGET | VR goggles | Autopilot panel | Headtracker | TM HOTAS | G920 HOTAS | MS FFB 2 | Throttle Quadrants | 8600K | GTX 1080 | 64GB RAM| Win 10 x64 | Voicerecognition | 50" UHD TV monitor | 40" 1080p TV monitor | 2x 24" 1080p side monitors | 24" 1080p touchscreen |
AKA_Clutter Posted May 21, 2016 Posted May 21, 2016 Havner, I have just acquired a TM Warthog HOTAS and just starting to learn. Years ago I had the TM Cougar HOTAS and currently use CH gear. In both cases I found it beneficial to learn the profile method rather than just mapping the keys. As such, I do plan on learning TARGET. The first question I have, is what does this program actually do? Does it simply read the various Lua script files for the controllers and make TARGET macro files? IF so, do you run it once and then again only when there is a update to the modules that changes the key command profiles? My guess is that you just need to do this for one flavor (DCS 2.0, 1.5 beta, or stock 1.5) and that can be used in any flavor once created. Is that correct? TIA BTW o7 ---------------- AKA_Clutter Win 10 Pro, Intel i7 12700k @4.6 GHz, EVGA RTX 3080 FTW, Ultra 64 GB G.Skill DDR4 3600 RAM, Acer 27" flat screen, HP Reverb G2, TM Warthog HOTAS with Virpil warBRD base, MFG Rudder Pedals, Virpil TCS Rotor Base with AH-64Dcollective, TrackIR 5 Pro w/Vector Expansion, PointCTRL.
majapahit Posted May 21, 2016 Posted May 21, 2016 Havner, Does it simply read the various Lua script files for the controllers and make TARGET macro files? IF so, do you run it once and then again only when there is a update to the modules that changes the key command profiles? My guess is that you just need to do this for one flavor (DCS 2.0, 1.5 beta, or stock 1.5) and that can be used in any flavor once created. Is that correct? TIA BTW o7 nope, TARGET is written to intervene all hardware output to the OS. Thus TARGET can make the HOTAS output anything it wants. That’s wonderful for button shifted states, as many as you like, and programming ‘release’ state of buttons, this a much missed feature of the TM HOTAS driver. Most present HOTAS switches do On or Not_On, and the Not_On cannot be programmed, unless you know and do this through the SDK, which DSC did for the Warthog. To be able to do the Warthog definition as DCS did, but for any and all aircraft (or any simulator and any aircraft), and do a lot more with macros, you need TARGET. Unfortunately, TARGET is horribly complicated in that the interface is terribly non-intuitive. For the most basic operations other than ‘when switch do this’ you need to know all of TARGET, and that is a lot. And too much for most people, including myself, you need many many hours to even get through and past the basics. (What a waste of all such possibilities, for most people) | VR goggles | Autopilot panel | Headtracker | TM HOTAS | G920 HOTAS | MS FFB 2 | Throttle Quadrants | 8600K | GTX 1080 | 64GB RAM| Win 10 x64 | Voicerecognition | 50" UHD TV monitor | 40" 1080p TV monitor | 2x 24" 1080p side monitors | 24" 1080p touchscreen |
Havner Posted May 21, 2016 Author Posted May 21, 2016 (edited) When you install TARGET software, in its scripts are macro files for various planes from FC and old DCS that basically translate keys into names so you can use those names when creating your profile. Those files are very much outdated and there used to be a software once that could regenerate them but it doesn't work anymore. My program is just an update for that functionality. 1. Yes, it reads those LUA files from DCS and generates those macros. 2. Exactly 3. This depends whether there are any differences between 1.5 and 2.0. In most cases those 2 versions are updated pretty much together so I think doing this once (e.g. on 1.5) should be enough Bear in mind that this is just a command line tool that requires cygwin to be compiled. It's not nice windows GUI application, that's why I actually generated those files and uploaded them. They have been done quite some time ago and I don't own all DCS modules so can't do that for every plane. If you won't be able to do this yourself give me a shout, I'll update them. As I think of it now in theory I could do this for all planes, as I don't need to own them. I can download them without a serial. I won't of course be able to fly them, but the LUA files will be there. Anyway, it's been some time since I've looked at this tool. Let me know if you need some help. EDIT: but this program is not a must to create TARGET profiles in any way. It just makes them look nicer and easier to maintain when the key definitions change. You can just regenerate macros, don't need to hunt down your keys in the profile you made. Edited May 21, 2016 by Havner [sIGPIC][/sIGPIC]
Havner Posted May 21, 2016 Author Posted May 21, 2016 (edited) Most present HOTAS switches do On or Not_On, and the Not_On cannot be programmed, unless you know and do this through the SDK, which DSC did for the Warthog. Not through any SDK but just by modifying LUA input files in DCS. There are threads on this forum that tell you how to do that. I've done that for a lot of switches myself for all the planes I own. But this has nothing to do with the program in question anyway. I myself use a mixed profiles. Some things done by TARGET, some other by modified LUA files. Edited May 21, 2016 by Havner [sIGPIC][/sIGPIC]
AKA_Clutter Posted May 21, 2016 Posted May 21, 2016 Havner, A couple more questions For brave the sources are here: https://github.com/Havner/dcs2target Why for the brave? Two versions of macros are there. One using usb keys remapped to human readable form and one using directly raw USB codes. The non-raw version requires inclusion of lib-usb.tmh header included in the package. Is there an advantage of one of these over the other, and if so what is it? Thanks again ---------------- AKA_Clutter Win 10 Pro, Intel i7 12700k @4.6 GHz, EVGA RTX 3080 FTW, Ultra 64 GB G.Skill DDR4 3600 RAM, Acer 27" flat screen, HP Reverb G2, TM Warthog HOTAS with Virpil warBRD base, MFG Rudder Pedals, Virpil TCS Rotor Base with AH-64Dcollective, TrackIR 5 Pro w/Vector Expansion, PointCTRL.
Havner Posted May 21, 2016 Author Posted May 21, 2016 Why for the brave? Because they require compiling them by hand in a cygwin environment and then running from a command line. Not everybody is keen on doing that :-) Is there an advantage of one of these over the other, and if so what is it? One set of macros will use numerical codes for the keys so you don't immediately know what key it is referring to. The others will use macros for them (e.g. USB[XX] vs USB_some_letter). If you just want to use those macros there is no difference. If you want to look at the macros and know what keys they are actually mapping there is. [sIGPIC][/sIGPIC]
cichlidfan Posted May 21, 2016 Posted May 21, 2016 That last bit makes it so much better than Sim2Target. I have been hand building ttm files for years just so they were easily read. ASUS ROG Maximus VIII Hero, i7-6700K, Noctua NH-D14 Cooler, Crucial 32GB DDR4 2133, Samsung 950 Pro NVMe 256GB, Samsung EVO 250GB & 500GB SSD, 2TB Caviar Black, Zotac GTX 1080 AMP! Extreme 8GB, Corsair HX1000i, Phillips BDM4065UC 40" 4k monitor, VX2258 TouchScreen, TIR 5 w/ProClip, TM Warthog, VKB Gladiator Pro, Saitek X56, et. al., MFG Crosswind Pedals #1199, VolairSim Pit, Rift CV1 :thumbup:
AKA_Clutter Posted May 23, 2016 Posted May 23, 2016 (edited) Havner, I have more questions. Because they require compiling them by hand in a cygwin environment and then running from a command line. Not everybody is keen on doing that :-) OK, I did that and after a while I figured out I needed to download g++ and supporting files. After it was pretty easy. I ran both phase1 and phas2 without any problems. :) Now to my questions. I have additional modules beyond have you have. So I went into the lua parser and added lines for each of the modules that I have that wasn't in the list. The .bat file runs fine, but the exe gives me the following error. $ ./dcs2target_phase2 convShortcut(): 111: empty key shortcut Edit: 5/23/16 - This error appears to be due to the fact that there are blnk commands in the C-101 default keyboard.lua file. I did recompile the exe, but the same error occurred. I edited the lua file with notepad++ so that shouldn't be an issue. Any idea what I may be missing? Does the order matter? Here are some of the lines in the parser with the ones I added. 'Mods/aircraft/A-10C/Input/', 'Mods/aircraft/Bf-109K-4/Input/', 'Mods/aircraft/C-101/Input/', 'Mods/aircraft/F-86/Input/', 'Mods/aircraft/FW-190D9/Input/', 'Mods/aircraft/Hawk/Input/', 'Mods/aircraft/Ka-50/Input/', Edit: 5/23/16 - It appears that I did break something in either the batch file, or more likely in the dcs2target_parser.lua file. Now back to digging and learning. :-) Thanks, Edited May 24, 2016 by AKA_Clutter Update information ---------------- AKA_Clutter Win 10 Pro, Intel i7 12700k @4.6 GHz, EVGA RTX 3080 FTW, Ultra 64 GB G.Skill DDR4 3600 RAM, Acer 27" flat screen, HP Reverb G2, TM Warthog HOTAS with Virpil warBRD base, MFG Rudder Pedals, Virpil TCS Rotor Base with AH-64Dcollective, TrackIR 5 Pro w/Vector Expansion, PointCTRL.
Havner Posted May 24, 2016 Author Posted May 24, 2016 I have additional modules beyond have you have. So I went into the lua parser and added lines for each of the modules that I have that wasn't in the list. You did that ok. The .bat file runs fine, but the exe gives me the following error. $ ./dcs2target_phase2 convShortcut(): 111: empty key shortcut Edit: 5/23/16 - This error appears to be due to the fact that there are blnk commands in the C-101 default keyboard.lua file. I tried to be as strict with errors or strange input as possible. Hence the program will give up when it encounters something that it doesn't understand not to produce a skewed macro. Almost every new module had something awkward. I've fixed it for all the ones I own. Can't remember right now (without looking at the code) what this error means exactly. I'll download the C-101 and the Hawk over the next few days and will try to fix that. Shouldn't be too hard. I edited the lua file with notepad++ so that shouldn't be an issue. Any idea what I may be missing? Does the order matter?notepad++ is fine, order shouldn't matter. Here are some of the lines in the parser with the ones I added.That's fine. [sIGPIC][/sIGPIC]
AKA_Clutter Posted February 27, 2017 Posted February 27, 2017 Hi Havner, It's me again, and I am having problems. I have a small understanding of programing, an a little DOS, so I get the jest of these, but not the details. If it is something simple, please just point me in the correct direction and I will try and figure it out. Below is a wall of text. Sorry. When I run the *.bat file, I get the list shown, and the Phase 1 directory shown. All the files that are listed on the screen output don't show up in the directory. Is there some DCS file format error that could be causing this? Anyway, here is the screen out put. =-=-=-=-=-=-=-=-=- Main-PC /cygdrive/c/games1/dcs/dcs_world/dcs2target-master $ ./dcs2target_phase1.bat C:\games1\dcs\dcs_world\dcs2target-master>rem set DCS_FOLDER=C:\Games\DCS C:\games1\dcs\dcs_world\dcs2target-master>set DCS_FOLDER=.. C:\games1\dcs\dcs_world\dcs2target-master>set LUA_CPATH=..\bin\lua-?.dll;..\bin\?.dll C:\games1\dcs\dcs_world\dcs2target-master>..\bin\luae.exe dcs2target_parser.lua .. ..\bin\luae.exe: dcs2target_parser.lua:150: attempt to concatenate a table value stack traceback: dcs2target_parser.lua:150: in main chunk [C]: ? A-10C A-10C_easy Bf-109K-4 Bf-109K-4_easy F-86F F-86F_easy FW-190D9 FW-190D9_easy ka-50 ka-50_easy MiG-21 Mi-8MTV2 Mi-8MTV2_easy Mi-8MTV2_Gunner Mi-8MTV2_TrackIR_Gunner MiG-15bis MiG-15bis_easy P-51D P-51D_easy su-25T TF-51D TF-51D_easy UH-1H UH-1H_easy UH-1H_Gunner UH-1H_TrackIR_Gunner Input SU-25T: Mods/aircraft/Su-25T/Input/su-25T MIG-15BIS: Mods/aircraft/Mig-15bis/Input/MiG-15bis TF-51D_EASY: Mods/aircraft/TF-51D/Input/TF-51D_easy KA-50_EASY: Mods/aircraft/Ka-50/Input/ka-50_easy UH-1H_TRACKIR_GUNNER: Mods/aircraft/Uh-1H/Input/UH-1H_TrackIR_Gunner BF-109K-4: Mods/aircraft/Bf-109K-4/Input/Bf-109K-4 P-51D_EASY: Mods/aircraft/P-51D/Input/P-51D_easy UH-1H_GUNNER: Mods/aircraft/Uh-1H/Input/UH-1H_Gunner A-10C_EASY: Mods/aircraft/A-10C/Input/A-10C_easy UH-1H_EASY: Mods/aircraft/Uh-1H/Input/UH-1H_easy MIG-21: Mods/aircraft/MIG-21bis/Input/MiG-21 UH-1H: Mods/aircraft/Uh-1H/Input/UH-1H FW-190D9_EASY: Mods/aircraft/FW-190D9/Input/FW-190D9_easy TF-51D: Mods/aircraft/TF-51D/Input/TF-51D A-10C: Mods/aircraft/A-10C/Input/A-10C KA-50: Mods/aircraft/Ka-50/Input/ka-50 P-51D: Mods/aircraft/P-51D/Input/P-51D BF-109K-4_EASY: Mods/aircraft/Bf-109K-4/Input/Bf-109K-4_easy MI-8MTV2_GUNNER: Mods/aircraft/Mi-8MTV2/Input/Mi-8MTV2_Gunner MIG-15BIS_EASY: Mods/aircraft/Mig-15bis/Input/MiG-15bis_easy F-86F: Mods/aircraft/F-86/Input/F-86F MI-8MTV2_TRACKIR_GUNNER: Mods/aircraft/Mi-8MTV2/Input/Mi-8MTV2_TrackIR_Gunner F-86F_EASY: Mods/aircraft/F-86/Input/F-86F_easy CA: Mods/tech/CombinedArms/Input MI-8MTV2: Mods/aircraft/Mi-8MTV2/Input/Mi-8MTV2 MI-8MTV2_EASY: Mods/aircraft/Mi-8MTV2/Input/Mi-8MTV2_easy FW-190D9: Mods/aircraft/FW-190D9/Input/FW-190D9 After this I executed dcs2target_pahse2.exe and I ended up with the files. The exe files ends abruptly and I have to close the CGWIN window. Phase1 & Phase 2: A-10C_keyboard_default F-86F_keyboard_default.txt KA-50_EASY_keyboard_default.txt KA-50_EASY_keyboard_default.txt.conflict MIG-15BIS_EASY_keyboard_default.txt MIG-15BIS_keyboard_default.txt MIG-21_keyboard_default.txt MIG-21_keyboard_default.txt.conflict P-51D_EASY_keyboard_default.txt TF-51D_keyboard_default.txt Again, ay help will be greatly appreciated. Also, if you want to just point me in a direction, I will do some research. I have wanted to delve into programing but never did. Thanks m Clutter ---------------- AKA_Clutter Win 10 Pro, Intel i7 12700k @4.6 GHz, EVGA RTX 3080 FTW, Ultra 64 GB G.Skill DDR4 3600 RAM, Acer 27" flat screen, HP Reverb G2, TM Warthog HOTAS with Virpil warBRD base, MFG Rudder Pedals, Virpil TCS Rotor Base with AH-64Dcollective, TrackIR 5 Pro w/Vector Expansion, PointCTRL.
Havner Posted February 28, 2017 Author Posted February 28, 2017 Hi AKA_Clutter I sat down to it. The first issue with LUA failing was due to MI-8 having the same keys in multiple categories. I just picked the first defined in keyboard.lua, so a corresponding key will be in only one, but it will still be there. I also installed all the modules there are (including ones I do not have) and remade the program a little to work for everything. The mod list in LUA file works a little bit differently now, as it doesn't specify a whole module but every single variant. In general you need to pass a directory that contains name.lua file. It will take the variant name from that file. 'Mods/aircraft/Uh-1H/Input/UH-1H/', 'Mods/aircraft/Uh-1H/Input/UH-1H_easy/', 'Mods/aircraft/Uh-1H/Input/UH-1H_Gunner/', 'Mods/aircraft/Uh-1H/Input/UH-1H_TrackIR_Gunner/',I added all currently existing modules to the list and re-uploaded the generated ZIP file from the first post. github has been updated as well. As to why your phase2 hangs I have no idea. It works for me without problems. If you still need to generate them myself in the future and you stumble upon this try debugging it. Compile with -g param and run through GDB to see what is going on. There are several tutorials on the net how to do that. I added some output to phase2 so one can see what it is parsing at the moment. Have fun. Also please let me know if the generated TTM files work. I have no means to check that myself ATM. [sIGPIC][/sIGPIC]
AKA_Clutter Posted March 1, 2017 Posted March 1, 2017 Havner, WOW Thanks for the update. I wasn't expecting that, just hoping that you would point me in a direction. With that said, I may still try and debug. I need to lean stuff. :-) As to the Phase 2, I think it was working OK as the contents of the directory matched that of the Phase 1. Thanks again kind sir. ---------------- AKA_Clutter Win 10 Pro, Intel i7 12700k @4.6 GHz, EVGA RTX 3080 FTW, Ultra 64 GB G.Skill DDR4 3600 RAM, Acer 27" flat screen, HP Reverb G2, TM Warthog HOTAS with Virpil warBRD base, MFG Rudder Pedals, Virpil TCS Rotor Base with AH-64Dcollective, TrackIR 5 Pro w/Vector Expansion, PointCTRL.
Havner Posted March 1, 2017 Author Posted March 1, 2017 You're welcome. Do the TTM files work? [sIGPIC][/sIGPIC]
AKA_Clutter Posted March 2, 2017 Posted March 2, 2017 Havner, Uh ... ... ... I don't know yet. I have had my TM Warthog in a box for 6 - 8 months. So, I haven't yet tried to program them. I am now at the point where I need to and this is the first stage. I will let you know as soon as I get to that point. In looking at them, they look like they should. ---------------- AKA_Clutter Win 10 Pro, Intel i7 12700k @4.6 GHz, EVGA RTX 3080 FTW, Ultra 64 GB G.Skill DDR4 3600 RAM, Acer 27" flat screen, HP Reverb G2, TM Warthog HOTAS with Virpil warBRD base, MFG Rudder Pedals, Virpil TCS Rotor Base with AH-64Dcollective, TrackIR 5 Pro w/Vector Expansion, PointCTRL.
AKA_Clutter Posted March 4, 2017 Posted March 4, 2017 Havner - just got a chance to compile and run your update programs. Worked like a charm. Hopefully I will get to point of using the ttm files later this week. Thanks you again sir! o7 ---------------- AKA_Clutter Win 10 Pro, Intel i7 12700k @4.6 GHz, EVGA RTX 3080 FTW, Ultra 64 GB G.Skill DDR4 3600 RAM, Acer 27" flat screen, HP Reverb G2, TM Warthog HOTAS with Virpil warBRD base, MFG Rudder Pedals, Virpil TCS Rotor Base with AH-64Dcollective, TrackIR 5 Pro w/Vector Expansion, PointCTRL.
Recommended Posts