Addon Afterburner Setup - Fullerpj/United-States-Air-Force-Mod GitHub Wiki

This article will cover setting up your aircraft to use the USAF afterburner system. First you'll setup your model with animation sources, then add an entry to your CfgVehicles class.

The examples show the setup of the USAF F-22.

Model Setup

For each engine, assign your afterburner flame faces to a named selection, then add an animation source like below. Note it is a "show" animation - the value will be set to 1 to show the faces, and 0 to hide them.

Config.cpp

    class afterburner_show_L
    {
        source = "user";
        animPeriod = 1e-30;
        initPhase = 0;
    };
    class afterburner_show_R
    {
        source = "user";
        animPeriod = 1e-30;
        initPhase = 0;
    };

Model.cfg

    class afterburner_show_flame_L
    {
        type="hide";
        source="afterburner_show_L";
        selection="afterburner_flame_L";
        minValue = 0.0;
        maxValue = 1.0;
        hideValue = 0.0;
        unHideValue = 0.5;
    };
    class afterburner_show_flame_R: afterburner_show_flame_L
    {
        selection="afterburner_flame_R";
        source="afterburner_show_R";
    };

USAF_Afterburner Config

Path: CfgVehicles >> (your vehicle) >> USAF_Afterburner

Definition

The scripts in the mod read the values in this config to determine the functional behavior of the afterburner.

  • force
    • (Scalar, unknown force unit)
    • PhysX force applied each tick. See addForce.
  • maxSpeed
    • (Scalar, km/h)
    • Theoretical max speed. Force will be interpolated from given force value to 0, from 70% to 100% of this value. So depending on aircraft weight and force, the actual top speed in level flight will be more like 85% of this value.
  • throttleEngage
    • (Scalar, 0-1)
    • Throttle value above which afterburner engages (0 = no throttle, 1 = full throttle)
  • fuelUsage
    • (Scalar, 0-1)
    • Additional fuel reduction per second, in percentage of total fuel. 0.0015 gave 9m 30s fuel time on the F-22 in afterburner starting with 0.5 fuel.
  • animShow
    • (Array of strings)
    • List of the the animation sources which you placed earlier in model.cfg. This list must match the order and count of the HitEngine config entries on the aircraft, so that hitpoint damage can affect the afterburners correctly.
  • animStretch (optional)
    • (String)
    • Animation source that interpolates from 0 (when throttle == throttleEngage above) to 1 (when throttle == 1)
  • animReqs (optional)
    • (Array of arrays: {string, scalar, scalar})
    • Specifies animations that must be within the specified range for the afterburner to engage. Designed for the case of the F-35B so the afterburner cannot be engaged while in vtol mode. The AB will remain armed if it was previously, but it will only engage when within these bounds. F-35B Example: animReqs[] = { {"engine_3",0,0.2} }; Here, animation engine_3 must be between 0 and 0.2 for the afterburner to function.

Example

The following is the afterburner config from the F-22, which for reference has a model mass of 12000.

class cfgVehicles
{
    class USAF_F22
    {
        class USAF_Afterburner
        {
            force = 500;
            maxSpeed = 2100;
            throttleEngage = 0.9;
            fuelUsage = 0.0018;
            animShow[] = {"afterburner_show_L","afterburner_show_R"};
            animStretch = "afterburner_stretch";
        };
    };
};