Skip to content
commy2 edited this page Dec 17, 2014 · 16 revisions

Want to make sure that your mod works with AGM features, or want to prevent it from colliding with an addon of yours? Read on.

Table of contents

Backblast & Cannon Overpressure Zone

The backblast of a launcher is handled by these 3 values:

AGM_Backblast_Angle = 60; // angle of the backblast area
AGM_Backblast_Range = 10; // maximum range of the backblast
AGM_Backblast_Damage = 1; // maximum damage of the backblast

The values above are the default values for any launcher properly inherited off of the right base class Launcher_Base_F. To disable backblast for your launcher alltogether, simply set AGM_Backblast_Range or AGM_Backblast_Damage to 0. The damage of the backblast decreases with range and angle.

The overpressure zone created by tank cannons works similarly:

AGM_DangerZone_Angle = 90;
AGM_DangerZone_Range = 50;
AGM_DangerZone_Damage = 2;

There are no default values here (unless you use cannon_120mm), so you need to enter these manually.

Fire Control System

By default, the FCS is enabled for all tracked vehicles. For wheeled vehicles it needs to be enabled manually. These are the values available:

AGM_FCSEnabled = 0; // bool; 1 = FCS on; 0 = FCS off
AGM_FCSMinDistance = 0; // minimum distance of the vehicles' range finder (in meters)
AGM_FCSMaxDistance = 5000; // maximum distance of the vehicles' range finder (in meters)
AGM_FCSDistanceInterval = 1; // precision of the vehicles' range finder (in meters)

When lasing a target out of range, the closest possible value is used. The Fire Control System is only available for the primary Gunner of a vehicle.

Weapon Jamming and Overheating simulation

By default, all weapons inheriting from Rifle_Base_F and Rifle_Long_Base_F will have default values.

class CfgWeapons {
  class Rifle;
  class Rifle_Base_F : Rifle {
    // Dispersion, SlowdownFactor and JamChance arrays have 4 values for different temperatures, which are interpolated between.
    // These values correspond to temperatures Converted to real life values: 0: 0°C, 1: 333°C, 2: 666°C, 3: 1000°C.
    // Dispersion in radians. First value is for temp. 0, second for temp. 1 and so on. Values inbetween get interpolated. Negative values get ignored and can be used to move the starting point to hotter temperatures.
    AGM_Overheating_Dispersion[] = {0, 0.001, 0.002, 0.004};
    // How much the projectile gets slowed down before leaving the barrel. 0.9 means the bullet will lose 10% velocity. Values inbetween get interpolated. Numbers greater 1 increase the velocity, smaller 1 decrease it.
    AGM_Overheating_SlowdownFactor[] = {1, 1, 1, 0.9};
    // Chance to jam the weapon. 0.0003 means 3 malfunctions on 10,000 rounds fired at this temperature. Values inbetween get interpolated. Negative values get ignored and can be used to move the starting point to hotter temperatures.
    // When no reliable data exists for temperature vs. jam chance except MRBS, the following uniform criteria was adopted: [0, 1/MRBS, 5/MRBS, 25/MRBS].
    AGM_Overheating_JamChance[] = {0, 0.0003, 0.0015, 0.0075};
  };
};

class CfgAmmo {
  class BulletCore;
  class BulletBase : BulletCore {
    AGM_BulletMass = 0; // Bullet mass in grams
  };
};

Some of these entries require AGM v0.94.

"Deploy bipod" instead of resting

This requires the addon makers to add a line to their weapons class.

class Rifle_Base_F;
class MY_Gun : Rifle_Base_F {
    AGM_Bipod = 1;
};

Disposable Rocket Launchers

This requires the addon makers to add a line to their weapons class and to create a duplicate of the rocket launcher that uses a dummy magazine.

class CfgWeapons {
  class Launcher_Base_F;
  class launch_NLAW_F: Launcher_Base_F {
    AGM_UsedTube = "AGM_launch_NLAW_Used_F"; // The class name of the used tube.
    magazines[] = {"AGM_PreloadedMissileDummy"}; // The dummy magazine
  };
  class AGM_launch_NLAW_Used_F: launch_NLAW_F { // the used tube should be a sub class of the disposable launcher
    scope = 1;
    AGM_isUsedLauncher = 1;
    author = "$STR_AGM_Core_AGMTeam";
    displayName = "$STR_AGM_Disposable_UsedTube";
    descriptionShort = "$STR_AGM_Disposable_UsedTubeDescription";
    magazines[] = {"AGM_FiredMissileDummy"}; // This will disable the used launcher class from being fired again.
    //picture = ""; @todo
    //model = ""; @todo
    weaponPoolAvailable = 0;
  };
};

Adjustment compatible scope

class CfgWeapons {
  class ItemCore;
  class InventoryOpticsItem_Base_F;

  class optic_LRPS: ItemCore {
    AGM_ScopeAdjust_Horizontal[] = {-50,50};
    AGM_ScopeAdjust_Vertical[] = {-70,70};
    class ItemInfo: InventoryOpticsItem_Base_F {
      class OpticsModes {
        class Snip {
          discreteDistance[] = {1};
          discreteDistanceInitIndex = 0;
        };
      };
    };
  };
};

Top down attack

class CfgWeapons {
  class Launcher_Base_F;
  class launch_Titan_base: Launcher_Base_F {
    AGM_enableTopDownAttack = 0;  //0 to disable, disabled by default
  };
  class launch_Titan_short_base: launch_Titan_base {
    AGM_enableTopDownAttack = 1;  //1 to enable
  };
};

Adding to the Interaction Menu

tbd.

Config inheritance:

class CfgVehicles {
  class Man;
  class CAManBase: Man {
    class AGM_Actions {};
    class AGM_SelfActions {};
  };

  class LandVehicle;
  class Car: LandVehicle {
    class AGM_Actions {};
    class AGM_SelfActions {};
  };
  class Tank: LandVehicle {
    class AGM_Actions {};
    class AGM_SelfActions {};
  };

  class Air;
  class Helicopter: Air {
    class AGM_Actions {};
    class AGM_SelfActions {};
  };
  class Plane: Air {
    class AGM_Actions {};
    class AGM_SelfActions {};
  };

  class Ship
  class Ship_F: Ship {
    class AGM_Actions {};
    class AGM_SelfActions {};
  };

  class StaticWeapon: LandVehicle {
    class AGM_Actions {};
    class AGM_SelfActions {};
  };

  class StaticMortar;
  class Mortar_01_base_F: StaticMortar {
    class AGM_Actions {};
    class AGM_SelfActions {};
  };
};

more coming soon.