Fixed more comments

This commit is contained in:
lambdatiger 2024-01-10 19:02:07 -06:00
parent eef48da6bc
commit a64fff960a
7 changed files with 80 additions and 50 deletions

View File

@ -1,5 +1,3 @@
// format fragType_spawn_n_range
/********************* ***************************/
class GVAR(spawnbase) : B_65x39_Caseless { class GVAR(spawnbase) : B_65x39_Caseless {
access = 2; access = 2;
deleteParentWhenTriggered = 1; deleteParentWhenTriggered = 1;
@ -16,7 +14,9 @@ class GVAR(spawnbase) : B_65x39_Caseless {
ACE_FRAG_RM_EH; ACE_FRAG_RM_EH;
}; };
/********************* ***************************/ /*
* Default frag, spawning 10 fragments
*/
class GVAR(def_10) : GVAR(spawnbase) { class GVAR(def_10) : GVAR(spawnbase) {
submunitionConeType[] = {"random", 10}; submunitionConeType[] = {"random", 10};
}; };
@ -35,8 +35,9 @@ class GVAR(def_10_top) : GVAR(def_10) {
submunitionConeAngle = 60; submunitionConeAngle = 60;
triggerSpeedCoef[] = {-1.5, -0.75}; triggerSpeedCoef[] = {-1.5, -0.75};
}; };
/*
/********************* ***************************/ * Default frag, spawning 15 fragments
*/
class GVAR(def_15) : GVAR(spawnbase) { class GVAR(def_15) : GVAR(spawnbase) {
submunitionConeType[] = {"random", 15}; submunitionConeType[] = {"random", 15};
}; };
@ -56,7 +57,9 @@ class GVAR(def_15_top) : GVAR(def_15) {
triggerSpeedCoef[] = {-1.5, -0.75}; triggerSpeedCoef[] = {-1.5, -0.75};
}; };
/********************* ***************************/ /*
* Default frag, spawning 5 fragments
*/
class GVAR(def_5) : GVAR(spawnbase) { class GVAR(def_5) : GVAR(spawnbase) {
submunitionConeType[] = {"random", 5}; submunitionConeType[] = {"random", 5};
}; };
@ -76,7 +79,9 @@ class GVAR(def_5_top) : GVAR(def_5) {
triggerSpeedCoef[] = {-1.5, -0.75}; triggerSpeedCoef[] = {-1.5, -0.75};
}; };
/********************* ***************************/ /*
* Default frag, spawning tiny fragments only
*/
class GVAR(def_tiny_15) : GVAR(spawnbase) { class GVAR(def_tiny_15) : GVAR(spawnbase) {
submunitionConeType[] = {"random", 15}; submunitionConeType[] = {"random", 15};
submunitionAmmo = QGVAR(tiny); submunitionAmmo = QGVAR(tiny);
@ -97,7 +102,9 @@ class GVAR(def_tiny_15_top) : GVAR(def_tiny_15) {
triggerSpeedCoef[] = {-1.5, -0.75}; triggerSpeedCoef[] = {-1.5, -0.75};
}; };
/********************* ***************************/ /*
* Default frag, spawning 10 tiny fragments only
*/
class GVAR(def_tiny_10) : GVAR(spawnbase) { class GVAR(def_tiny_10) : GVAR(spawnbase) {
submunitionConeType[] = {"random", 10}; submunitionConeType[] = {"random", 10};
submunitionAmmo = QGVAR(tiny); submunitionAmmo = QGVAR(tiny);
@ -118,7 +125,9 @@ class GVAR(def_tiny_10_top) : GVAR(def_tiny_10) {
triggerSpeedCoef[] = {-1.5, -0.75}; triggerSpeedCoef[] = {-1.5, -0.75};
}; };
/********************* ***************************/ /*
* Default frag, spawning 15 tiny fragments only
*/
class GVAR(def_tiny_5) : GVAR(spawnbase) { class GVAR(def_tiny_5) : GVAR(spawnbase) {
submunitionConeType[] = {"random", 5}; submunitionConeType[] = {"random", 5};
submunitionAmmo = QGVAR(tiny); submunitionAmmo = QGVAR(tiny);
@ -138,7 +147,10 @@ class GVAR(def_tiny_5_top) : GVAR(def_tiny_5) {
submunitionConeAngle = 60; submunitionConeAngle = 60;
triggerSpeedCoef[] = {-1.5, -0.75}; triggerSpeedCoef[] = {-1.5, -0.75};
}; };
/********************* ***************************/
/*
* Default frag, spawning 15 tiny fragments only
*/
class GVAR(def_small_15) : GVAR(spawnbase) { class GVAR(def_small_15) : GVAR(spawnbase) {
submunitionConeType[] = {"random", 15}; submunitionConeType[] = {"random", 15};
submunitionAmmo = QGVAR(small); submunitionAmmo = QGVAR(small);
@ -158,7 +170,10 @@ class GVAR(def_small_15_top) : GVAR(def_small_15) {
submunitionConeAngle = 60; submunitionConeAngle = 60;
triggerSpeedCoef[] = {-1.15, -0.715}; triggerSpeedCoef[] = {-1.15, -0.715};
}; };
/********************* ***************************/
/*
* Default frag, spawning 10 small fragments only
*/
class GVAR(def_small_10) : GVAR(spawnbase) { class GVAR(def_small_10) : GVAR(spawnbase) {
submunitionConeType[] = {"random", 10}; submunitionConeType[] = {"random", 10};
submunitionAmmo = QGVAR(small); submunitionAmmo = QGVAR(small);
@ -178,7 +193,9 @@ class GVAR(def_small_10_top) : GVAR(def_small_10) {
submunitionConeAngle = 60; submunitionConeAngle = 60;
triggerSpeedCoef[] = {-1.10, -0.710}; triggerSpeedCoef[] = {-1.10, -0.710};
}; };
/********************* ***************************/ /*
* Default frag, spawning small fragments only
*/
class GVAR(def_small_5) : GVAR(spawnbase) { class GVAR(def_small_5) : GVAR(spawnbase) {
submunitionConeType[] = {"random", 5}; submunitionConeType[] = {"random", 5};
submunitionAmmo = QGVAR(small); submunitionAmmo = QGVAR(small);
@ -199,7 +216,9 @@ class GVAR(def_small_5_top) : GVAR(def_small_5) {
triggerSpeedCoef[] = {-1.5, -0.75}; triggerSpeedCoef[] = {-1.5, -0.75};
}; };
/******************* targeted fragments ********************/ /*
* Targeted fragment spawner, for when multiple fragments are spawned (1-3)
*/
class GVAR(spawnbase_targeted) : GVAR(spawnbase) { class GVAR(spawnbase_targeted) : GVAR(spawnbase) {
access = 2; access = 2;
submunitionConeType[] = {"random", 2}; submunitionConeType[] = {"random", 2};

View File

@ -14,7 +14,9 @@ class GVAR(spallBase) : B_65x39_Caseless {
}; };
//**** ground ****// /*
* ground
*/
class GVAR(ground_spall_tiny) : GVAR(spallBase) { class GVAR(ground_spall_tiny) : GVAR(spallBase) {
submunitionAmmo[] = {QGVAR(tiny), 9, QGVAR(small), 1}; submunitionAmmo[] = {QGVAR(tiny), 9, QGVAR(small), 1};
submunitionConeType[] = {"poissondisccenter", 4}; submunitionConeType[] = {"poissondisccenter", 4};
@ -41,7 +43,9 @@ class GVAR(ground_spall_huge) : GVAR(spallBase) {
}; };
//**** rock ****// /*
* rock
*/
class GVAR(rock_spall_tiny) : GVAR(spallBase) { class GVAR(rock_spall_tiny) : GVAR(spallBase) {
submunitionAmmo[] = {QGVAR(small), 4, QGVAR(medium_HD), 1}; submunitionAmmo[] = {QGVAR(small), 4, QGVAR(medium_HD), 1};
submunitionConeType[] = {"poissondisccenter", 4}; submunitionConeType[] = {"poissondisccenter", 4};
@ -68,7 +72,9 @@ class GVAR(rock_spall_huge) : GVAR(spallBase) {
}; };
//**** wood ****// /*
* wood
*/
class GVAR(wood_spall_tiny) : GVAR(spallBase) { class GVAR(wood_spall_tiny) : GVAR(spallBase) {
submunitionAmmo[] = {QGVAR(tiny), 2, QGVAR(small), 4}; submunitionAmmo[] = {QGVAR(tiny), 2, QGVAR(small), 4};
submunitionConeType[] = {"poissondisccenter", 4}; submunitionConeType[] = {"poissondisccenter", 4};
@ -95,7 +101,9 @@ class GVAR(wood_spall_huge) : GVAR(spallBase) {
}; };
//**** concrete ****// /*
* concrete
*/
class GVAR(concrete_spall_tiny) : GVAR(spallBase) { class GVAR(concrete_spall_tiny) : GVAR(spallBase) {
submunitionAmmo[] = {QGVAR(tiny), 6, QGVAR(tiny_HD), 3, QGVAR(small), 1}; submunitionAmmo[] = {QGVAR(tiny), 6, QGVAR(tiny_HD), 3, QGVAR(small), 1};
submunitionConeType[] = {"poissondisccenter", 4}; submunitionConeType[] = {"poissondisccenter", 4};
@ -122,7 +130,9 @@ class GVAR(concrete_spall_huge) : GVAR(spallBase) {
}; };
//**** metal ****// /*
* metal
*/
class GVAR(metal_spall_tiny) : GVAR(spallBase) { class GVAR(metal_spall_tiny) : GVAR(spallBase) {
submunitionAmmo[] = {QGVAR(tiny), 9, QGVAR(small), 1}; submunitionAmmo[] = {QGVAR(tiny), 9, QGVAR(small), 1};
submunitionConeType[] = {"poissondisccenter", 4}; submunitionConeType[] = {"poissondisccenter", 4};

View File

@ -22,7 +22,7 @@ params [
["_sidePlayer", true, [true]] ["_sidePlayer", true, [true]]
]; ];
/// track round on each frame // track round on each frame
// Create entry in position array from hashmap // Create entry in position array from hashmap
if (_sidePlayer) then if (_sidePlayer) then
{ {

View File

@ -22,7 +22,7 @@ params [
["_isProj", false, [false]] ["_isProj", false, [false]]
]; ];
TRACE_4("devDraw",_this,_obj,_color,_isProj); TRACE_4("devDraw",_this,_obj,_color,_isProj);
/// track round on each frame // track round on each frame
// Create entry in position array from hashmap // Create entry in position array from hashmap
private _colorArray = switch (toLower _color) do { private _colorArray = switch (toLower _color) do {
case "purple": {[0.8, 0, 0.8, 1]}; case "purple": {[0.8, 0, 0.8, 1]};

View File

@ -76,7 +76,7 @@ if (120 > acos ((vectorNormalized _lVelUnit) vectorDotProduct _sNorm)) then {
_spallPos = _spallPos vectorAdd (_unitStep vectorMultiply 5); _spallPos = _spallPos vectorAdd (_unitStep vectorMultiply 5);
}; };
//***** Passed all exit withs *****// // Passed all exit withs
GVAR(lastSpallTime) = CBA_missionTime; GVAR(lastSpallTime) = CBA_missionTime;
// step through // step through
@ -97,7 +97,8 @@ if GVAR(dbgSphere) then {
[_lPosASL, "orange"] call FUNC(dev_sphereDraw); [_lPosASL, "orange"] call FUNC(dev_sphereDraw);
}; };
#endif #endif
//***** Select spalled fragment spawner **//
// Select spalled fragment spawner
private _spawnSize = switch (true) do private _spawnSize = switch (true) do
{ {
@ -108,7 +109,7 @@ private _spawnSize = switch (true) do
default { "_spall_huge" }; default { "_spall_huge" };
}; };
//***** Spawn spalled fragments // Spawn spalled fragments
private _spallSpawner = createVehicle [ private _spallSpawner = createVehicle [
"ace_frag_" + _material + _spawnSize, "ace_frag_" + _material + _spawnSize,
ASLToATL _spallPos, ASLToATL _spallPos,

View File

@ -35,24 +35,25 @@ if (isArray (configFile >> "cfgAmmo" >> _ammo >> QGVAR(CLASSES))) then {
_warn = true; _warn = true;
}; };
/************ Gurney equation notes *****************/ /************ Gurney equation notes *****************//*
// see https://en.wikipedia.org/wiki/Gurney_equations * see https://en.wikipedia.org/wiki/Gurney_equations
// *
// GURNEY_K is the constant added to _m/_c * GURNEY_K is the constant added to _m/_c
// GURNEY_C = sqrt(2E) * GURNEY_C = sqrt(2E)
// *
// _c = 185; // grams of comp-b * _c = 185; - grams of comp-b
// _m = 210; // grams of fragmentating metal * _m = 210; - grams of fragmentating metal
// _k = 3/5; // spherical K factor * _k = 3/5; - spherical K factor
// _gC = 2843; // Gurney constant of comp-b in /ms * _gC = 2843; - Gurney constant of comp-b in /ms
*
// _c = 429; // grams of tritonal * _c = 429; - grams of tritonal
// _m = 496; // grams of fragmentating metal * _m = 496; - grams of fragmentating metal
// _k = 1/2; // cylindrical K factor * _k = 1/2; - cylindrical K factor
// _gC = 2320; // Gurney constant of tritonal in m/s * _gC = 2320; - Gurney constant of tritonal in m/s
// Equation - 0.8 for empirical 80% speed * Equation - 0.8 for empirical 80% speed
// 0.8 * (((_m / _c) + _k) ^ - (1 / 2)) * _gC; * 0.8 * (((_m / _c) + _k) ^ - (1 / 2)) * _gC;
// or 0.8 * _gC * sqrt (_c /(_m + _c * _k)); (slightly faster to compute) * or 0.8 * _gC * sqrt (_c /(_m + _c * _k)); (slightly faster to compute)
*/
private _c = getNumber (configFile >> "cfgAmmo" >> _ammo >> QGVAR(CHARGE)); private _c = getNumber (configFile >> "cfgAmmo" >> _ammo >> QGVAR(CHARGE));
if (_c == 0) then {_c = 1; _warn = true;}; if (_c == 0) then {_c = 1; _warn = true;};
@ -69,12 +70,14 @@ if (_warn) then {
INFO_1("Ammo class %1 lacks proper explosive properties definitions for frag!",_ammo); INFO_1("Ammo class %1 lacks proper explosive properties definitions for frag!",_ammo);
}; };
/********************** _ammoInfo format *************************/ /********************** _ammoInfo format *************************//*
// 0: _fragRange - search range for fragments * 0: _fragRange - search range for fragments, calculated with
// 1: _fragVel - gurney equation calculated velocity * a 0.5% chance to hit as the minimum
// 2: _fragTypes - array of fragment types * 1: _fragVel - gurney equation calculated velocity
// 3: _fragCount - modified frag count used under assumptions * 2: _fragTypes - array of fragment types
// of spherical fragmentation * 3: _fragCount - modified frag count used under assumptions
* of spherical fragmentation
*/
_ammoInfo = [ _ammoInfo = [
sqrt (_fragCount / (4 * pi * 0.005)), sqrt (_fragCount / (4 * pi * 0.005)),
0.8 * _gC * sqrt (_c / (_m + _c * _k)), 0.8 * _gC * sqrt (_c / (_m + _c * _k)),

View File

@ -7,11 +7,9 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)];
true true
] call CBA_fnc_addSetting; ] call CBA_fnc_addSetting;
//*** debug options ***//
[ [
QGVAR(dbgSphere), "CHECKBOX", QGVAR(dbgSphere), "CHECKBOX",
[LSTRING(HitSphereEnable), LSTRING(HitSphereEnable_Desc)], [LSTRING(HitSphereEnable), LSTRING(HitSphereEnable_Desc)],
// "Create color coded spheres at ",
[_category, LSTRING(Debug)], [_category, LSTRING(Debug)],
false, false,
0, 0,
@ -22,7 +20,6 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)];
[ [
QGVAR(drawHitBox),"CHECKBOX", QGVAR(drawHitBox),"CHECKBOX",
[LSTRING(DrawHitBox), LSTRING(DrawHitBox_Desc)], [LSTRING(DrawHitBox), LSTRING(DrawHitBox_Desc)],
// ["Draw unit hitboxes", "Draw added hitboxes each frame"],
[_category, LSTRING(Debug)], [_category, LSTRING(Debug)],
true true
] call CBA_fnc_addSetting; ] call CBA_fnc_addSetting;