Jump to content

HOTAS Target Management


Horten229

Recommended Posts

Aerosoft's implementation of the F-16 FCR (Radar) is an effective tool for tracking and pursuing aircraft but the mouse-based control of it is inconvenient and unrealistic. The problem really lies with FSX which is not a combat simulator and lacks true target management functions. Aerosoft's implementation with mouse-over regions on the MFD works but doesn support a HOTAS (Hands on Throttle and Stick) approach.

To improve the usability of the FCR and make the flying experience more realistic, I have developed a "gauge" that allows target management to be controlled with joystick buttons. It is specifically designed for the ThrustMaster HOTAS Cougar system (F-16 spec flight controls) Target Management button but should work with any joystick button or key that can be programmed by FSX. It implements the FCR select next target function as well as select previous target, increase radar range and decrease radar range functions.

The only problem with the implementation is that it is not completely independent of the Aerosoft LMFD FCR implementation. Because of the local nature of the FSX ITrafficInfo:SelectVehicle function used to display in-range target information, a code change must be made to Aerosoft's LMFD gauge. The issue is how to distribute this.

The simplest approach is to put all of the gauge code in a modified LMFD gauge. This approach is both sensitive to future Aerosoft changes and potentially violates Aerosoft's copyright.

The alternative approach is to provide most of the functionality in a separate gauge along with instructions on how to make the necessary modifications to the Aerosoft LMFD gauge. The code change is small requiring only the insertion of about 12 lines of code in one place. This minimizes changes to the Aerosoft code and can be easily reapplied when new versions of the MFDs are released.

I prefer the second approach but I wanted an opinion from Aerosoft on the distribution approach before making it freely available to the flight sim community.

Thanks

Link to comment
Share on other sites

The idea sounds great to me. You should talk to Scott (aka saprintz) about this, he's to one who did the HUD and MDF stuff.

I don't own the HOTAS Cougar, but would it also work on the Saitek X52?

Link to comment
Share on other sites

I decided that, since an update must be made to the Aerosoft LMFD file for this to work, why not simplify the whole process and put it all in one step. That way, there is no copyright issues and the user is resposible. I also did some further reserach on F-16 Side Stick controller function and modified the controls and suggested mapping to make them more realistic.

So here are the modification instructions to add target management command to the control stick, complete with the necessary code snippet to make it work.

Modification Instructions (revised 12/18/08)

The following assumes Microsoft FSX and Aerosoft F-16 is installed in the default location.

1. Goto the folder C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\SimObjects\Airplanes\Aerosoft F-16A 9\Panel

2. Create a new folder named TargetMgmt in the Panel folder.

3. Open MFD.CAB (in the same folder).

4. Right click on LMFD.xml and select Extract. Extract the file to C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\SimObjects\Airplanes\Aerosoft F-16A 9\Panel\TargetMgmt.

5. Open TargetMgmt\LMFD.xml in Notepad.

6. Insert the following code before the end of the Update Script near the top of the file (on line 28 between } and </Script> in version 1.11 and earlier versions of the system) (Note, the tabs get lost in the post. You may want to retab the code for readability):

<!-- Target Management Controls for the Side Stick Controller -->

(A:CABIN NO SMOKING ALERT SWITCH, bool) 0 !=

if{

<!-- Step Bug/Select Next Target -->

0 (&gt;L:LockSw, number)

(L:Target Cycle, number) (&gt;C:ITrafficInfo:SelectedVehicle)

(C:ITrafficInfo:SelectedVehicleID) (&gt;C:fs9gps:1:SelectedVehicle)

(L:Target Cycle, number) ++ (&gt;L:Target Cycle, number)

(L:Target Cycle, number) (C:ITrafficInfo:MaxVehicles) 1 - ==

if{

0 (&gt;L:Target Cycle, number)

}

(&gt; K:CABIN_NO_SMOKING_ALERT_SWITCH_TOGGLE)

}

(A:CABIN SEATBELTS ALERT SWITCH, bool) 0 !=

if{

<!-- Designate Target/Target Lock/Air-to-Air -->

1 (&gt;L:AA, bool)

0 (&gt;L:LockSw, number)

(&gt; K:CABIN_SEATBELTS_ALERT_SWITCH_TOGGLE)

}

(A:STRUCTURAL DEICE SWITCH, bool) 0 !=

if{

<!-- Disable Air-to-Air/Target Lock -->

0 (&gt;L:AA, bool)

1 (&gt;L:LockSw, number)

(&gt; K:ANTI_ICE_OFF)

}

(A:ALTERNATE STATIC SOURCE OPEN, bool) 0 !=

if{

<!-- Aerial Refueling Connect/Disconnect -->

(L:switch_probe_refuel, bool) ! (&gt; L:switch_probe_refuel, bool)

(&gt; K:TOGGLE_ALTERNATE_STATIC)

}

<!-- End Target Management Controls -->

7. Save the LMFD file.

8. Replace guage06 with the following in C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\SimObjects\Airplanes\Aerosoft F-16A 9\Panel\Panel.cfg

// MFD with Event Driven Target Management

gauge06=TargetMgmt!LMFD, 6,310,165,170

9. Make the following change to the appropriate Aircraft.cfg (which one(s) depends on which aircraft versions you fly):

[DEICE_SYSTEM]

structural_deice_type = 1

10. In FSX - Settings - Controls Buttons/Keys set

- Cabin alert - No Smoking (on/off) - the button for step bug/select next target (Target Management Switch right)

- Cabin alert - Seatbelts (on/off) - the button for designate target/Air-to-Air mode (Target Management Switch up)

- De-ice (on/off) - the button for disable Air-to-Air mode (Target Management Switch down)

- Altnerate static source (on/off) - the button for toggling Aerial Refueling (A/R DISC (index finger button))

Notes:

1. The above modification works for most of the F-16 liveries. However, the following liveries

- RNLAF, J-055, 313 sqn DEMO, Volkel AFB

- BAF, FA-131, Solo Display Team

- USAF Aerial Demo Team, Thunderbirds, 57th FW, Nellis AFB

use the panel in C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\SimObjects\Airplanes\Aerosoft F-16AM Display\Panel. Just copy the TargetMgmt folder and update the Panel.cfg file if you use those liveries.

2. If the Left MFD comes up blank, you made the modifications incorrectly. Start over!

3. This has been tested with Aerosoft F-16 Versions 1.01, 1.10 and 1.11. It may not work with future changes.

4. No warrantees are expressed or implied.

Link to comment
Share on other sites

Mr. "Horten229",

Great addition to this bird ... I'll try this out myself next week, on my time off, with my HOTAS Cougar and aid you in further testing it. Maybe Mr. Kok will add this, with your permission, to the actual bird in another update. :)

Good Addition! :)

  • Upvote 1
Link to comment
Share on other sites

Will this work if i am useing the x-52 seitek??

I don't have a Saitek X52 (I use the Thrustmaster Hotas Cougar) so I can't say for sure. But the Target Management modification really has nothing to do with a specific joy stick. All it really really does is activate some of the MFD/RCR controls (Target Designate, Range Increase, Air-to-Air mode, and Air-to-Air/Target Select Reset) by FSX key codes. The key codes can then be mapped to joy stick and keyboard functions using the FSX - Settings - Controls Buttons/Keys screen. In theory, any joy stick or controller that can be set up with the Control Buttons/Keys screen should work.

Link to comment
Share on other sites

Will this work if i am useing the x-52 seitek??

Read my above posts. It works perfectly for me and I'm using the X52.

On another note:

Can you make a control to open the re-fueling probe??

Link to comment
Share on other sites

Can you make a control to open the re-fueling probe??

I think so.

If you insert the following code into the LMFD.xml file (add to the code above).

(A:WATER RUDDER HANDLE POSITION, percent) 50 &gt;

if{

<!-- Aerial Refueling Connect/Disconnect -->

(L:switch_probe_refuel, bool) 0 ==

if{

1 (&gt; L:switch_probe_refuel, bool)

}

els{

0 (&gt; L:switch_probe_refuel, bool)

}

(&gt; K:TOGGLE_WATER_RUDDER)

}

and replace the following line under [CONTACT_POINTS] in the appropriate aircraft.cfg

point.7= 5, 0.00, 0.00, 0.00, 0, 0, 0.00, 0.0, 0.00, 0.00, 0.0, 0.0, 0.0, 9,9999, 9999

(Note, the default line might work. I was concerned about activating the water rudder at speed and breaking it as well as fast operation.)

Then set FSX - Controls - Buttons/Keys - Water rudder (up/down) to the appropriate button.

This should open/close the fuel door. This control is one of the functions of the mode dependent index finger button on the Side Stick Controller. You can put it where ever on the X52.

And I say "I think so" because I only tested that it activates the Indexer RDY/DISC lights and didn't actually try aerial refueling. You get to do that.

P.S. Adding functions can't go on forever. There are only so many key events defined, not used, and functional in the sim. And I think we may have just run out!

Link to comment
Share on other sites

I think so.

If you insert the following code into the LMFD.xml file (add to the code above).

(A:WATER RUDDER HANDLE POSITION, percent) 50 &gt;

if{

(L:switch_probe_refuel, bool) 0 ==

if{

1 (&gt; L:switch_probe_refuel, bool)

}

els{

0 (&gt; L:switch_probe_refuel, bool)

}

(&gt; K:TOGGLE_WATER_RUDDER)

}

and replace the following line under [CONTACT_POINTS] in the appropriate aircraft.cfg

point.7= 5, 0.00, 0.00, 0.00, 0, 0, 0.00, 0.0, 0.00, 0.00, 0.0, 0.0, 0.0, 9,9999, 9999

(Note, the default line might work. I was concerned about activating the water rudder at speed and breaking it as well as fast operation.)

Then set FSX - Controls - Buttons/Keys - Water rudder (up/down) to the appropriate button.

This should open/close the fuel door. This control is one of the functions of the mode dependent index finger button on the Side Stick Controller. You can put it where ever on the X52.

And I say "I think so" because I only tested that it activates the Indexer RDY/DISC lights and didn't actually try aerial refueling. You get to do that.

P.S. Adding functions can't go on forever. There are only so many key events defined, not used, and functional in the sim. And I think we may have just run out!

Water Rudder is the pilot visor, and I love that! :lol:

Link to comment
Share on other sites

Water Rudder is the pilot visor, and I love that! :lol:

It took me a while to figure out what you are talking about. It's in the manual but all it does is activate an animation of the pilot putting his visor up and down. Cute, but no particularly useful.

Unfortunately, I haven't yet found another key that is workable. :(

Link to comment
Share on other sites

  • Aerosoft
It took me a while to figure out what you are talking about. It's in the manual but all it does is activate an animation of the pilot putting his visor up and down. Cute, but no particularly useful.

Unfortunately, I haven't yet found another key that is workable. :(

Scott is working on something else rigth now but when he is available I will ask him to insert some options that will allow more keys to be used.

Link to comment
Share on other sites

Mr. Horton229,

I got it all to work beautifully on my TM HOTAS Cougar; Great Addition; Thank you! B)

But I do have a minor bug to report:

1. When the A-A mode is disabled (using the Cabin alert - Seatbelts (on/off) - the button for designate target/Air-to-Air mode (Target Management Switch up)), the gauge also disables the Radar. But it does NOT re-engage the radar if the A-A mode is turned ON again using ONLY your gauge programmed functions. I have to manually (using the mouse) push the NORM (Enable/Disable Target Locking on the MFD) to get it to work again. See attached Pic.

post-13668-1229117495_thumb.jpg

PS: All my tests were performed with TM's HOTAS Cougar and v1.11.

I also Fixed it : - It needed the following line inserted 0 (&gt;L:LockSw, number)

(A:STRUCTURAL DEICE SWITCH, bool) 0 !=

if{

<!-- Disable Air-to-Air/Target Lock -->

0 (&gt;L:AA, bool)

1 (&gt;L:LockSw, number)

0 (&gt;L:LockSw, number) <----

(&gt; K:ANTI_ICE_OFF)

}

And a few requests:

1. Could you add a DECREASE RNG Function to the RADAR as well?

2. Could you add a RNG (Inc/Dec) to the GPS/Map of the Right MFD also?

3. Could you change the Water-Rudder assignment to something else?

Thank you very much Mr. Horton229 - This really makes this Bird even more awesome. B):DB):D

******************************

Staff,

Here is a Pic of me performing the entire "Operation" with HOTAS (NO Keyboard or NO Mouse usage). This is a MUST feature for this Bird; please add it to the next update. Thank you.

post-13668-1229117514_thumb.jpg

  • Upvote 1
Link to comment
Share on other sites

Fixed above bug! B)

However, you didn't say how (so others could take advantage).

But first, some discussion.

It was actually working as designed. The rationale was that you "deselect" or undesignate the target (turn off air-to-air and the radar). Therefore designating the target doesn't make sense as there is no target selected. You have to select a target/step the bug to designate one which turns the radar back on. However, it also steps the target.

In reality (if you don't step the bug), the system internally still has the same target selected (bugged). So what you are trying to do probably does make sense (not a bug in the code but a misinterpretation of the requirements :) ).

The way I would (did) fix it is to add the following in the Designate Target/Target Lock/Air-to-Air code segment

0 (&gt;L:LockSw, number)

On your other requests:

1. I had the code to decrease the radar range at one time, but removed it because F-16s don't seem to have this function on the Side Stick Controller. The Pinky Switch on the Side Stick Controller only expands the field of view. There is something like it on the Throttle Quadrant System. The Manual Range knob on the Manual Range/Uncage Switch controls the radar gain that is somewhat like the range adjustment. However, this is a control axis and not a switch (although on the HOTAS Cougar, it might as well be a switch).

2. I have thought about adding range controls for the GPS/Map as well. Should they be coordinated with the RCR or separate?

3. Conceptually I don't like using the Water-Rudder either.

The problem with all of these changes is available key codes. I actually have spent a lot of time researching this in the tool kit documentation and experimenting to find key codes that work and don't have strange side effects (i.e., are used for other functions). There are a few out there but very few that I know of and none that are suitable. But I will research it some more.

Link to comment
Share on other sites

No I added that fix and posted it here. But you feel free to take credit as it is really all your work. :)

I look forward to any more additions. I would be very pleased if Mr. Scott added your work to the next update; if you can find the time to finish it with a few other features. Thanks a bunch; these additions really made my day. :D

  • Upvote 1
Link to comment
Share on other sites

No I added that fix and posted it here. But you feel free to take credit as it is really all your work. :)

I look forward to any more additions. I would be very pleased if Mr. Scott added your work to the next update; if you can find the time to finish it with a few other features. Thanks a bunch; these additions really made my day. :D

Doh! I guess you have to read the whole post! Sorry.

Anyway, what you did works but in a different way. buy setting LockSw to 0 you enabled radar locking that setting it to 1 disabled. You could have just removed the "1 (&gt;L:LockSw, number)" line. Although, technically, your fix would disable locking set manually (with the mouse) and deleting the line wouldn't do that. (I think we are in the weeds.)

And as to taking credit for the code, as far as I'm concerned, anyone, including Aerosoft, has my permission to use it any way they want to. It was developed to increase the realism of this awsome simulation and I wanted to share it with others.

Link to comment
Share on other sites

Doh! I guess you have to read the whole post! Sorry.

Anyway, what you did works but in a different way. buy setting LockSw to 0 you enabled radar locking that setting it to 1 disabled. You could have just removed the "1 (&gt;L:LockSw, number)" line. Although, technically, your fix would disable locking set manually (with the mouse) and deleting the line wouldn't do that. (I think we are in the weeds.)

And as to taking credit for the code, as far as I'm concerned, anyone, including Aerosoft, has my permission to use it any way they want to. It was developed to increase the realism of this awsome simulation and I wanted to share it with others.

Mr. Horten229,

Yes, I'm aware of its usage - I just wanted to fix it quick without tampering with your code too much - A patch essentially. ;)

Also, I suggest using the additional instrument function calls/events NOT assigned to keys for all the other features:

post-13668-1229136285_thumb.jpg

I like the realistic features you've added. 1. And for the CTRL + W (Water Rudder) Fuel bay Toggle, could you use the ADF (Select) method [CTRL + SHIFT + A] for this event instead?

BTW: The "MAN RNG/UNCAGE button" on the F-16's TQ is a rotating knob with a push button function all in one button. The rotating function allows for two way turns for RNG inc/Dec from a center detent. In FSX (or Windows) you can program a slider to it. 2. So perhaps, if your able, you can marry the RNG inc/dec to a slider feature? :unsure: Anyway, what you've done here is exceptional; Let's see what Aerosoft does with it.

3. Can you add the additional features mentioned? GPS RNG with RCR, etc.

Thanks a million! :D

  • Upvote 1
Link to comment
Share on other sites

Mr. Horten229,

Yes, I'm aware of its usage - I just wanted to fix it quick without tampering with your code too much - A patch essentially. ;)

Also, I suggest using the additional instrument function calls/events NOT assigned to keys for all the other features:

post-13668-1229136285_thumb.jpg

I like the realistic features you've added. 1. And for the CTRL + W (Water Rudder) Fuel bay Toggle, could you use the ADF (Select) method [CTRL + SHIFT + A] for this event instead?

BTW: The "MAN RNG/UNCAGE button" on the F-16's TQ is a rotating knob with a push button function all in one button. The rotating function allows for two way turns for RNG inc/Dec from a center detent. In FSX (or Windows) you can program a slider to it. 2. So perhaps, if your able, you can marry the RNG inc/dec to a slider feature? :unsure: Anyway, what you've done here is exceptional; Let's see what Aerosoft does with it.

3. Can you add the additional features mentioned? GPS RNG with RCR, etc.

Thanks a million! :D

Your suggestion inspired me to research the key codes some more and I found a few more that were useful. As a result, I have updated the original code to modify the codes used for some features and include some new ones. In particular

- step bug/select next target - unchanged

- designate target/Air-to-Air mode - now turns radar back on

- disable Air-to-Air mode - unchanged

- toggling Aerial Refueling - now uses Altnerate static source (on/off) (no more Water Rudder!)

- extending/retracting radar range - now uses Attitude bars (move up/down)

- extending/reducing map range - uses Decision height (increase/decrease)

I didn't want to use the ADF Select because the F-16 simulation uses the ADF. It might be possible to use a second ADF but the Simulation Variables aren't there to use it easily.

I have played with the MAN RNG knob on the FQS but it doesn work very well. Mine doesn't "zero" at the detent and the response function is too steep to be usable. I haven't been able to adjust it to be workable.

Next, I'm trying to implement some Display Management functions.

Link to comment
Share on other sites

Your suggestion inspired me to research the key codes some more and I found a few more that were useful. As a result, I have updated the original code to modify the codes used for some features and include some new ones. In particular

- step bug/select next target - unchanged

- designate target/Air-to-Air mode - now turns radar back on

- disable Air-to-Air mode - unchanged

- toggling Aerial Refueling - now uses Altnerate static source (on/off) (no more Water Rudder!)

- extending/retracting radar range - now uses Attitude bars (move up/down)

- extending/reducing map range - uses Decision height (increase/decrease)

I didn't want to use the ADF Select because the F-16 simulation uses the ADF. It might be possible to use a second ADF but the Simulation Variables aren't there to use it easily.

I have played with the MAN RNG knob on the FQS but it doesn work very well. Mine doesn't "zero" at the detent and the response function is too steep to be usable. I haven't been able to adjust it to be workable.

Next, I'm trying to implement some Display Management functions.

Outstanding Mr. Horton229! B)

Keep up the good work... And when you're finished, if you need to have someone BETA test it for you, please feel free to send it my way. ;)

When your finished you should consider putting together documentation of your programmed features/changes to add in the F-16's manual.

PS: I've also begun Key combination assignments so that people could use custom keys commands to trigger these same Joystick button features via re-mapping with FSUIPC or another programmable joystick. This will enable users to use multiple-key functions with Keyboard re-mapping and/or Joystick re-mapping and make this bird completely HOTAS enabled. (i.e. - If in A-A mode the same "select next target" button/functions works for the RADAR but, in LIST mode it does something else - Like one of your "Display Management functions", etc.) I'll explain more later, when you/I finish. :)

  • Upvote 1
Link to comment
Share on other sites

Ok,

So I just got home from school and my Hotas Cougar is here.

I have Foxy 4.0 installed, and the Foxy file provided by Raymond TAFKAM Rotmans.....I have nooooooooo idea what I am doing but really want to get this working

I know its a far shot, but the best way for me to learn this would be over the phone, so if ANYONE can find it in their hearts to help me out, please call me at 404-431-2101, I'd really appreciate it!

Regards, Diego

Link to comment
Share on other sites

Ok,

So I just got home from school and my Hotas Cougar is here.

I have Foxy 4.0 installed, and the Foxy file provided by Raymond TAFKAM Rotmans.....I have nooooooooo idea what I am doing but really want to get this working

I know its a far shot, but the best way for me to learn this would be over the phone, so if ANYONE can find it in their hearts to help me out, please call me at 404-431-2101, I'd really appreciate it!

Regards, Diego

FWIW, I don't actually use the Foxy tool or the HOTAS Cougar programming but use the bottons directly with FSX. FSX - Settings - Controls Buttons/Keys allows you to map functions (key events) directly to controller buttons (you even use the bottons to specify which button). I have found this is adequate for the FSX controls that the Aerosoft F-16 directly supports. For some key controls (Target Management) that the Aerosoft F-16 only supports via the mouse, I have mapped key events to them allowing you to map the buttons.

I have used the Hotas Cougar controls in the past to map complex keys and even key sequences to buttons on the controls. This was very useful for Falcon that supports a large number of keyboard based controls. However, it hasn't been necessary for Aerosoft F-16 so far.

Link to comment
Share on other sites

thanks for the reply, that is eventually what I did

However, I havn't had any luck in mapping T2, T3, T4, and T5 to responding to ATC, nor do I know how to map a button as Shift on fsx, nor how to map for instance Shift + S3 on fsx, any ideas?

Link to comment
Share on other sites

Ok,

So I just got home from school and my Hotas Cougar is here.

I have Foxy 4.0 installed, and the Foxy file provided by Raymond TAFKAM Rotmans.....I have nooooooooo idea what I am doing but really want to get this working

I know its a far shot, but the best way for me to learn this would be over the phone, so if ANYONE can find it in their hearts to help me out, please call me at 404-431-2101, I'd really appreciate it!

Regards, Diego

Diego, are you in Atlanta? (404 area code)....

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy & Terms of Use