Updated debug settings and staged localization strings

This commit is contained in:
lambdatiger 2024-01-10 00:55:33 -06:00
parent 8f70fa971a
commit 0af6a74a41
10 changed files with 63 additions and 56 deletions

View File

@ -4,9 +4,8 @@ ace_frag
Explosive fragmentation, round spalling, and explosive reflection Explosive fragmentation, round spalling, and explosive reflection
TODO: TODO:
- More extensive MP testing
- remove submunition EHs in frag
- Finish stringtable expansion with additional normal & debug settings - Finish stringtable expansion with additional normal & debug settings
- More extensive MP testing
- performance optimization - performance optimization
- cDLC, RHS, CUP compats - cDLC, RHS, CUP compats
- look at / try to understand explosion reflections - look at / try to understand explosion reflections

View File

@ -15,7 +15,6 @@
["ace_firedNonPlayer", LINKFUNC(fired)] call CBA_fnc_addEventHandler; ["ace_firedNonPlayer", LINKFUNC(fired)] call CBA_fnc_addEventHandler;
["ace_firedNonPlayerVehicle", LINKFUNC(fired)] call CBA_fnc_addEventHandler;*/ ["ace_firedNonPlayerVehicle", LINKFUNC(fired)] call CBA_fnc_addEventHandler;*/
// Debug info
#ifdef DEBUG_MODE_DRAW #ifdef DEBUG_MODE_DRAW
if (hasInterface && GVAR(debugOptions)) then { if (hasInterface && GVAR(debugOptions)) then {
private _h = [LINKFUNC(dev_drawTrace), 0] call CBA_fnc_addPerFrameHandler; private _h = [LINKFUNC(dev_drawTrace), 0] call CBA_fnc_addPerFrameHandler;

View File

@ -42,7 +42,7 @@ switch (true) do {
}; };
private _centerPoint = ASLToAGL getPosASL _obj; private _centerPoint = ASLToAGL getPosASL _obj;
if (_addSphere && vehicle _obj isEqualTo _obj) then { if (GVAR(dbgSphere) && {_addSphere && {vehicle _obj isEqualTo _obj}}) then {
private _centerSphere = [getPosASL _obj, "yellow"] call FUNC(dev_sphereDraw); private _centerSphere = [getPosASL _obj, "yellow"] call FUNC(dev_sphereDraw);
_centerSphere disableCollisionWith vehicle _obj; _centerSphere disableCollisionWith vehicle _obj;
_centerSphere attachTo [_obj, _obj worldToModel _centerPoint]; _centerSphere attachTo [_obj, _obj worldToModel _centerPoint];

View File

@ -54,11 +54,11 @@ if (_heightAGL < 0.25) then {
// !*! make timesince a gvar? // !*! make timesince a gvar?
TRACE_4("fnc_doFragTargeted IF", _fragRange, _timeSince, GVAR(fragSimComplexity)); TRACE_4("fnc_doFragTargeted IF", _fragRange, _timeSince, GVAR(fragSimComplexity));
if (_fragRange > 3 && _timeSince > 0.3 && {GVAR(fragSimComplexity) == 2}) then { if (_fragRange > 3 && _timeSince > 0.3 && {GVAR(fragSimComplexity) != 1}) then {
_maxFrags = _maxFrags - ([_posASL, _fragVel, _fragRange, _maxFrags, _fragTypes, _modFragCount, _shotParents] call FUNC(doFragTargeted)); _maxFrags = _maxFrags - ([_posASL, _fragVel, _fragRange, _maxFrags, _fragTypes, _modFragCount, _shotParents] call FUNC(doFragTargeted));
}; };
if (_timeSince > 0.2 && {GVAR(fragSimComplexity) != 0}) then { if (_timeSince > 0.2 && {GVAR(fragSimComplexity) > 0}) then {
[_posASL, _vel, _heightAGL, _fragTypes, _maxFrags, _shotParents] call FUNC(doFragRandom); [_posASL, _vel, _heightAGL, _fragTypes, _maxFrags, _shotParents] call FUNC(doFragRandom);
}; };

View File

@ -58,15 +58,17 @@ _fragSpawner setVelocity _projVel;
_fragSpawner setShotParents _shotParents; _fragSpawner setShotParents _shotParents;
#ifdef DEBUG_MODE_FULL #ifdef DEBUG_MODE_FULL
systemChat ("fragging, id: " + getObjectID _proj); systemChat ("fragging, id: " + getObjectID _proj);
#endif #endif
#ifdef DEBUG_MODE_DRAW #ifdef DEBUG_MODE_DRAW
_fragSpawner addEventHandler [ _fragSpawner addEventHandler [
"SubmunitionCreated", "SubmunitionCreated",
{ {
params ["","_subProj"]; params ["","_subProj"];
[_subProj, "green", true] call FUNC(dev_trackObj); [_subProj, "green", true] call FUNC(dev_trackObj);
} }
]; ];
[_posASL] call FUNC(dev_sphereDraw); if (GVAR(dbgSphere)) then {
[_posASL] call FUNC(dev_sphereDraw);
};
#endif #endif

View File

@ -158,7 +158,9 @@ private _fragCount = 0; // limit of # of fragments to _maxFrags
_fragObj setShotParents _shotPrnt; _fragObj setShotParents _shotPrnt;
#ifdef DEBUG_MODE_DRAW #ifdef DEBUG_MODE_DRAW
[_fragObj, "purple", true] call FUNC(dev_trackObj); [_fragObj, "purple", true] call FUNC(dev_trackObj);
[_targetPos, "orange"] call FUNC(dev_sphereDraw); if (GVAR(dbgSphere)) then {
[_targetPos, "orange"] call FUNC(dev_sphereDraw);
};
#endif #endif
_fragCount = _fragCount + _count; _fragCount = _fragCount + _count;

View File

@ -51,8 +51,10 @@ for "_i" from 1 to 20 do
_spallPos = +_nPos; _spallPos = +_nPos;
}; };
#ifdef DEBUG_MODE_DRAW #ifdef DEBUG_MODE_DRAW
[_spallPos, "orange"] call FUNC(dev_sphereDraw); if (GVAR(dbgSphere)) then {
[_lPosASL, "orange"] call FUNC(dev_sphereDraw); [_spallPos, "orange"] call FUNC(dev_sphereDraw);
[_lPosASL, "orange"] call FUNC(dev_sphereDraw);
};
#endif #endif
// find last intersect with the object // find last intersect with the object

View File

@ -19,7 +19,7 @@
* Public: No * Public: No
*/ */
if (!GVAR(enabled) || {GVAR(fragSimComplexity) == 0}) exitWith {}; if !GVAR(enabled) exitWith {};
// params ["_projectile", "_submunitionProjectile", "_pos", "_velocity"]; // params ["_projectile", "_submunitionProjectile", "_pos", "_velocity"];
params ["", "_submunitionProjectile"]; params ["", "_submunitionProjectile"];

View File

@ -29,20 +29,23 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)];
/// !*! TODO: add stringtable entries /// !*! TODO: add stringtable entries
[ [
QGVAR(fragSimComplexity), "LIST", QGVAR(fragSimComplexity), "LIST",
["Enable submunition fragmentation", "Enables submunition fragmentation when fragmentation is enabled"], // [LSTRING(FragMode), LSTRING(FragMode_Desc)]
["Fragmentation mode", "Sets how fragments are generated"],
[_category, LSTRING(Frag)], [_category, LSTRING(Frag)],
[[2, 1, 0], ["complex fragementation","simple fragmentation","no fragmentation"], 2] [[2, 1, 0], ["Targeted & random fragmentation ","Random fragmentation","Unit targeted fragmentation"], 2]
] call CBA_fnc_addSetting; ] call CBA_fnc_addSetting;
[ [
QGVAR(atLeastOne), "CHECKBOX", QGVAR(atLeastOne), "CHECKBOX",
"At least one round hit", // [LSTRING(MinFrag), LSTRING(MinFrag_Desc)]
["At least one round hit", "Spawn at least one fragment for units in fragmentation range, up to maximum fragments"],
[_category, LSTRING(Frag)], [_category, LSTRING(Frag)],
true true
] call CBA_fnc_addSetting; ] call CBA_fnc_addSetting;
[ [
QGVAR(BlackList), "EDITBOX", QGVAR(BlackList), "EDITBOX",
// [LSTRING(DefBlackList), LSTRING(DefBlackList_Desc)]
["Default BlackList", "Array of ammo classnames strings to blackist fragmentation for."], ["Default BlackList", "Array of ammo classnames strings to blackist fragmentation for."],
[_category, LSTRING(Frag)], [_category, LSTRING(Frag)],
QUOTE(['B_556x45_Ball']) QUOTE(['B_556x45_Ball'])

View File

@ -1,54 +1,54 @@
private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)];
[ [
QGVAR(debugOptions), QGVAR(debugOptions), "CHECKBOX",
"CHECKBOX", // [LSTRING(DebugEnable), LSTRING(DebugEnable_Desc)]
"Enable debug mode", ["Enable debug mode", "Enable debug tracing and spheres"],
[_category, LSTRING(Debug)], [_category, LSTRING(Debug)],
true // [min, max, default, trailing decimals] true
] call CBA_fnc_addSetting; ] call CBA_fnc_addSetting;
// debug options // debug options
[ [
QGVAR(dbgSphere), QGVAR(dbgSphere), "CHECKBOX",
"CHECKBOX", // [LSTRING(DebugEnable), LSTRING(DebugEnable_Desc)]
"Enable debug impact spheres", "Create color coded spheres at ",
[_category, LSTRING(Debug)], [_category, LSTRING(Debug)],
false, false,
0, 0,
{}, {},
true true
] call CBA_fnc_addSetting; ] call CBA_fnc_addSetting;
[ [
QGVAR(frameHint), QGVAR(frameHint), "CHECKBOX",
"CHECKBOX", // [LSTRING(FrameHint), LSTRING(FrameHint_Desc)]
"Show framerate hint", ["Show framerate hint", "Show 1/diag_frameTime as a hint"],
[_category, LSTRING(Debug)], [_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 true
] call CBA_fnc_addSetting; ] call CBA_fnc_addSetting;
[ [
QGVAR(drawHitBox), QGVAR(fadeRounds), "CHECKBOX",
"CHECKBOX", // [LSTRING(FadeRounds), LSTRING(FadeRounds_Desc)]
"Draw unit hitboxes", ["Fade round traces over time", "Fade round traces for added round over time"],
[_category, LSTRING(Debug)], [_category, LSTRING(Debug)],
true
] call CBA_fnc_addSetting;
[
QGVAR(dltTrace), "CHECKBOX",
// [LSTRING(FadeRounds), LSTRING(FadeRounds_Desc)]
["Delete fire trace on fade", "Delete faded traces"],
[_category, LSTRING(Debug)],
true
] call CBA_fnc_addSetting;
[
QGVAR(drawHitBox),"CHECKBOX",
// [LSTRING(DrawHitBox), LSTRING(DrawHitBox_Desc)]
["Draw unit hitboxes", "Draw added hitboxes each frame"],
[_category, LSTRING(Debug)],
true true
] call CBA_fnc_addSetting; ] call CBA_fnc_addSetting;