Advertisement
Lukegotjellyfihs

Arma 3 simple submunition penetration calculation

Mar 24th, 2023 (edited)
1,645
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.09 KB | Gaming | 0 0
  1. //Saving screen space, not needed
  2. _x = configFile;
  3. //CfgMagazine
  4. _mag = "rhs_mag_m829a4";
  5. //rhs_ammo_m829a4
  6. _ammo = getText (_x >> "CfgMagazines" >> _mag >> "ammo");
  7. //rhs_ammo_m829a4_penetrator
  8. _penetrator = getText (_x >> "CfgAmmo" >> _ammo >> "submunitionammo");
  9. _penetratorCaliber = getNumber (_x >> "CfgAmmo" >> _penetrator >> "caliber");
  10.  
  11. //Penetrator inherits m829a4 speed AT the time of impact, let's assume point-blank
  12. _penetratorInheritsSpeed = getNumber (_x >> "CfgAmmo" >> _ammo >> "submunitionparentspeedcoef");
  13. _penetratorInitSpeed = 0;
  14. if (_penetratorInheritsSpeed == 1) then {
  15.     //Assuming point-blank, use parent ammo initSpeed from CfgMagazine
  16.     _penetratorInitSpeed = getNumber (_x >> "CfgMagazines" >> _mag >> "initSpeed");
  17. } else {
  18.     //Usually for HEAT warheads
  19.     _penetratorInitSpeed = getNumber (_x >> "CfgAmmo" >> _ammo >> "submunitioninitspeed");
  20. };
  21. //1650 (m/s)
  22. _magInitSpeed = getNumber (_x >> "CfgMagazines" >> _mag >> "initSpeed");
  23.  
  24. //895 (mm) RHA equiv penetration
  25. _rha_penetration = _penetratorInitSpeed * _penetratorCaliber * 0.015;
  26. _rha_penetration;
Tags: SQF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement