Oldfox Posted April 30, 2020 Posted April 30, 2020 Don't use the GUI editor, or only use GUI editor for exporting script, which is a horrible way, you have to learn the TARGET scripting, and call a TARGET script file thru the TARGET GUI, amazingly the TARGET scripteditor cannot use command line calls, is why. Attached my - cleaned - DX setup files, you can edit DX120_DCS.tmc, so to not pass specific DX but to pass TARGET Commands (I do that for F18 autopilot macro on the TMWH 3-way autopilot toggle) Well that's basically exactly what I was looking for! Many thanks! With this it's just a mater of assigning buttons in DCS and adding just a bit of fantasy with leds and stuff manually in the script. Perfect :) Still have some script tricks to figure out though.... For example using 2 times the mapKey function on same button seems to cancel the first one instead of doing both actions. Will have to look into this!
majapahit Posted May 1, 2020 Posted May 1, 2020 Well that's basically exactly what I was looking for! Many thanks! With this it's just a mater of assigning buttons in DCS and adding just a bit of fantasy with leds and stuff manually in the script. Perfect :) Still have some script tricks to figure out though.... For example using 2 times the mapKey function on same button seems to cancel the first one instead of doing both actions. Will have to look into this! you have to read and know TARGET_SCRIPT_EDITOR_basics.pdf compare a sample script file with to content of this PDF and figure it out, looks horribly complex, but it's just a bad scripting language :) | 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 |
dmonds Posted May 1, 2020 Posted May 1, 2020 and how can I printf flag values ? Can you only printf strings ? not flag values ? As the good SGT has suggested...there are some excellent ideas and suggestions within this thread...it is WELL WORTH reading every page! In the meantime, the short answer is no...you can print any variable! printf("My int variable = %d", <int variable>); printf("My String variable = %s", <string variable>); printf("My float variable = %f", <float value>); And it gets better! Hope this helps. dmonds
Oldfox Posted May 1, 2020 Posted May 1, 2020 Takes bit of time to get into the head of a thrustmaster developper :) Finally got what I want: gearup/gear down, first led control with the gear, long press for emergency extend, and still working original DX button on virtual controller. NICE :) MapKey(&Throttle, LDGH, CHAIN(DX54,TEMPO(CHAIN(SEQ( PULSE+L_CTL+'g' , PULSE+L_SHIFT+'g'),SEQ( LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1), LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1))),PULSE+L_CTL+L_SHIFT+'g',1000)));
Kevlon Posted May 1, 2020 Posted May 1, 2020 Figured out the functions and all. Give it a go.! Working script for the su27, Should work for the Mig and Su33 also, haven't tested that. Working with a pinky modifier, 3 sub-functions, 2a2, nav and a2g (a2g is left empty atm since I don't use that much) Throttle lights indicate what program you are in. (a2a, nav or a2g) It also has a Flare and Caff program. I don't have a stick atm, that's why its all mapped to the throttle. Give me some feedback and Ill change it for you if you like to use this script.su27.zip [sIGPIC][/sIGPIC]
majapahit Posted May 1, 2020 Posted May 1, 2020 Figured out the functions and all. Give it a go.! Working script for the su27, Should work for the Mig and Su33 also, haven't tested that. Working with a pinky modifier, 3 sub-functions, 2a2, nav and a2g (a2g is left empty atm since I don't use that much) Well done. If only you tried this on the Tomcat 14B gazillion commands pilot/RIO etc, bought it, only take off and trapping, never got to the radar or weapons, too many commands. | 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 |
Kevlon Posted May 1, 2020 Posted May 1, 2020 Well done. If only you tried this on the Tomcat 14B gazillion commands pilot/RIO etc, bought it, only take off and trapping, never got to the radar or weapons, too many commands. Haha. yeah I bet. Figured I'll try to get it working with a simpler plane first. but even with the su27 . it takes a lot of time. Im going to try to implement the 3 way autopilot on it tomorrow. give it a test. I attached the files in the previous post [sIGPIC][/sIGPIC]
majapahit Posted May 1, 2020 Posted May 1, 2020 Haha. yeah I bet. Figured I'll try to get it working with a simpler plane first. but even with the su27 . it takes a lot of time. Im going to try to implement the 3 way autopilot on it tomorrow. give it a test. I attached the files in the previous post Never mind, lxsapper in this thread already said DCS F14B pilot/RIO separation interferes with functions list. Got your files, great sample. | 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 |
Kevlon Posted May 1, 2020 Posted May 1, 2020 Never mind, lxsapper in this thread already said DCS F14B pilot/RIO separation interferes with functions list. Got your files, great sample. There is a bug with the navigation, I cant seem to find what is is. do you have the same ? It wont go the next waypoint, only previous.... [sIGPIC][/sIGPIC]
SGT Coyle Posted August 29, 2020 Posted August 29, 2020 Anyone got any ideas for a function to have TARGET recognize a rapid double tap on a button? Looking to add an on the fly switch of functionality without changing Layers. Night Ops in the Harrier IYAOYAS
majapahit Posted August 29, 2020 Posted August 29, 2020 Anyone got any ideas for a function to have TARGET recognize a rapid double tap on a button? Looking to add an on the fly switch of functionality without changing Layers.manual: "Multiple outputs on a single button TEMPO Command" (this is actually a 'hold longer than') | 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 |
SGT Coyle Posted August 29, 2020 Posted August 29, 2020 manual: "Multiple outputs on a single button TEMPO Command" (this is actually a 'hold longer than') Absolutely right and correct. I don't know what I was thinking. I guess I always use TEMPO for long presses and just never think of it for the quick double tap. Thanks for reminding me of the basics. Night Ops in the Harrier IYAOYAS
SGT Coyle Posted October 19, 2020 Posted October 19, 2020 Anyone done a progressive output on a button press? I want a key press sent on a held button press that gets progressively faster the longer it’s held. Like adjusting the time on an old digital clock. I like this for flipping through kneeboard pages Night Ops in the Harrier IYAOYAS
Frederf Posted October 20, 2020 Posted October 20, 2020 That should be possible on an EXEC that calls an EXEC within itself with a duration variable. EXEC ( DX1, wait T, if (button) T = T/2, if T<minimumValue T=minimumValue, repeat function, else T = originalValue ) Does anyone know how to disable mouse emulation? Every time I start a script it snaps the mouse cursor to the middle of the screen which I assume is the mouse emulation initializing. I never use the mouse emulation so stripping it out and not having the virtual mouse would be a nice quality of life improvement.
SGT Coyle Posted November 25, 2020 Posted November 25, 2020 Anyone know what causes a Define stack full error in the compiler? I got this "Compile Error define stack full in TD_Functions.tmh at line 255", and I have no idea why. [color=#1e90ff][b]int[/b][/color] Cat_Hookup() { [color=#1e90ff][b]if[/b][/color] (Bar_Down >[color=#ffffff]0[/color]) { ActKey[color=#ffffff]([/color]PULSE + KEYON + Catapult_Hook_Up); <- [u][b][i]This is line 255[/i][/b][/u] Bar_Down = [color=#ffffff]0[/color]; } [color=#1e90ff][b]else[/b][/color] [color=#1e90ff][b]if[/b][/color] (Bar_Down < [color=#ffffff]1[/color]) { ActKey[color=#ffffff]([/color]PULSE + KEYON + [color=#ffffff]0[/color]); } Night Ops in the Harrier IYAOYAS
SGT Coyle Posted December 2, 2020 Posted December 2, 2020 (edited) Don't know what it was, but redoing it seemed to work. Found that automated Macro File Generator was placing "L_WIN + " as a modifier. That was breaking any USB[0x] commands. Edited December 3, 2020 by SGT Coyle Night Ops in the Harrier IYAOYAS
Oilman100 Posted December 31, 2020 Posted December 31, 2020 On 12/2/2020 at 12:56 AM, SGT Coyle said: Don't know what it was, but redoing it seemed to work. Found that automated Macro File Generator was placing "L_WIN + " as a modifier. That was breaking any USB[0x] commands. What automated Macro File Generator are you using, I used the one by Carlton2001 but it doesn’t work anymore and desperately need a new one to save hours of work, many thx Asus ROG IX | Intel i7-9700K | RTX 2080TI | G.SKILL 32GB DDR4 3200MHz RAM | Samsung 970 EVO 2TB M2 | LG 43” 4K Monitor | TrackiR | Stream Deck XL | Warthog HOTAS | Cougar MFDs x 3 | Saitek Rudder Pedals | Logitech G13| Corsair Virtuoso Wireless Headset |
Lange_666 Posted January 1, 2021 Posted January 1, 2021 I'm using this one: DCS_TARGET_Macro_File_Generator.ps1 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!
Oilman100 Posted January 1, 2021 Posted January 1, 2021 1 hour ago, Lange_666 said: I'm using this one: DCS_TARGET_Macro_File_Generator.ps1 8.23 kB · 1 download Yep that’s the one I’ve been using, but now when I run it, it just comes up with errors during the actual run sequence. I tried it with a html file I made a couple of months ago and it worked fine. When I open the actual new html file the format and the actual language looks completely different than what was being produced 2 months ago. Can you try it again on a html file created now and see whether it works, I’ve tried it on a couple of computers with same result. Asus ROG IX | Intel i7-9700K | RTX 2080TI | G.SKILL 32GB DDR4 3200MHz RAM | Samsung 970 EVO 2TB M2 | LG 43” 4K Monitor | TrackiR | Stream Deck XL | Warthog HOTAS | Cougar MFDs x 3 | Saitek Rudder Pedals | Logitech G13| Corsair Virtuoso Wireless Headset |
Lange_666 Posted January 1, 2021 Posted January 1, 2021 I'm having the same issue. Didn't test before i posted.Worked fine previously because all of my macro files were created (early 2020 and one a few months ago) with this macro file generator. Now it doesn't anymore. 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!
Oilman100 Posted January 7, 2021 Posted January 7, 2021 New macro generator for HTML has been uploaded by Carlton2001 in the user file section, many thx for upgrading this program to work with new html format Asus ROG IX | Intel i7-9700K | RTX 2080TI | G.SKILL 32GB DDR4 3200MHz RAM | Samsung 970 EVO 2TB M2 | LG 43” 4K Monitor | TrackiR | Stream Deck XL | Warthog HOTAS | Cougar MFDs x 3 | Saitek Rudder Pedals | Logitech G13| Corsair Virtuoso Wireless Headset |
SGT Coyle Posted January 7, 2021 Posted January 7, 2021 Thank God (or Carlton2001). I was pulling whats left of my hair out trying to hack my way through Powershell and HTML. Night Ops in the Harrier IYAOYAS
Glow Posted January 19, 2021 Posted January 19, 2021 (edited) Hello. I'm trying to achieve something: TG1 - on long press (1s) - Laser_OnOff - this is the first trigger stage; TG2 - Gun_Fire (on hold, when relesed stop, Gun_Fire off) - the second trigger stage; When I press trigger in Warthog, to the second stage - TG2, the first one - TG1 going on too. So, when I set this in a normal way mapping all this, every time I press fire for longer time my laser go on or off. // Warthog Joystick TG1 MapKeyIO(&Joystick, TG1, Null_Event, TEMPO(Null_Event, LDRF_switch, 1000)); // Warthog Joystick TG2 MapKeyIO(&Joystick, TG2, Null_Event, Gun_Fire); I wish to have long burst fire when using TG2 Gun_Fire but not to switch my Laser On or Off on TG1 Long press (1s) while shooting. From the manual: include "target.tmh" char flag1; //we create a flag called flag1 int main() { if(Init(&EventHandle)) return 1; flag1=0; //set the flag1 value to 0 at startup of the configuration MapKey(&Joystick, TG2, EXEC("flag1=1;")); //set the flag1 to 1 (true) when TG2 is pressed MapKeyR(&Joystick, TG2, EXEC("flag1=0;")); //set the flag1 to 0 (false) when TG2 is released MapKey(&Joystick, TG1, EXEC("if(flag1) ActKey(Weapon_Fire); else ActKey(LDRF_switch);")); MapKey(&Joystick, TG1, EXEC("if(TG2) ActKey(Weapon_Fire); else ActKey(LDRF_switch);")); } int EventHandle(int type, alias o, int x) { DefaultMapping(&o, x); } ( This will work only with PULSE+KEYON+'a'. If I remove PULSE or try tu use my definitions will not work. ) I can't make this code to use proper hold press recognition. I need something like this: MapKey(&Joystick, TG1, EXEC("if(TG2) ActKey(KEYON+'a'); else ActKey(KEYON+'b');")); With : TEMPO(Null_Event, LDRF_switch, 1000)); How to achive this ? Edited January 19, 2021 by Glow
SGT Coyle Posted January 19, 2021 Posted January 19, 2021 (edited) Bad cut n paste job Go here for working example. Edited January 20, 2021 by SGT Coyle Night Ops in the Harrier IYAOYAS
Lange_666 Posted January 20, 2021 Posted January 20, 2021 For me this part does not compile. I get a syntax error: ; expected in the first line (int Trigger1...). Problem is that i can' find the error...yet. int Trigger1() { if(Joystick[TG1]) ActKey(PULSE + KEYON + DX1); //Replace DX1 with your Macro or key combo or DX command } 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!
Recommended Posts