DX or Target Profile
-
Once you have the TARGET script spitting out DX commands (or, shudder, keystrokes) you’re 99% done. Pairing commands to callbacks is the easy part.
I had to look up Kolbe’s spreadsheet thing. It’s impressive but thanks but no thanks. You know how there are ~1000 lines in the generated keyfile? My keyfile is 192 lines long and it could be shorter. Look at the callbacks present by default: SimHUDVelocityTAS, SimReticleStby, SimILSOn, etc. It’s too much! I have TrackIR and a mouse, that is plenty. First thing is did was delete all the stuff I don’t use which was much of it. Over weeks and months I added back in maybe 3-4 commands as I needed them.
So not including the keyboard-radio AI menu and the DX section I have 100 lines. Not such a big job now is it?
-
Ok so far the idea of having to write a an actual code scared me off.
So if I have a TARGET script for my throttle only and want to assign additional DX-commands to the joystick, how do I do that?
I guess if i would use TARGET for the throttle and the spreadsheet for the joystick i might into some compatibility problems?
Guess i will spend the next week learning to write a target script and use mud’s profile for the time, since it seems very easy to use.
Be advised i will probably come back here to ask more annoying questions
Thanks for the great help so far -
Go into setup>controls and click an entry then press the appropriate joystick button. Repeat for all entries to bind to the joystick. Of course load your .key file before that and save it after. When the joystick is excluded from the TARGET Combined Device it’s “natural” like TARGET wasn’t running at all. Looking at the .key file in notepad the results are pretty obvious.
-
Ok, so if i want to add functions, i can just use Kolbe’s Keyfile to generate the DX entries?
I’d like to add shifted functions for throttle and stick and am wondering if that might cause conflicts.
Just as an example: Let’s say i want to have Trim Reset on the pushbutton of the left throttle (unshifted) and wheelbrakes (shifted), throttle is programmed via TARGET script editor. As Shift button i want to use the button behind the paddle switch (sry don’t know the names of all buttons yet) as shift button, stick is programmed via DX commands in the keyfile.
Will that work?
Sry for bothering again. -
The spreadsheet? I don’t know too much about it but it seems to procedurally generate the appropriate lines for the .key file but then again so does the game itself in 97% of use cases. So it comes down to what tool you are comfortable with that does the job.
Personally I would say ain’t no thing as trim reset in the real jet so ignore it and for wheel brakes buy pedals or use the keyboard but I’m not here to dictate taste in controls setup and this is a great situation to describe. Working from your concrete example you want to use the “SSC pinky” as a shift button. My first thought is because the smartest way to use TARGET is to exclude the joystick you want to exclude the joystick. Of course excluding the joystick prevents you from applying custom TARGET profile behavior. No problem! BMS has built into it a special shift callback already called SimHotasPinkyShift. So you would bind SimHotasPinkyShift to the switch on your joystick. Easy. If you “short press” this button it operates the pinky function in the F-16 and if you “long press and hold” it shifts all the DX numbers on your gear up by 256.
OK now we want to bind the Left Throttle Button on the throttle controller to two functions, one shifted, one not. Unshifted is easy. There is a line in the TARGET script something like
MapKey(&Throttle, LTB, DX3);So you press LTB and the DX3 input is made. You go into the game setup>controls, find “trim reset” and press this button. Save key file. Check key file you find this line at the bottom.
AFResetTrim 2 8 -2 0 0x0 0This is ID #2 (DX3) bound to this callback. Good so far.
Now we want to bind wheel brakes to ID 258 (2+256). But we cannot do that in the setup>controls section because it’s impossible to press button ID 258. So we use Notepad to text edit the .key file. We make a copy of the trim reset line, change the callback and ID number.
AFResetTrim 2 8 -2 0 0x0 0
SimWheelBrakes 258 8 -2 0 0x0 0Almost done. Because pinkyshift callback raises all DX ID by 256, it also raises itself. For example say that the pinky button had DX ID 13 (It was button DX14). The problem is once the DX IDs are raised it is impossible to release button 14 because it doesn’t exist anymore. All you have is button 14+256. The fix is to have two binds for SimHotasPinkyShift, one for each ID that this button can be. If you don’t then you find that pinky “sticks” and never receives release event.
SimHotasPinkyShift 34 8 -2 0 0x0 0
SimHotasPinkyShift 290 8 -2 0 0x0 0OK now done.
-
Sry for the late reply, almost forgot about this thread, since i flew with morphine’s profile for the last weeks.
Thanks for the great explanation. Ok, so i guess for now i’ll just edit my keyfile and add the hotas keys in there and come back to target scripting when i need more advanced functionalities. I guess that i once more made things more complicated than need be, it’s one of my few talents:rolleyes:
Thanks a lot for helping and clearing things up.Regards D_Fens
-
Tried morphine’s profile but it didn’t work for me and i usually prefer creating my own profiles anyway.
Ok, so i thought i’d give it a try and created a profile using only DX-commands with the keyfile.
But i’d like to keep the idle cutoff functionality and the throttle axis as programmed in his target file. I removed the key mapping and everything but the axis. Now when i run the script i don’t have the dx mappings from my keyfile anymore
Do i have to map the keys for the throttle within the script editor or did i just mess up the syntax or something?Regards Stranger
-
First check if your TARGET device is outputting any DX values at all by looking at TARGET’s device analyzer. The left side is the input from controller; the right is DX output. If nothing is being output then BMS has no hope to recognize it.
With good output you go into BMS>Setup>Controls list and press a button like “DMS down” if it shows “DMS down” below the list .key file is correct. If not DX input must be bound to callback.
-
Tried morphine’s profile but it didn’t work for me and i usually prefer creating my own profiles anyway.
Ok, so i thought i’d give it a try and created a profile using only DX-commands with the keyfile.
But i’d like to keep the idle cutoff functionality and the throttle axis as programmed in his target file. I removed the key mapping and everything but the axis. Now when i run the script i don’t have the dx mappings from my keyfile anymore
Do i have to map the keys for the throttle within the script editor or did i just mess up the syntax or something?Regards Stranger
To use the Idle Cutoff and the Throttle Axis functionality you have to use TARGET. However, the remainder of your profile can still be all Direct X.
The first thing you would need to do is remove the Joystick from the TARGET profile so that it’s seen as a separate DX Device. You will then need to adjust your DX mappings in BMS as it will now “see” two devices (a separate joystick and a separate throttle called TM Combined). I created a profile (keyfile and TARGET script attached) similar to what you are wanting to do that you can use for ideas/starting point. I moved a couple of the DX numbers around to be able to use the Hat as a DX button as BMS only recognizes one 8 way HAT at a time. The key file is essentially Kolbe’s Full keyfile so refer to that for key mappings.
-
Hi Morphine,
Thanks a lot for your help and the profiles.
Yesterday i got it to work for a short time, but still ran into some trouble.
If I use your keyfile BMS still doesn’t recognize input frome the throttle but I guess that’s just some problem with the device numbers. The throttle alias Thrustmaster combined is listet as the first, the joystick as the second device. I just copy pasted my dx commands as created with Kolbe’s spreadsheet into his Keyfile and in conjunction with your target profile it worked.Problem is that BMS doesn’t recognize certain switch positions. For example only the ARM position of the EAC switch is recognized. Obviously the problem is, that only this poition is recognized as a DX button. I realize that this is a windows/BMS related problem.
But i would really want to use the switches in all positions listed in the spreadsheet.
I also realize that I (probably) have to use a target profile to make the switches work as i want them to. And i’m definitely willing to learn how to use the script editor to make the most use of my warthog. There’s only two things that i’d like to avoid: First making things more complicated than need be and more important: to spend hours learning how to use the editor and creating a script just to see that i’m trying to make something work, that’s just not possible due to limitations.I have attached my desired profile. Sry for the size but i didn’t know how to export it more “readable” from the spreadsheet :wfish:
1: Are functions like the ones mapped to the flapu switch or the ENG OPER switches actually possible as mapped in the picture below?
2: Looking at your profile i see that for example you managed to make both “physical” positions of the EAC work. How did you achieve this?
My idea would be that there’s one command for the ARM position which gets recognized as a button press by windows and then in the script an additional command for the button release when switching to the OFF position. Would that actually work?Sry for the long post and all the questions. Brief answers should suffice. Actually i only want to have some verifications to avoid wasting days of work just to realize, that i have been trying to achieve something impossible or that i make things unnecessarily complicate.
I promise to try and bother you as less as possible in the future:rolleyes:
Help would really be appreciated.Regards D_Fens
-
BMS doesn’t recognize anything but keyboard and DX. It is possible to program TARGET so it gives a DX# on EACON or EACOFF or both or neither pulsed or held. With TARGET anything is possible.
The problem with assigning DX1 with EACON and DX2 with EACOFF is it takes two DX# and you only have 32. For simple 2-position switches if you have a callback which is a toggle (SimSwitchToggle instead of SimSwitchOn SimSwitchOff) then you can map MapKey EACON PULSE+DX1 and MapKey EACOFF PULSE+DX1 (or MapKeyR EACON PULSE+DX1). Then you bind DX1 to SimSwitchToggle. So no matter if you are flipping EAC switch up or down it sends DX1 and BMS knows that DX1 is SimSwitchToggle. The only problem is if they get out of sync (joystick switch is up, cockpit switch is down) but that is fixed by flipping the switch once by mouse.
TARGET understands all states of all switches FLAPM FLAPU FLAPD for example. The default mapping of DX# to the FLAPM is non-existent by default but that doesn’t mean it has to be. With a custom TARGET script you can make FLAPM do something.
-
Frederf, thanks a lot, that seems like a great solution :bowd:
Could have come across that myself but well, as i said i have that tendency to make simple things complicated.
My idea would have been to add additional lines with key presses for the missing positions, but your idea sounds much more elegant and easier to apply.
Only problem would be switches like the MRM and DF override function which don’t have toggle functionality. But i think that could be solved by using a “hybrid method”.
For functions like the ones on the FLAPU switch just the DX buttons as suggested by you and key presses where there is no toggle functionality.
As for the sync problem, i don’t think that it actually is to much of a problem if you check, if your switches are in sync at rampstart, or any procedure where you would have to check the correct position of the switches anyway. Plus actually having to check the position of an actual physical switch should add a lot to immersion.The versatility of this hotas is really amazing. Especially in combination with this forum and all those great guys helping out newbies
Thanks a lot for all your guys help :bowd:
-
For the very specific case of the DGFT/MRM switch there is an option in BMS where MRM or DGFT are only engaged while the button/key for that mode is being held down.
set g_bHotasDgftSelfCancel 1 // set to 1 = SRM and MRM override callbacks will call the override cancel callback for youSo whatever switch you’re using (say BOAT) you just have forward hold down DX# and aft hold down DX$ and the middle position does nothing. If neither override buttons are being held it self-cancels. It saves a DX to keep under the 32 limit.
3-pos switches like the autopilot pitch channel you can program in clever uses of the cycle to save a DX but I cashed in my 32-limit savings to bind each position of the switch with the callback for that specific switch pos. I was getting some funky desync trying to make macros.
-
@D-Fens… Lots of good advice and instruction from Frederf.
One other thing I forgot to mention is that when selecting the “controller” in the BMS configuration screen, make sure you select the Thrustmaster Joystick and not the Thrustmaster Combined. This makes the Joystick the primary controller and enables the POV hat to work properly. Then select the appropriate controller in the subsequent Axis Setup screens as needed.
-
Sry for the late reply. At least for once i wanted to reply with a succes instead of a new question.
I can’t thank you guys enough for your help. Everything’s as it should now:headb:
With your permission i’d like to post it in the forum.Regards D_Fens