From 6c212ca377d509a02576c365b2ade94ccfafe132 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Mon, 8 Jan 2024 15:21:32 -0600 Subject: [PATCH] Initial commit or frag & spall rewrite --- .gitignore | 1 + addons/frag/CfgAmmo.hpp | 583 +++++++++++++++++++++++++- addons/frag/README.md | 2 +- addons/frag/initSettings.inc.sqf | 40 +- addons/frag/initSettingsDebug.inc.sqf | 54 +++ addons/frag/script_component.hpp | 2 +- addons/frag/stringtable.xml | 9 + 7 files changed, 655 insertions(+), 36 deletions(-) create mode 100644 addons/frag/initSettingsDebug.inc.sqf diff --git a/.gitignore b/.gitignore index 8a7e6945a6..44f28e560a 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ CHANGELOG.md sqfvm.exe ArmaScriptCompiler.exe *.sqfc +addons/frag/dev \ No newline at end of file diff --git a/addons/frag/CfgAmmo.hpp b/addons/frag/CfgAmmo.hpp index 7a124833b3..eb524e5c18 100644 --- a/addons/frag/CfgAmmo.hpp +++ b/addons/frag/CfgAmmo.hpp @@ -10,6 +10,7 @@ class CfgAmmo { GVAR(enabled) = 1; GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; + GVAR(fragCount) = 17500; GVAR(metal) = 140000; GVAR(charge) = 87000; GVAR(gurney_c) = 2320; @@ -18,7 +19,8 @@ class CfgAmmo { class Bomb_04_F: ammo_Bomb_LaserGuidedBase { GVAR(enabled) = 1; - GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; + GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large ), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; + GVAR(fragCount) = 17500; GVAR(metal) = 140000; GVAR(charge) = 87000; GVAR(gurney_c) = 2320; @@ -29,6 +31,7 @@ class CfgAmmo { GVAR(enabled) = 1; GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; + GVAR(fragCount) = 17500; GVAR(metal) = 140000; GVAR(charge) = 87000; GVAR(gurney_c) = 2320; @@ -43,12 +46,12 @@ class CfgAmmo { GVAR(skip) = 0; GVAR(force) = 1; - // This is a good high-drag frag type for grenades. - GVAR(classes)[] = {QGVAR(tiny_HD)}; /* These values are based on the M67 Grenade, should be tweaked for individual grenades. */ + GVAR(classes)[] = {QGVAR(tiny)}; + GVAR(fragCount) = 1000; GVAR(metal) = 210; // metal in grams GVAR(charge) = 185; // explosive in grams GVAR(gurney_c) = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations @@ -65,17 +68,19 @@ class CfgAmmo { GVAR(enabled) = 1; GVAR(force) = 1; - GVAR(classes)[] = {QGVAR(tiny_HD)}; + GVAR(classes)[] = {QGVAR(small)}; + GVAR(fragCount) = 800; // guess based on probability hit of 1% GVAR(metal) = 200; GVAR(charge) = 32; GVAR(gurney_c) = 2700; - GVAR(gurney_k) = "1/2"; + GVAR(gurney_k) = "3/5"; // interior fragmenter/charge is a sphere }; class G_40mm_HEDP: G_40mm_HE { // Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M433 GVAR(enabled) = 1; - GVAR(classes)[] = {QGVAR(tiny_HD)}; + GVAR(classes)[] = {QGVAR(small_HD)}; + GVAR(fragCount) = 270; // seems to have greater framentation ability, but lower range per source GVAR(metal) = 200; GVAR(charge) = 45; GVAR(gurney_c) = 2830; @@ -89,6 +94,7 @@ class CfgAmmo { GVAR(force) = 0; EGVAR(vehicle_damage,incendiary) = 0; }; + // What is this even? class ACE_G40mm_HE_VOG25P: G_40mm_HE { GVAR(skip) = 0; GVAR(force) = 1; @@ -98,13 +104,14 @@ class CfgAmmo { // ~~~~ RPGs: class MissileBase; class R_PG32V_F; - class R_TBG32V_F: R_PG32V_F { // HE + class R_TBG32V_F: R_PG32V_F { // Thermobaric GVAR(enabled) = 1; + GVAR(fragCount) = 200; GVAR(metal) = 400; GVAR(charge) = 210; GVAR(gurney_c) = 2800; GVAR(gurney_k) = "3/5"; - GVAR(classes)[] = {"ACE_frag_medium_HD"}; + GVAR(classes)[] = {QGVAR(medium_HD)}; }; class M_Titan_AA: MissileBase { GVAR(skip) = 1; @@ -114,12 +121,13 @@ class CfgAmmo { }; class M_Titan_AP: M_Titan_AT { // "anti personnel" GVAR(skip) = 0; + GVAR(fragCount) = 800; // guesstimate / provides ~80 m frag range GVAR(enabled) = 1; GVAR(metal) = 400; GVAR(charge) = 210; GVAR(gurney_c) = 2800; GVAR(gurney_k) = "3/5"; - GVAR(classes)[] = {"ACE_frag_medium_HD"}; + GVAR(classes)[] = {QGVAR(medium_HD)}; }; // https://ofb.gov.in/product/products/product-details/84-mm-he-round-ffv-441-b @@ -127,11 +135,12 @@ class CfgAmmo { class R_MRAAWS_HEAT_F; class R_MRAAWS_HE_F: R_MRAAWS_HEAT_F { GVAR(enabled) = 1; + GVAR(fragCount) = 1200; // guesstimate / provides ~100 m frag range (1% chance to hit) GVAR(metal) = 2300; GVAR(charge) = 590; GVAR(gurney_c) = 2800; GVAR(gurney_k) = "1/2"; - GVAR(classes)[] = {"ACE_frag_small"}; + GVAR(classes)[] = {QGVAR(small)}; }; @@ -142,6 +151,7 @@ class CfgAmmo { GVAR(enabled) = 1; GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(fragCount) = 1200; // guesstimate / provides ~100 m frag range (1% chance to hit) GVAR(metal) = 3850; GVAR(charge) = 1040; GVAR(gurney_c) = 2700; @@ -156,6 +166,7 @@ class CfgAmmo { GVAR(enabled) = 1; GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(fragCount) = 1600; // guesstimate / provides ~112 m frag range (1% chance to hit) GVAR(metal) = 56250; GVAR(charge) = 39000; GVAR(gurney_c) = 2700; @@ -164,6 +175,7 @@ class CfgAmmo { class Rocket_04_HE_F: MissileBase { // Shrieker (Hydra 70) GVAR(enabled) = 1; GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(fragCount) = 1200; // guesstimate / provides ~100 m frag range (1% chance to hit) GVAR(metal) = 3850; GVAR(charge) = 1040; GVAR(gurney_c) = 2700; @@ -171,7 +183,8 @@ class CfgAmmo { }; class M_Scalpel_AT: MissileBase { // 9K121 Vikhr GVAR(enabled) = 1; - GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(classes)[] = {QGVAR(small), QGVAR(medium), QGVAR(medium_HD)}; + GVAR(fragCount) = 800; // guesstimate based on frag jacket, provides ~80 m frag range (1% chance to hit) GVAR(metal) = 10000; GVAR(charge) = 3000; GVAR(gurney_c) = 2700; @@ -182,6 +195,7 @@ class CfgAmmo { GVAR(enabled) = 1; GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(fragCount) = 350; // guesstimate based on frag jacket, provides ~50 m frag range (1% chance to hit) GVAR(metal) = 8000; GVAR(charge) = 2400; GVAR(gurney_c) = 2700; @@ -202,18 +216,20 @@ class CfgAmmo { GVAR(enabled) = 1; GVAR(classes)[] = {QGVAR(large), QGVAR(large), QGVAR(large_HD), QGVAR(large), QGVAR(huge), QGVAR(huge_HD), QGVAR(huge)}; + GVAR(fragCount) = 3250; // http://18.195.19.6/bitstream/handle/20.500.12242/1200/15-01916.pdf?sequence=1&isAllowed=y GVAR(metal) = 36000; GVAR(charge) = 9979; GVAR(gurney_c) = 2440; GVAR(gurney_k) = "1/2"; }; class Sh_82mm_AMOS: Sh_155mm_AMOS { - // Source: http://www.arsenal-bg.com/defense_police/mortar_bombs_82mm.htm + //http://65.175.100.54/uxofiles/mulvaney/techdatasheets/81mm-HE-M821.pdf GVAR(enabled) = 1; GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; - GVAR(metal) = 3200; - GVAR(charge) = 420; + GVAR(fragCount) = 1600; // based on mass and fragment energy/count + GVAR(metal) = 2500; + GVAR(charge) = 726; GVAR(gurney_c) = 2440; GVAR(gurney_k) = "1/2"; }; @@ -230,6 +246,7 @@ class CfgAmmo { GVAR(enabled) = 1; GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(fragCount) = 1600; // based on mass and fragment energy/count GVAR(metal) = 11400; GVAR(charge) = 7100; GVAR(gurney_c) = 2800; @@ -239,6 +256,7 @@ class CfgAmmo { GVAR(enabled) = 1; GVAR(classes)[] = {QGVAR(medium), QGVAR(medium_HD)}; + GVAR(fragCount) = 2000; GVAR(metal) = 23000; GVAR(charge) = 3148; GVAR(gurney_c) = 2830; @@ -262,13 +280,18 @@ class CfgAmmo { GVAR(gurney_c) = 2320; GVAR(gurney_k) = "1/2"; }; - + // Special + class Default; + class Laserbeam : Default { + GVAR(skip) = 1; + }; class B_65x39_Caseless; class GVAR(base): B_65x39_Caseless { ACE_damageType = "grenade"; // compatibility with medical_damage, shrapnel should produce grenade wounds - timeToLive = 12; - typicalSpeed = 1500; + timeToLive = 4; + typicalSpeed = 800; + maxSpeed = 1500; deflecting = 65; }; @@ -341,11 +364,11 @@ class CfgAmmo { }; class GVAR(spall_small): GVAR(small) { - timeToLive = 0.1; + timeToLive = 0.2; }; class GVAR(spall_medium): GVAR(medium) { - timeToLive = 0.15; + timeToLive = 0.2; }; class GVAR(spall_large): GVAR(large) { @@ -356,5 +379,523 @@ class CfgAmmo { timeToLive = 0.3; }; - #include "CfgAmmoReflections.hpp" -}; + + // format fragType_spawn_n_range + /********************* ***************************/ + class GVAR(spawnbase) : B_65x39_Caseless { + access = 2; + deleteParentWhenTriggered = 1; + submunitionConeType[] = {"random", 25}; + submunitionAmmo[] = {QGVAR(tiny), 3, QGVAR(tiny_HD), 3, QGVAR(small), 4, QGVAR(small_HD), 4, QGVAR(medium_HD), 5}; + submunitionDirectionType = "SubmunitionModelDirection"; + submunitionConeAngleHorizontal = 15; + submunitionConeAngle = 87; + submunitionInitialOffset[] = {0,0,0}; + submunitionInitSpeed = 1000; + submunitionParentSpeedCoef = 1; + triggerSpeedCoef[] = {0.75, 1.5}; + triggerTime = 0; + }; + + /********************* ***************************/ + class GVAR(def_10) : GVAR(spawnbase) { + submunitionConeType[] = {"random", 10}; + }; + class GVAR(def_10_lo) : GVAR(def_10) { + submunitionConeAngle = 85; + }; + class GVAR(def_10_mid) : GVAR(def_10) { + submunitionConeAngle = 85; + triggerSpeedCoef[] = {-1.5, 1.5}; + }; + class GVAR(def_10_hi) : GVAR(def_10) { + submunitionConeAngle = 80; + triggerSpeedCoef[] = {-1.5, -0.75}; + }; + class GVAR(def_10_top) : GVAR(def_10) { + submunitionConeAngle = 60; + triggerSpeedCoef[] = {-1.5, -0.75}; + }; + + /********************* ***************************/ + class GVAR(def_15) : GVAR(spawnbase) { + submunitionConeType[] = {"random", 15}; + }; + class GVAR(def_15_lo) : GVAR(def_15) { + submunitionConeAngle = 85; + }; + class GVAR(def_15_mid) : GVAR(def_15) { + submunitionConeAngle = 85; + triggerSpeedCoef[] = {-1.5, 1.5}; + }; + class GVAR(def_15_hi) : GVAR(def_15) { + submunitionConeAngle = 80; + triggerSpeedCoef[] = {-1.5, -0.75}; + }; + class GVAR(def_15_top) : GVAR(def_15) { + submunitionConeAngle = 60; + triggerSpeedCoef[] = {-1.5, -0.75}; + }; + + /********************* ***************************/ + class GVAR(def_5) : GVAR(spawnbase) { + submunitionConeType[] = {"random", 5}; + }; + class GVAR(def_5_lo) : GVAR(def_5) { + submunitionConeAngle = 85; + }; + class GVAR(def_5_mid) : GVAR(def_5) { + submunitionConeAngle = 85; + triggerSpeedCoef[] = {-1.5, 1.5}; + }; + class GVAR(def_5_hi) : GVAR(def_5) { + submunitionConeAngle = 80; + triggerSpeedCoef[] = {-1.5, -0.75}; + }; + class GVAR(def_5_top) : GVAR(def_5) { + submunitionConeAngle = 60; + triggerSpeedCoef[] = {-1.5, -0.75}; + }; + + /********************* ***************************/ + class GVAR(def_tiny_15) : GVAR(spawnbase) { + submunitionConeType[] = {"random", 15}; + submunitionAmmo = QGVAR(tiny); + }; + class GVAR(def_tiny_15_lo) : GVAR(def_tiny_15) { + submunitionConeAngle = 85; + }; + class GVAR(def_tiny_15_mid) : GVAR(def_tiny_15) { + submunitionConeAngle = 85; + triggerSpeedCoef[] = {-1.5, 1.5}; + }; + class GVAR(def_tiny_15_hi) : GVAR(def_tiny_15) { + submunitionConeAngle = 80; + triggerSpeedCoef[] = {-1.5, -0.75}; + }; + class GVAR(def_tiny_15_top) : GVAR(def_tiny_15) { + submunitionConeAngle = 60; + triggerSpeedCoef[] = {-1.5, -0.75}; + }; + + /********************* ***************************/ + class GVAR(def_tiny_10) : GVAR(spawnbase) { + submunitionConeType[] = {"random", 10}; + submunitionAmmo = QGVAR(tiny); + }; + class GVAR(def_tiny_10_lo) : GVAR(def_tiny_10) { + submunitionConeAngle = 85; + }; + class GVAR(def_tiny_10_mid) : GVAR(def_tiny_10) { + submunitionConeAngle = 85; + triggerSpeedCoef[] = {-1.5, 1.5}; + }; + class GVAR(def_tiny_10_hi) : GVAR(def_tiny_10) { + submunitionConeAngle = 80; + triggerSpeedCoef[] = {-1.5, -0.75}; + }; + class GVAR(def_tiny_10_top) : GVAR(def_tiny_10) { + submunitionConeAngle = 60; + triggerSpeedCoef[] = {-1.5, -0.75}; + }; + + /********************* ***************************/ + class GVAR(def_tiny_5) : GVAR(spawnbase) { + submunitionConeType[] = {"random", 5}; + submunitionAmmo = QGVAR(tiny); + }; + class GVAR(def_tiny_5_lo) : GVAR(def_tiny_5) { + submunitionConeAngle = 85; + }; + class GVAR(def_tiny_5_mid) : GVAR(def_tiny_5) { + submunitionConeAngle = 85; + triggerSpeedCoef[] = {-1.5, 1.5}; + }; + class GVAR(def_tiny_5_hi) : GVAR(def_tiny_5) { + submunitionConeAngle = 80; + triggerSpeedCoef[] = {-1.5, -0.75}; + }; + class GVAR(def_tiny_5_top) : GVAR(def_tiny_5) { + submunitionConeAngle = 60; + triggerSpeedCoef[] = {-1.5, -0.75}; + }; + /********************* ***************************/ + class GVAR(def_small_15) : GVAR(spawnbase) { + submunitionConeType[] = {"random", 15}; + submunitionAmmo = QGVAR(small); + }; + class GVAR(def_small_15_lo) : GVAR(def_small_15) { + submunitionConeAngle = 815; + }; + class GVAR(def_small_15_mid) : GVAR(def_small_15) { + submunitionConeAngle = 815; + triggerSpeedCoef[] = {-1.15, 1.15}; + }; + class GVAR(def_small_15_hi) : GVAR(def_small_15) { + submunitionConeAngle = 80; + triggerSpeedCoef[] = {-1.15, -0.715}; + }; + class GVAR(def_small_15_top) : GVAR(def_small_15) { + submunitionConeAngle = 60; + triggerSpeedCoef[] = {-1.15, -0.715}; + }; + /********************* ***************************/ + class GVAR(def_small_10) : GVAR(spawnbase) { + submunitionConeType[] = {"random", 10}; + submunitionAmmo = QGVAR(small); + }; + class GVAR(def_small_10_lo) : GVAR(def_small_10) { + submunitionConeAngle = 810; + }; + class GVAR(def_small_10_mid) : GVAR(def_small_10) { + submunitionConeAngle = 810; + triggerSpeedCoef[] = {-1.10, 1.10}; + }; + class GVAR(def_small_10_hi) : GVAR(def_small_10) { + submunitionConeAngle = 80; + triggerSpeedCoef[] = {-1.10, -0.710}; + }; + class GVAR(def_small_10_top) : GVAR(def_small_10) { + submunitionConeAngle = 60; + triggerSpeedCoef[] = {-1.10, -0.710}; + }; + /********************* ***************************/ + class GVAR(def_small_5) : GVAR(spawnbase) { + submunitionConeType[] = {"random", 5}; + submunitionAmmo = QGVAR(small); + }; + class GVAR(def_small_5_lo) : GVAR(def_small_5) { + submunitionConeAngle = 85; + }; + class GVAR(def_small_5_mid) : GVAR(def_small_5) { + submunitionConeAngle = 85; + triggerSpeedCoef[] = {-1.5, 1.5}; + }; + class GVAR(def_small_5_hi) : GVAR(def_small_5) { + submunitionConeAngle = 80; + triggerSpeedCoef[] = {-1.5, -0.75}; + }; + class GVAR(def_small_5_top) : GVAR(def_small_5) { + submunitionConeAngle = 60; + triggerSpeedCoef[] = {-1.5, -0.75}; + }; + + /******************* targeted fragments ********************/ + class GVAR(spawnbase_targeted) : GVAR(spawnbase) { + access = 2; + submunitionConeType[] = {"random", 2}; + submunitionConeAngle = 2; + submunitionInitSpeed = 0; + triggerSpeedCoef[] = {0.5, 1}; + }; + + class GVAR(tiny_spawner_2_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(tiny); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(tiny_spawner_2_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(tiny); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(tiny_spawner_2_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(tiny); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(tiny_spawner_3_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(tiny); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(tiny_spawner_3_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(tiny); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(tiny_spawner_3_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(tiny); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 3}; + }; + + class GVAR(tiny_HD_spawner_2_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(tiny_HD); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(tiny_HD_spawner_2_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(tiny_HD); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(tiny_HD_spawner_2_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(tiny_HD); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(tiny_HD_spawner_3_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(tiny_HD); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(tiny_HD_spawner_3_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(tiny_HD); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(tiny_HD_spawner_3_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(tiny_HD); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 3}; + }; + + class GVAR(small_spawner_2_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(small); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(small_spawner_2_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(small); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(small_spawner_2_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(small); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(small_spawner_3_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(small); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(small_spawner_3_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(small); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(small_spawner_3_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(small); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 3}; + }; + + class GVAR(small_HD_spawner_2_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(small_HD); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(small_HD_spawner_2_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(small_HD); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(small_HD_spawner_2_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(small_HD); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(small_HD_spawner_3_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(small_HD); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(small_HD_spawner_3_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(small_HD); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(small_HD_spawner_3_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(small_HD); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 3}; + }; + + class GVAR(medium_spawner_2_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(medium); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(medium_spawner_2_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(medium); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(medium_spawner_2_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(medium); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(medium_spawner_3_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(medium); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(medium_spawner_3_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(medium); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(medium_spawner_3_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(medium); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 3}; + }; + + class GVAR(medium_HD_spawner_2_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(medium_HD); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(medium_HD_spawner_2_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(medium_HD); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(medium_HD_spawner_2_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(medium_HD); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(medium_HD_spawner_3_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(medium_HD); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(medium_HD_spawner_3_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(medium_HD); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(medium_HD_spawner_3_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(medium_HD); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 3}; + }; + + class GVAR(large_spawner_2_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(large); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(large_spawner_2_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(large); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(large_spawner_2_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(large); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(large_spawner_3_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(large); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(large_spawner_3_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(large); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(large_spawner_3_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(large); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 3}; + }; + + class GVAR(large_HD_spawner_2_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(large_HD); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(large_HD_spawner_2_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(large_HD); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(large_HD_spawner_2_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(large_HD); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(large_HD_spawner_3_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(large_HD); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(large_HD_spawner_3_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(large_HD); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(large_HD_spawner_3_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(large_HD); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 3}; + }; + + class GVAR(huge_spawner_2_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(huge); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(huge_spawner_2_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(huge); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(huge_spawner_2_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(huge); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(huge_spawner_3_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(huge); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(huge_spawner_3_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(huge); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(huge_spawner_3_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(huge); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 3}; + }; + + class GVAR(huge_HD_spawner_2_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(huge_HD); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(huge_HD_spawner_2_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(huge_HD); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(huge_HD_spawner_2_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(huge_HD); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 2}; + }; + class GVAR(huge_HD_spawner_3_short) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(huge_HD); + submunitionConeAngle = 4.5; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(huge_HD_spawner_3_mid) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(huge_HD); + submunitionConeAngle = 2; + submunitionConeType[] = {"random", 3}; + }; + class GVAR(huge_HD_spawner_3_far) : GVAR(spawnbase_targeted) { + submunitionAmmo = QGVAR(huge_HD); + submunitionConeAngle = 0.9; + submunitionConeType[] = {"random", 3}; + }; +}; \ No newline at end of file diff --git a/addons/frag/README.md b/addons/frag/README.md index ca62771f00..e5c9a35a05 100644 --- a/addons/frag/README.md +++ b/addons/frag/README.md @@ -1,4 +1,4 @@ ace_frag ======== -Shrapnel system for explosives. +Explosive fragmentation, round spalling, and explosive reflection \ No newline at end of file diff --git a/addons/frag/initSettings.inc.sqf b/addons/frag/initSettings.inc.sqf index 421d5d4566..29fbefe6fe 100644 --- a/addons/frag/initSettings.inc.sqf +++ b/addons/frag/initSettings.inc.sqf @@ -3,7 +3,7 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; [ QGVAR(enabled), "CHECKBOX", [LSTRING(EnableFrag), LSTRING(EnableFrag_Desc)], - _category, + [_category, LSTRING(Frag)], true, 1 ] call CBA_fnc_addSetting; @@ -11,30 +11,44 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; [ QGVAR(spallEnabled), "CHECKBOX", [LSTRING(EnableSpall), LSTRING(EnableSpall_Desc)], - _category, + [_category, LSTRING(Spall)], false, 1 ] call CBA_fnc_addSetting; [ QGVAR(reflectionsEnabled), "CHECKBOX", [LSTRING(EnableReflections), LSTRING(EnableReflections_Desc)], - _category, + [_category, LSTRING(Reflections)], false, 1 ] call CBA_fnc_addSetting; + +/// !*! TODO: add stringtable entries [ - QGVAR(maxTrack), "SLIDER", - [LSTRING(MaxTrack), LSTRING(MaxTrack_Desc)], - _category, - [0, 50, 10, -1], - 1 + QGVAR(enSubMunit), "LIST", + ["Enable submunition fragmentation", "Enables submunition fragmentation when fragmentation is enabled"], + [_category, LSTRING(Frag)], + [[2, 1, 0], ["complex fragementation","simple fragmentation","no fragmentation"], 2] ] call CBA_fnc_addSetting; [ - QGVAR(maxTrackPerFrame), "SLIDER", - [LSTRING(MaxTrackPerFrame), LSTRING(MaxTrackPerFrame_Desc)], - _category, - [0, 50, 10, -1], - 1 + QGVAR(reflectionsEnabled), "CHECKBOX", + "Enable reflections", + [_category, LSTRING(Frag)], + false +] call CBA_fnc_addSetting; + +[ + QGVAR(atLeastOne), "CHECKBOX", + "At least one round hit", + [_category, LSTRING(Frag)], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(BlackList), "EDITBOX", + ["Default BlackList", "Array of ammo classnames strings to blackist fragmentation for."], + [_category, LSTRING(Frag)], + QUOTE(['B_556x45_Ball']) ] call CBA_fnc_addSetting; diff --git a/addons/frag/initSettingsDebug.inc.sqf b/addons/frag/initSettingsDebug.inc.sqf new file mode 100644 index 0000000000..92b4a78b95 --- /dev/null +++ b/addons/frag/initSettingsDebug.inc.sqf @@ -0,0 +1,54 @@ +private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; + +[ + QGVAR(debugOptions), + "CHECKBOX", + "Enable debug mode", + [_category, LSTRING(Debug)], + true // [min, max, default, trailing decimals] +] call CBA_fnc_addSetting; + +// debug options +[ + QGVAR(dbgSphere), + "CHECKBOX", + "Enable debug impact spheres", + [_category, LSTRING(Debug)], + false, + 0, + {}, + true +] call CBA_fnc_addSetting; + +[ + QGVAR(frameHint), + "CHECKBOX", + "Show framerate hint", + [_category, LSTRING(Debug)], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(fadeRounds), + "CHECKBOX", + "Fade round traces over time", + [_category, LSTRING(Debug)], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(dltTrace), + "CHECKBOX", + "Delete fire trace on fade", + [_category, LSTRING(Debug)], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(drawHitBox), + "CHECKBOX", + "Draw unit hitboxes", + [_category, LSTRING(Debug)], + true +] call CBA_fnc_addSetting; + diff --git a/addons/frag/script_component.hpp b/addons/frag/script_component.hpp index 0215e9f4d7..f57bb7ad12 100644 --- a/addons/frag/script_component.hpp +++ b/addons/frag/script_component.hpp @@ -2,7 +2,7 @@ #define COMPONENT_BEAUTIFIED Frag #include "\z\ace\addons\main\script_mod.hpp" -// #define DRAW_FRAG_INFO +// #define LOG_FRAG_INFO // #define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS diff --git a/addons/frag/stringtable.xml b/addons/frag/stringtable.xml index 7addcd4c38..ac8b64cd7c 100644 --- a/addons/frag/stringtable.xml +++ b/addons/frag/stringtable.xml @@ -17,6 +17,15 @@ 破片模拟 模擬碎片 + + Fragmentation + + + Spalling + + + Explosion Reflections + Fragmentation Simulation Symulacja fragmentacji