Howto:Implement aerial refueling capability: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(13 intermediate revisions by 7 users not shown)
Line 1: Line 1:
This [[:Category:Howto|hotwo]] teaches you '''how to implement [[Howto: Aerial refueling|aerial refueling]] capability''' to both tanker and/or receiver [[aircraft]].
This [[:Category:Howto|howto]] teaches you '''how to implement [[Howto: Aerial refueling|aerial refueling]] capability''' to both tanker and/or receiver [[aircraft]].


==Receiver aircraft==
== Receiver aircraft ==
Add the following blocks of code to your aircraft's -set.xml file (all after the </sim> tag). Make sure to check for pre-existing blocks/structures and leave them intact. The radar is needed to check if you are close enough from the tanker, the refuel part tell wich type of refueling you are capable of, and if your refuel system is ok to receive (use the serviceable property if you have a switch to open the refuel trap for exemple). The aar.nas check if you're close enough , if you have the same type,and if yes refuel your tanks.
Add the following blocks of code to your aircraft's -set.xml file (all after the </sim> tag). Make sure to check for pre-existing blocks/structures and insert the new blocks within them as applicable.  


* Radar is needed to check if you are close enough from the tanker.
** It also seems to check that the receiving aircraft's heading is within +/-90deg of the direction of the tanker,
* The <refuel> properties defines
** what type of refueling you are capable of (probe and drogue, or boom)
** if your refuel system is ok to receive (use the serviceable property if you have a switch to open the refuel trap for example).
** the maximum rate of fuel (in lbs per minute) that can be transferred (defaults to 6000)
** the offset of the probe/trap from the aircraft model origin. (+x is towards the rear of the aircraft, +y is to the right facing forwards, +z is up)
* aar.nas is the actual system that checks the two above mentioned criteria and if both are true, refuels your tanks.
<syntaxhighlight lang="xml">
  <instrumentation>
  <instrumentation>
   <radar>
   <radar>
Line 15: Line 25:
   <type>probe</type>
   <type>probe</type>
   <serviceable type="bool">true</serviceable>
   <serviceable type="bool">true</serviceable>
  <max-fuel-transfer-lbs-min>6000</max-fuel-transfer-lbs-min>
  <offset-x-m>0</offset-x-m>
  <offset-y-m>0</offset-y-m>
  <offset-z-m>0</offset-z-m>
   </refuel>
   </refuel>
  </systems>
  </systems>
Line 23: Line 37:
   </aar>
   </aar>
  </nasal>
  </nasal>
</syntaxhighlight>


The aircraft can receive fuel from the KA6 with the above code. To receive fuel from the [[KC-135]], replace 'probe' with 'drogue'.
The aircraft can receive fuel from the KA6 with the above code. To receive fuel from the [[KC-135]], replace 'probe' with 'boom'.
 
==Tanker aircraft==


To allow your plane to be used as a tanker by others players, you only need to add the following blocks of code to your aircraft's model .xml file (usually located in <tt>Aircraft/.../Models/</tt>):
== Tanker aircraft ==
To allow your plane to be used as a tanker by others players, you only need to add the following blocks of code to your aircraft's model .xml file (usually located in <tt>Aircraft/.../Models/</tt>):


<syntaxhighlight lang="xml">
  <multiplay>
  <multiplay>
   <refuel>
   <refuel>
Line 35: Line 50:
   </refuel>
   </refuel>
  </multiplay>
  </multiplay>
</syntaxhighlight>


Replace 'probe' with 'boom' in the files for a boom-equipped tanker, This influences what aircraft can receive fuel! Or give the two lines if the tanker get both a boom and probes (like recent kc135) in this case you will be able to refuel both type of aircrafts.
Replace 'probe' with 'boom' in the files for a boom-equipped tanker. This influences what aircraft can receive fuel! Or give the two lines if the tanker get both a boom and probes (like recent kc135) in this case you will be able to refuel both type of aircraft.  
You can add the refueling capability to your tanker too, with the lines above for receiver aircrafts.
For the moment, flyable tankers are: KC135, victor and KC130 (in c130 folder) if you need an exemple.
 
== Tankers with git version after the 1 september 2010 ==
 
with the FG 2.0 version and before, the refueling is possible only if the tanker use a "MOBIL" callsign. The current git FG change this, allowing any callsign to be a tanker, and the tanker property is now transmitted by mp, permitting for exemple to prevent refueling if the refueling probe is not operational.


for this to work, add the following code in your aircraft's -set file (be sure not to be in another block):
For the moment, flyable tankers are: KC135, victor and KC130 (in <tt>Aircraft/c130</tt>) if you need an example.


<tanker type="bool">false</tanker>
To add an AI refuelling aircraft, add it to AI/tankers.xml.


and now switch this property true or false to allow following aircrafts to refuel or not.
=== Serviceable option ===
With FlightGear 2.0.0 and older, refueling is possible only if the tanker uses a "MOBIL" callsign (e.g., MOBIL3). Later releases of FlightGear (and Git), allow any callsign to be a tanker. Besides that, the tanker property is now transmitted over multiplayer, permitting for example to prevent refueling if the refueling probe is not operational.


For this to work, add the following code in your aircraft's -set file (be sure not to be in another block):
<syntaxhighlight lang="xml">
<tanker type="bool">false</tanker>
</syntaxhighlight>


Switch this property true or false to allow following aircraft to refuel or not.


{{air-to-air refueling}}


[[Category:Aircraft enhancement|Implement aerial refueling capability]]
[[Category:Howto|Implement aerial refueling capability]]
[[Category:Howto|Implement aerial refueling capability]]
[[Category:Aerial refueling]]

Latest revision as of 14:51, 1 May 2020

This howto teaches you how to implement aerial refueling capability to both tanker and/or receiver aircraft.

Receiver aircraft

Add the following blocks of code to your aircraft's -set.xml file (all after the </sim> tag). Make sure to check for pre-existing blocks/structures and insert the new blocks within them as applicable.

  • Radar is needed to check if you are close enough from the tanker.
    • It also seems to check that the receiving aircraft's heading is within +/-90deg of the direction of the tanker,
  • The <refuel> properties defines
    • what type of refueling you are capable of (probe and drogue, or boom)
    • if your refuel system is ok to receive (use the serviceable property if you have a switch to open the refuel trap for example).
    • the maximum rate of fuel (in lbs per minute) that can be transferred (defaults to 6000)
    • the offset of the probe/trap from the aircraft model origin. (+x is towards the rear of the aircraft, +y is to the right facing forwards, +z is up)
  • aar.nas is the actual system that checks the two above mentioned criteria and if both are true, refuels your tanks.
 <instrumentation>
  <radar>
   <range type="int" archive="y">20</range>
   <minimized type="bool" archive="y">false</minimized>
  </radar>
 </instrumentation>

 <systems>
  <refuel>
   <type>probe</type>
   <serviceable type="bool">true</serviceable>
   <max-fuel-transfer-lbs-min>6000</max-fuel-transfer-lbs-min>
   <offset-x-m>0</offset-x-m>
   <offset-y-m>0</offset-y-m>
   <offset-z-m>0</offset-z-m>
  </refuel>
 </systems>

 <nasal>
  <aar>
   <file>Aircraft/Generic/aar.nas</file>
  </aar>
 </nasal>

The aircraft can receive fuel from the KA6 with the above code. To receive fuel from the KC-135, replace 'probe' with 'boom'.

Tanker aircraft

To allow your plane to be used as a tanker by others players, you only need to add the following blocks of code to your aircraft's model .xml file (usually located in Aircraft/.../Models/):

 <multiplay>
  <refuel>
   <type>probe</type>
  </refuel>
 </multiplay>

Replace 'probe' with 'boom' in the files for a boom-equipped tanker. This influences what aircraft can receive fuel! Or give the two lines if the tanker get both a boom and probes (like recent kc135) in this case you will be able to refuel both type of aircraft.

For the moment, flyable tankers are: KC135, victor and KC130 (in Aircraft/c130) if you need an example.

To add an AI refuelling aircraft, add it to AI/tankers.xml.

Serviceable option

With FlightGear 2.0.0 and older, refueling is possible only if the tanker uses a "MOBIL" callsign (e.g., MOBIL3). Later releases of FlightGear (and Git), allow any callsign to be a tanker. Besides that, the tanker property is now transmitted over multiplayer, permitting for example to prevent refueling if the refueling probe is not operational.

For this to work, add the following code in your aircraft's -set file (be sure not to be in another block):

<tanker type="bool">false</tanker>

Switch this property true or false to allow following aircraft to refuel or not.