Lange_666 Posted February 22, 2020 Posted February 22, 2020 Bought a Warthog to replace my Cougar. Will be delivered on monday but took some advance and installed T.A.R.G.E.T. and want to do the programming through the script editor. Made macro files for the modules i have (converted a Foxy one first but then found a little Powershell script to make them out of the html's created from within DCS) and also created my first .tmc, a conversion from a Foxy tmj file. But... following the manual i also need to create a file called target.tmh (header file) and include it in the tmc file but here i'm stuck. I thought the manual would explain what needs to be in the tmh file but more then... From the manual: Target.tmh: To get your function to work, you must link your program to a file that contains the code for the Thrustmaster functions. This file is called a “header”; you will need to call it up in all your files, and it will be the first line of the file. It is called Target.tmh. The header files are used to store preformatted functions that you will call up in your main file. This makes the main file’s contents lighter and easier to read. We use headers to store standard tools. ...is not to be found in the manual leaving me with no clue what i need (or create/write) to make a target.tmh file. It says it needs the code for the Thrustmaster functions, preformatted functions but i have no clue what they are or how to write them. The manual says no more then the above so i'm already on my first red light. Full stop! Win11 Pro 64-bit, Ryzen 5800X3D, Corsair H115i, Gigabyte X570S UD, EVGA 3080Ti XC3 Ultra 12GB, 64 GB DDR4 G.Skill 3600. Monitors: LG 27GL850-B27 2560x1440 + Samsung SyncMaster 2443 1920x1200, HOTAS: Warthog with Virpil WarBRD base, MFG Crosswind pedals, TrackIR4, Rift-S, Elgato Streamdeck XL. Personal Wish List: A6 Intruder, Vietnam theater, decent ATC module, better VR performance!
SGT Coyle Posted February 23, 2020 Posted February 23, 2020 Target.tmh Is included in the TARGET software. Night Ops in the Harrier IYAOYAS
Clorydric Posted February 23, 2020 Posted February 23, 2020 You'll find target.tmh in "C:\Program Files (x86)\Thrustmaster\TARGET\scripts\target.tmh Short example (for the warthog throttle)... include "target.tmh" int main() { //EXCLUDE DEVICES HERE Configure(&HCougar, MODE_EXCLUDED); Configure(&JoystickF18, MODE_EXCLUDED); Configure(&T16000, MODE_EXCLUDED); Configure(&T16000L, MODE_EXCLUDED); Configure(&LMFD, MODE_EXCLUDED); Configure(&RMFD, MODE_EXCLUDED); Configure(&TWCSThrottle, MODE_EXCLUDED); Configure(&TFRPHARudder, MODE_EXCLUDED); Configure(&TFRPRudder, MODE_EXCLUDED); Configure(&Joystick, MODE_EXCLUDED); if(Init(&EventHandle)) return 1; //SETTINGS SetKBRate(32, 50); SetKBLayout(KB_EN); SetShiftButton(0, 0, 0, 0, 0, 0); //ADD YOUR MAPPINGS HERE } int EventHandle(int type, alias o, int x) { DefaultMapping(&o, x); } Don't forget to mod your target.tmh with the 120 button hack : https://forums.eagle.ru/showthread.php?t=171098 Intel 9900KF @ 5.1GHz / RTX 2080S OC @ 1.93GHz / ASUS Prime Z390-A / 2x16Gb DDR4 @ 3333 CL16 / Corsair TX850M / Samsung NVME 970 EVO+ / TM warthog Thr. / VKB Gunfighter mkIII + MCG / MFG Crosswind mk3 / Valve Index
Lange_666 Posted February 23, 2020 Author Posted February 23, 2020 Ah thanks. The traffic light has turned green again. My mistake. Thrustmaster bobo's didn't include an option to install their software where i want so i moved some stuff around after installation of the Target software. Then i cleaned some of the "old" FC2 stuff our and i must have removed the target.tmh along with it. Win11 Pro 64-bit, Ryzen 5800X3D, Corsair H115i, Gigabyte X570S UD, EVGA 3080Ti XC3 Ultra 12GB, 64 GB DDR4 G.Skill 3600. Monitors: LG 27GL850-B27 2560x1440 + Samsung SyncMaster 2443 1920x1200, HOTAS: Warthog with Virpil WarBRD base, MFG Crosswind pedals, TrackIR4, Rift-S, Elgato Streamdeck XL. Personal Wish List: A6 Intruder, Vietnam theater, decent ATC module, better VR performance!
lxsapper Posted February 23, 2020 Posted February 23, 2020 Ah thanks. The traffic light has turned green again. My mistake. Thrustmaster bobo's didn't include an option to install their software where i want so i moved some stuff around after installation of the Target software. Then i cleaned some of the "old" FC2 stuff our and i must have removed the target.tmh along with it. yeah like Clorydric said. Forget that File, use this one instead: https://forums.eagle.ru/showthread.php?t=171098&highlight=targetdx128
Drakoz Posted February 28, 2020 Posted February 28, 2020 There are actually 4 files you need: target.tmh, hid.tmh, defines.tmh, and sys.tmh. target.tmh is referenced by the include in your program, but the other 3 are referenced using include statements in target.tmh and hid.tmh. Anyway, you have to make sure all 4 files are available. As already stated, by default, they are here: C:\Program Files (x86)\Thrustmaster\TARGET\scripts\ But, you can also put these files in your personal TARGET scripts folder. By default your personal scripts are stored here (where %USERNAME% represents your Windows user name): C:\Users\%USERNAME%\AppData\Roaming\Thrustmaster\TARGET\Scripts If you put target.tmh (and the other .tmh files) there, it will use those files instead of the version found in the Program Files folder. So if you do modify or use modified .tmh files, you should put them in your personal scripts folder and not touch the originals. This makes it easier to edit the files as well because they aren't behind a protected folder. You can set these file locations in the TARGET Script editor under Options -> File Paths. By default, when you install TARGET, it includes the directories mentioned above. The order of precedence (using the .tmh files in your personal folder instead of those in Program Files) is determined by the order of paths in the File Paths options. So since you are using a custom installation, I thought might care. But.... Since you are just starting out with TARGET, I would suggest don't use the modified target.tmh people are referencing above. Well, not unless you actually need more than 32 DX buttons. Learn TARGET in its unmodified state first, and only go to modifying target.tmh when you understand why you care. It is a great mod. Just saying, don't go there until you need it. 1
lxsapper Posted February 28, 2020 Posted February 28, 2020 There are actually 4 files you need: target.tmh, hid.tmh, defines.tmh, and sys.tmh. target.tmh is referenced by the include in your program, but the other 3 are referenced using include statements in target.tmh and hid.tmh. Anyway, you have to make sure all 4 files are available. As already stated, by default, they are here: C:\Program Files (x86)\Thrustmaster\TARGET\scripts\ But, you can also put these files in your personal TARGET scripts folder. By default your personal scripts are stored here (where %USERNAME% represents your Windows user name): C:\Users\%USERNAME%\AppData\Roaming\Thrustmaster\TARGET\Scripts If you put target.tmh (and the other .tmh files) there, it will use those files instead of the version found in the Program Files folder. So if you do modify or use modified .tmh files, you should put them in your personal scripts folder and not touch the originals. This makes it easier to edit the files as well because they aren't behind a protected folder. You can set these file locations in the TARGET Script editor under Options -> File Paths. By default, when you install TARGET, it includes the directories mentioned above. The order of precedence (using the .tmh files in your personal folder instead of those in Program Files) is determined by the order of paths in the File Paths options. So since you are using a custom installation, I thought might care. But.... Since you are just starting out with TARGET, I would suggest don't use the modified target.tmh people are referencing above. Well, not unless you actually need more than 32 DX buttons. Learn TARGET in its unmodified state first, and only go to modifying target.tmh when you understand why you care. It is a great mod. Just saying, don't go there until you need it. It's not a bad advice, but since extra complication is next to nil with using that file (it's just extra DX assignments to play with) and I literally needed this (I keep away from Keyboard strokes as much as possible, even back then, but still like to use programing to do the things I can't by other means) when I started with TARGET (and didn't have it) so... This should have been default with TM TARGET IMO specially when the driver obviously had the ability to do so. Merging at least two devices that have 51 DXinputs + 16Directional Hats positions, and forcing you to take a max of 32Dx inputs + 8inputs in the directional hat. Was a stupid move by TM that put me off of TARGET for a long time.
Drakoz Posted February 28, 2020 Posted February 28, 2020 Merging at least two devices that have 51 DXinputs + 16Directional Hats positions, and forcing you to take a max of 32Dx inputs + 8inputs in the directional hat. Was a stupid move by TM that put me off of TARGET for a long time. Agreed. And how cool it is that TM gave us the .tmh files so we can play with this stuff. Not sure if they intended it that way, but I am profusely glad they did. I am even creating my own versions of functions like EXEC() and AXMAP1() to do special things (e.g. call it AXMAP3). I would never have figured any of that out without the .tmh files.
lxsapper Posted February 28, 2020 Posted February 28, 2020 Curious to know what you are cooking... be sure to keep us in the loop! :)
Drakoz Posted February 29, 2020 Posted February 29, 2020 (edited) lxsapper said: Curious to know what you are cooking... be sure to keep us in the loop! So that I don't hijack this thread, I created a new thread to explain my "AXMAP3" function. See it here: Edited December 23, 2021 by Drakoz
Recommended Posts