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
TODO:
- More extensive MP testing
- remove submunition EHs in frag
- Finish stringtable expansion with additional normal & debug settings
- More extensive MP testing
- performance optimization
- cDLC, RHS, CUP compats
- look at / try to understand explosion reflections

View File

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

View File

@ -42,7 +42,7 @@ switch (true) do {
};
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);
_centerSphere disableCollisionWith vehicle _obj;
_centerSphere attachTo [_obj, _obj worldToModel _centerPoint];

View File

@ -54,11 +54,11 @@ if (_heightAGL < 0.25) then {
// !*! make timesince a gvar?
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));
};
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);
};

View File

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

View File

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

View File

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

View File

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

View File

@ -29,20 +29,23 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)];
/// !*! TODO: add stringtable entries
[
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)],
[[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;
[
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)],
true
] call CBA_fnc_addSetting;
[
QGVAR(BlackList), "EDITBOX",
// [LSTRING(DefBlackList), LSTRING(DefBlackList_Desc)]
["Default BlackList", "Array of ammo classnames strings to blackist fragmentation for."],
[_category, LSTRING(Frag)],
QUOTE(['B_556x45_Ball'])

View File

@ -1,54 +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]
QGVAR(debugOptions), "CHECKBOX",
// [LSTRING(DebugEnable), LSTRING(DebugEnable_Desc)]
["Enable debug mode", "Enable debug tracing and spheres"],
[_category, LSTRING(Debug)],
true
] call CBA_fnc_addSetting;
// debug options
[
QGVAR(dbgSphere),
"CHECKBOX",
"Enable debug impact spheres",
[_category, LSTRING(Debug)],
false,
QGVAR(dbgSphere), "CHECKBOX",
// [LSTRING(DebugEnable), LSTRING(DebugEnable_Desc)]
"Create color coded spheres at ",
[_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)],
QGVAR(frameHint), "CHECKBOX",
// [LSTRING(FrameHint), LSTRING(FrameHint_Desc)]
["Show framerate hint", "Show 1/diag_frameTime as a hint"],
[_category, LSTRING(Debug)],
true
] call CBA_fnc_addSetting;
[
QGVAR(drawHitBox),
"CHECKBOX",
"Draw unit hitboxes",
[_category, LSTRING(Debug)],
QGVAR(fadeRounds), "CHECKBOX",
// [LSTRING(FadeRounds), LSTRING(FadeRounds_Desc)]
["Fade round traces over time", "Fade round traces for added round over time"],
[_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
] call CBA_fnc_addSetting;