Jump to content

TARGET - Advanced programming


ivanwfr

Recommended Posts

speed-of-heat I can see the aparent usefullness of what you are trying to do. But keep in mind that you can still program keypresses/inputs to your shift or UMD. So if you program a momentary inputto your shift button, it will basicaly still do what you want, granted depending on what you are trying to do, there may be some situations where that shift still activating momentarily may be undesirable, but I've used it and it works fine for my aplications.

 

(hadn't seen your code yet when I posted)

 

 

yep i get that, thats why i bound it to other otherwise unused DX?


Edited by speed-of-heat

SYSTEM SPECS: Hardware Intel Corei7-12700KF @ 5.1/5.3p & 3.8e GHz, 64Gb RAM, 4090 FE, Dell S2716DG, Virpil T50CM3 Throttle, WinWIng Orion 2 & F-16EX + MFG Crosswinds V2, Varjo Aero
SOFTWARE: Microsoft Windows 11, VoiceAttack & VAICOM PRO

1569924735_WildcardsBadgerFAASig.jpg.dbb8c2a337e37c2bfb12855f86d70fd5.jpg

Link to comment
Share on other sites

sorry to be dense , how do i do that ? is it as simple as NULL?

SYSTEM SPECS: Hardware Intel Corei7-12700KF @ 5.1/5.3p & 3.8e GHz, 64Gb RAM, 4090 FE, Dell S2716DG, Virpil T50CM3 Throttle, WinWIng Orion 2 & F-16EX + MFG Crosswinds V2, Varjo Aero
SOFTWARE: Microsoft Windows 11, VoiceAttack & VAICOM PRO

1569924735_WildcardsBadgerFAASig.jpg.dbb8c2a337e37c2bfb12855f86d70fd5.jpg

Link to comment
Share on other sites

Like this:

MapKey(&Joystick,S3,TEMPO(DX5,0));

 

But hen you dont get the benefit of the delayed shift function. Another option is to use flags and then control the switched controls with exec commands

[sIGPIC][/sIGPIC]

Win10 64, Asus Maximus VIII Formula, i5 6600K, Geforce 980 GTX Ti, 32 GB Ram, Samsung EVO SSD.

Link to comment
Share on other sites

Like this:

MapKey(&Joystick,S3,TEMPO(DX5,0));

 

But hen you dont get the benefit of the delayed shift function. Another option is to use flags and then control the switched controls with exec commands

 

And for the second time time in as many minutes :) how would you do that?

SYSTEM SPECS: Hardware Intel Corei7-12700KF @ 5.1/5.3p & 3.8e GHz, 64Gb RAM, 4090 FE, Dell S2716DG, Virpil T50CM3 Throttle, WinWIng Orion 2 & F-16EX + MFG Crosswinds V2, Varjo Aero
SOFTWARE: Microsoft Windows 11, VoiceAttack & VAICOM PRO

1569924735_WildcardsBadgerFAASig.jpg.dbb8c2a337e37c2bfb12855f86d70fd5.jpg

Link to comment
Share on other sites

and thank you both ! and i still dont understand why it works!


Edited by speed-of-heat

SYSTEM SPECS: Hardware Intel Corei7-12700KF @ 5.1/5.3p & 3.8e GHz, 64Gb RAM, 4090 FE, Dell S2716DG, Virpil T50CM3 Throttle, WinWIng Orion 2 & F-16EX + MFG Crosswinds V2, Varjo Aero
SOFTWARE: Microsoft Windows 11, VoiceAttack & VAICOM PRO

1569924735_WildcardsBadgerFAASig.jpg.dbb8c2a337e37c2bfb12855f86d70fd5.jpg

Link to comment
Share on other sites

As far as I know you can't really delay the shift. What you can do is program a conditional input, that works as a shift, but it's not really a function like the IO or UMD shift states. You can use If conditionals or you can EXEC alternate "programings". For example this is part of a profile for the C-101 I made:

 

MapKey(&Throttle, EFLNORM, EXEC("FrontCokpit(); ActKey(KEYON+PULSE+USB[0x1E]);"));

MapKey(&Throttle, EFLOVER, EXEC("RearCokpit(); ActKey(KEYON+PULSE+USB[0x1F]);"));

 

int FrontCokpit()

{

MapKey(&Joystick, TG1, DX1);

MapKey(&Joystick, S1, DX3);

MapKey(&Joystick, S2, DX4);

MapKey(&Joystick, S4, DX6);

MapKey(&Joystick, H2U, DX7);

MapKey(&Joystick, H2R, DX8);

MapKey(&Joystick, H2D, DX9);

MapKey(&Joystick, H2L, DX10);

}

int RearCokpit()

{

MapKey(&Joystick, TG1, DX72);

MapKey(&Joystick, S1, DX73);

MapKey(&Joystick, S2, DX74);

MapKey(&Joystick, S4, DX76);

MapKey(&Joystick, H2U, DX77);

MapKey(&Joystick, H2R, DX78);

MapKey(&Joystick, H2D, DX79);

MapKey(&Joystick, H2L, DX80);

}

 

What it does is that when I Use the EFL Swith UP it programs some buttons on the stick a certain way and switches to the front cockpit. When I move it down it switches to the rear cockpit and reprograms those buttons with other inputs. But it doesn't use a "built in" TARGET shift mode to do this (I was already using the shift for something else).

 

EDIT: Some of that code is showing wrong because of forums functions and I can't be bothered to fix it, sorry.

Link to comment
Share on other sites

It works because you now have defined the S3 button to be the modifier. But it will still output the DX command you have assigned to it.

 

The flag thing is a bit more work and not necessarily better. Depends what you want to do.

Here is an example:

 

//define flag

char shift;

 

MapKey(&Joystick, S3, TEMPO( DX5, EXEC(" shift=1;"), 500));

MapKeyR(&Joystick, S3, EXEC(" shift=0;"));

 

MapKey(&Joystick, TG1, EXEC(" if (shift) ActKey( KEYON+ PULSE+ 'a') else ActKey( KEYON+ PULSE+ 'b')));

 

Not sure the code is flawless, I need to go to the other pc to check, but i hope you can get the idea.

[sIGPIC][/sIGPIC]

Win10 64, Asus Maximus VIII Formula, i5 6600K, Geforce 980 GTX Ti, 32 GB Ram, Samsung EVO SSD.

Link to comment
Share on other sites

 

What it does is that when I Use the EFL Swith UP it programs some buttons on the stick a certain way and switches to the front cockpit. When I move it down it switches to the rear cockpit and reprograms those buttons with other inputs.

 

 

Funny! I did the same for the F-14 except i used the APU switch.

[sIGPIC][/sIGPIC]

Win10 64, Asus Maximus VIII Formula, i5 6600K, Geforce 980 GTX Ti, 32 GB Ram, Samsung EVO SSD.

Link to comment
Share on other sites

thanks again Both , i will have a bit more of a play with those ideas and see what i can break :)

SYSTEM SPECS: Hardware Intel Corei7-12700KF @ 5.1/5.3p & 3.8e GHz, 64Gb RAM, 4090 FE, Dell S2716DG, Virpil T50CM3 Throttle, WinWIng Orion 2 & F-16EX + MFG Crosswinds V2, Varjo Aero
SOFTWARE: Microsoft Windows 11, VoiceAttack & VAICOM PRO

1569924735_WildcardsBadgerFAASig.jpg.dbb8c2a337e37c2bfb12855f86d70fd5.jpg

Link to comment
Share on other sites

Hi TARGET experts ! :)

 

I would like to know if I can call multiple macros using a button ?

 

I have in my ttm file :

 

 

 

define LDDI_1 CHAIN(D(50),PULSE+DX101, D(50))
define LDDI_2 CHAIN(D(50),PULSE+DX102, D(50))

 

 

and I would like to call both pressing S1 for example.

 

 

I did macro/define but I can do another solution if it works :)

 

 

thanks a lot !

Link to comment
Share on other sites

Where can I find a good script for the F-18 throttle that includes the detent lift to introduce fuel into the engine, as well as lift to shut engine down?

Rig: Alienware Aurora R9 - 9th Gen Core i7 9700K 4.6GHz 8 Cores | NVIDIA GeForce RTX 3060 Ti 8GB GDDR6 | 2TB M.2 PCIe NVMe SSD | 64GB Corsair Vengeance RGB PRO SL DDR4 3200MHz XMP 2.0 | LG Series80 QNED 50in 4K 120hz | TM Warthog HOTAS w/F-18 grip | Logitech G Pro RP | TM Cougar MFDs | TrackIR 5 Pro | VR: Oculus Quest 2 |

Modules: FC3 | F/A-18C | F-16C | A-10C II | F-14 | M-2000C | AV-8B | F-5E | JF-17 | P-51D | KA-50iii | UH-1H | AH-64D | Supercarrier | Combined Arms | Nevada | Persian Gulf | Syria | Normandy | Chanel |

Link to comment
Share on other sites

Hi TARGET experts ! :)

 

I would like to know if I can call multiple macros using a button ?

 

I have in my ttm file :

 

 

 

define LDDI_1 CHAIN(D(50),PULSE+DX101, D(50))
define LDDI_2 CHAIN(D(50),PULSE+DX102, D(50))

and I would like to call both pressing S1 for example.

 

 

I did macro/define but I can do another solution if it works :)

 

 

thanks a lot !

 

 

What are you trying to do in game, because I don't think the game would like it. What is LDDI_1 and LDDI_2 in game?

Night Ops in the Harrier

IYAOYAS


 
Link to comment
Share on other sites

Funny! I did the same for the F-14 except i used the APU switch.

 

Interesting, but I don't find this necessary for the F-14 as it has a diferent set of assignement for the back seat. And you can't use both at once. I actually leave most my inputs as DX assigned in game and just use target to do very specific things. In the F-14 I may have DX1 do one thing for the Pilot and another for the RIO. But this is not how it works in the C-101 all commands are avaiable to you at all times. So you have a for example a trigger assignement for the front seater and another for the back seater and they are both acessible to you regardless of the position you are in. Granted they activate the very much do the same in the plane and commands are mostly mirrored between cockpits, so it doesn't mater much if you are activating a particular input for the Front or Back seat, but... I can be really anal about this things.

Link to comment
Share on other sites

Where can I find a good script for the F-18 throttle that includes the detent lift to introduce fuel into the engine, as well as lift to shut engine down?

 

I just have it programed as DX inputs like this and the assign them in DCS. To the Right and Left Throttles On/Off positions.

 

 

MapKey(&Throttle, IDLEROFF, DX68);

MapKey(&Throttle, IDLELOFF, DX69);

MapKey(&Throttle, IDLERON, DX70);

MapKey(&Throttle, IDLELON, DX71);

Link to comment
Share on other sites

I just have it programed as DX inputs like this and the assign them in DCS. To the Right and Left Throttles On/Off positions.

 

 

MapKey(&Throttle, IDLEROFF, DX68);

MapKey(&Throttle, IDLELOFF, DX69);

MapKey(&Throttle, IDLERON, DX70);

MapKey(&Throttle, IDLELON, DX71);

 

Ok! I JUST found those idle buttons last night, on the throttle map in TARGET. Staring me in the face for days...

Rig: Alienware Aurora R9 - 9th Gen Core i7 9700K 4.6GHz 8 Cores | NVIDIA GeForce RTX 3060 Ti 8GB GDDR6 | 2TB M.2 PCIe NVMe SSD | 64GB Corsair Vengeance RGB PRO SL DDR4 3200MHz XMP 2.0 | LG Series80 QNED 50in 4K 120hz | TM Warthog HOTAS w/F-18 grip | Logitech G Pro RP | TM Cougar MFDs | TrackIR 5 Pro | VR: Oculus Quest 2 |

Modules: FC3 | F/A-18C | F-16C | A-10C II | F-14 | M-2000C | AV-8B | F-5E | JF-17 | P-51D | KA-50iii | UH-1H | AH-64D | Supercarrier | Combined Arms | Nevada | Persian Gulf | Syria | Normandy | Chanel |

Link to comment
Share on other sites

Hey Target professionals!

 

Had my first try on Target and hope you can help.

 

I would like to use it to map only a couple of stuff that is not well handled or to add some LED stuff on the throttle.

 

My problem is when activated, it just removes 90% of the buttons from the virtual device that I have to all map to keyboard keys which takes forever....

 

Is there a way to get Target virtual device to behave exactly as the original device, and then add couple of keyboard maping? This would save massive time as for lot of modules you can already assign buttons in a IF...else way so you don't need any manual maping there.

 

Hope I'm clear enough!

 

Thanks!

Link to comment
Share on other sites

Hey Target professionals!

 

Had my first try on Target and hope you can help.

 

I would like to use it to map only a couple of stuff that is not well handled or to add some LED stuff on the throttle.

 

My problem is when activated, it just removes 90% of the buttons from the virtual device that I have to all map to keyboard keys which takes forever....

 

Is there a way to get Target virtual device to behave exactly as the original device, and then add couple of keyboard maping? This would save massive time as for lot of modules you can already assign buttons in a IF...else way so you don't need any manual maping there.

 

Hope I'm clear enough!

 

Thanks!

 

 

Sounds like you want the process to fast easy and as little work as possible. Is that right?

LMAO!

 

 

So my following comments are for the TARGET Script Editor.

 

  1. Make yourself a script template.
  2. Use a Macro Generator.
  3. Get a copy of the Script Editor Basics manual on you Desktop.

Take a look at this thread

It can get you started and making what you describe, shouldn't take more than a hour.

 

 

If you need help with that please PM me.

Night Ops in the Harrier

IYAOYAS


 
Link to comment
Share on other sites

By default in any mapkey .tmc file, any button not defined simply passes thru.

 

Then again find/use the "120 DX" definitions target template and all button/switch position will be triggered in the default DCS controls definitions which improves your TMWH a lot.

| 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 |

Link to comment
Share on other sites

By default in any mapkey .tmc file, any button not defined simply passes thru.

 

Then again find/use the "120 DX" definitions target template and all button/switch position will be triggered in the default DCS controls definitions which improves your TMWH a lot.

 

Well that sounds like exactly what I'd like to do but when I use the GUI editor and don't create any event I still have pretty much every button removed from the virtual device :(

 

Is this only possible through pure script editing or am I doing it wrong in the GUI?

 

I'd love to get the buttons just passed through the virtual device while still able to map keys on them through the GUI editor.

That would be the more efficient way to do everything I want :)

Link to comment
Share on other sites

Well that sounds like exactly what I'd like to do but when I use the GUI editor and don't create any event I still have pretty much every button removed from the virtual device :(

 

Is this only possible through pure script editing or am I doing it wrong in the GUI?

 

I'd love to get the buttons just passed through the virtual device while still able to map keys on them through the GUI editor.

That would be the more efficient way to do everything I want :)

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)

CLEANED DX120 DCS TMWH.ZIP

| 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 |

Link to comment
Share on other sites

Been baning my head with this. It's so backward...

One thing I don't understand, in the manual of target it says you can make functions. But they are more like variables . Am I not understanding something here? Can I write my own functions inside main() ?

 

And how can I call it ?

 

and how can I printf flag values ? Can you only printf strings ? not flag values ?


Edited by Kevlon

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Been baning my head with this. It's so backward...

One thing I don't understand, in the manual of target it says you can make functions. But they are more like variables . Am I not understanding something here? Can I write my own functions inside main() ?

 

And how can I call it ?

 

and how can I printf flag values ? Can you only printf strings ? not flag values ?

 

 

main() is a function. So as far as I understand it, No!

But, you can make one in the same tmc or in a .tmh you include in your script..

Just an example:

int main() {
// call a function named "MyFunction"

MapKey(&Throttle, LTB, EXEC("MyFunction();"));
}
//Function "MyFunction"
int MyFunction() {  
                         What ever you want the function to do.
}

It might help us help you if you describe what you want to do.

Hope this helps

Night Ops in the Harrier

IYAOYAS


 
Link to comment
Share on other sites

  • Recently Browsing   0 members

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