mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Clarified trace statements and corrected format and spelling
This commit is contained in:
parent
5915d0ee64
commit
4c905fed42
@ -46,7 +46,7 @@ _fragSpawner setVelocity _fragVelocity;
|
|||||||
_fragSpawner setShotParents _shotParents;
|
_fragSpawner setShotParents _shotParents;
|
||||||
|
|
||||||
#ifdef DEBUG_MODE_FULL
|
#ifdef DEBUG_MODE_FULL
|
||||||
systemChat ("fragging, id: " + getObjectID _proj);
|
systemChat ("frag random objectID: " + getObjectID _proj);
|
||||||
#endif
|
#endif
|
||||||
#ifdef DEBUG_MODE_DRAW
|
#ifdef DEBUG_MODE_DRAW
|
||||||
_fragSpawner addEventHandler [
|
_fragSpawner addEventHandler [
|
||||||
|
@ -38,8 +38,8 @@ if (_fragTypes isEqualTo []) then {
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
// Post 2.18 change - uncomment line 41, remove line 43, 50-55, 64-66, and change lines 57 & 169 from _targets to _objects
|
// Post 2.18 change - uncomment line 41, and remove lines 43, 50-55, 64-66
|
||||||
// private _objects = [ASLToAGL _posASL, _fragRange, _fragRange, 0, false, _fragRange] nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], false, true, true];
|
// private _targets = [ASLToAGL _posASL, _fragRange, _fragRange, 0, false, _fragRange] nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], false, true, true];
|
||||||
private _objects = (ASLToAGL _posASL) nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], _fragRange];
|
private _objects = (ASLToAGL _posASL) nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], _fragRange];
|
||||||
if (_objects isEqualTo []) exitWith {
|
if (_objects isEqualTo []) exitWith {
|
||||||
TRACE_2("No nearby targets",_posASL,_fragRange);
|
TRACE_2("No nearby targets",_posASL,_fragRange);
|
||||||
@ -56,12 +56,14 @@ private _targets = [];
|
|||||||
|
|
||||||
TRACE_3("Targets found",_posASL,_fragRange,count _targets);
|
TRACE_3("Targets found",_posASL,_fragRange,count _targets);
|
||||||
|
|
||||||
// limit number of fragments per direction (2D) to 10 using _fragArcs
|
// limit number of fragments per direction (2D) to _fragsPerFragArc using _fragArcs
|
||||||
private _fragArcs = createHashMap;
|
private _fragArcs = createHashMap;
|
||||||
|
private _fragsPerFragArc = _modFragCount * ACE_FRAG_FRAGS_PER_ARC_CONSTANT;
|
||||||
private _totalFragCount = 0;
|
private _totalFragCount = 0;
|
||||||
{ // Begin of forEach iterating on _targets
|
{ // Begin of forEach iterating on _targets
|
||||||
// Ignore dead units, curators and spectators
|
// Ignore dead units, curators and spectators
|
||||||
if (!alive _x || {getNumber ((configOf _x) >> "isPlayableLogic") == 1}) then {
|
if (!alive _x || {getNumber ((configOf _x) >> "isPlayableLogic") == 1}) then {
|
||||||
|
TRACE_1("dead or logic",_x);
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
private _target = _x;
|
private _target = _x;
|
||||||
@ -106,14 +108,14 @@ private _totalFragCount = 0;
|
|||||||
parseNumber (GVAR(atLeastOne) || {random 1 < _fragChance});
|
parseNumber (GVAR(atLeastOne) || {random 1 < _fragChance});
|
||||||
};
|
};
|
||||||
if (_fragCount == 0) then {
|
if (_fragCount == 0) then {
|
||||||
TRACE_2("fragments",_fragChance,_fragCount);
|
TRACE_2("no fragments",_fragChance,_fragCount);
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
// handle limiting fragments per degree arc
|
// handle limiting fragments per degree arc
|
||||||
private _dir = floor (_posASL getDir _target);
|
private _dir = floor (_posASL getDir _target);
|
||||||
private _fragPerArc = _fragArcs getOrDefault [_dir, 0];
|
private _fragPerArc = _fragArcs getOrDefault [_dir, 0];
|
||||||
if (_fragPerArc > 10) then {
|
if (_fragPerArc > _fragsPerFragArc) then {
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
_fragArcs set [_dir, _fragPerArc + _fragCount];
|
_fragArcs set [_dir, _fragPerArc + _fragCount];
|
||||||
@ -169,7 +171,7 @@ private _totalFragCount = 0;
|
|||||||
} forEach _targets;
|
} forEach _targets;
|
||||||
|
|
||||||
#ifdef DEBUG_MODE_FULL
|
#ifdef DEBUG_MODE_FULL
|
||||||
systemChat ("fragCount cnt: " + str _totalFragCount);
|
systemChat ("targeted frag count: " + str _totalFragCount);
|
||||||
TRACE_1("fragCount",_totalFragCount);
|
TRACE_1("targeted frag count",_totalFragCount);
|
||||||
#endif
|
#endif
|
||||||
_totalFragCount
|
_totalFragCount
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define ACE_FRAG_SOUNDENVIRON_STR_LEN 12
|
#define ACE_FRAG_SOUNDENVIRON_STR_LEN 12
|
||||||
#define ACE_FRAG_SOUNDGIT_STR_LEN 8
|
#define ACE_FRAG_SOUNDHIT_STR_LEN 8
|
||||||
#define ACE_FRAG_MATERIAL_SEARCH_LEN 10
|
#define ACE_FRAG_MATERIAL_SEARCH_LEN 10
|
||||||
|
|
||||||
params ["_surfType"];
|
params ["_surfType"];
|
||||||
@ -24,9 +24,7 @@ params ["_surfType"];
|
|||||||
private _material = GVAR(spallMaterialCache) get _surfType;
|
private _material = GVAR(spallMaterialCache) get _surfType;
|
||||||
|
|
||||||
TRACE_2("materialCache",_surfType,_material);
|
TRACE_2("materialCache",_surfType,_material);
|
||||||
if (!isNil "_material") exitWith {
|
if (!isNil "_material") exitWith {_material};
|
||||||
_material
|
|
||||||
};
|
|
||||||
// Use 'soundEnviron' or 'soundHit' to extract approx material
|
// Use 'soundEnviron' or 'soundHit' to extract approx material
|
||||||
private _surfaceConfig = configFile >> "CfgSurfaces" >> _surfType;
|
private _surfaceConfig = configFile >> "CfgSurfaces" >> _surfType;
|
||||||
if (isClass _surfaceConfig) then {
|
if (isClass _surfaceConfig) then {
|
||||||
@ -39,7 +37,7 @@ if (isClass _surfaceConfig) then {
|
|||||||
_surfFileText = _surfFileText regexReplace ["[^a-z0-9]", ""];
|
_surfFileText = _surfFileText regexReplace ["[^a-z0-9]", ""];
|
||||||
private _idx = ACE_FRAG_SOUNDENVIRON_STR_LEN + (_surfFileText find "soundenviron");
|
private _idx = ACE_FRAG_SOUNDENVIRON_STR_LEN + (_surfFileText find "soundenviron");
|
||||||
if (_surfFileText select [_idx, 5] isEqualTo "empty") then {
|
if (_surfFileText select [_idx, 5] isEqualTo "empty") then {
|
||||||
_idx = ACE_FRAG_SOUNDGIT_STR_LEN + (_surfFileText find "soundhit");
|
_idx = ACE_FRAG_SOUNDHIT_STR_LEN + (_surfFileText find "soundhit");
|
||||||
};
|
};
|
||||||
_material = _surfFileText select [_idx, ACE_FRAG_MATERIAL_SEARCH_LEN];
|
_material = _surfFileText select [_idx, ACE_FRAG_MATERIAL_SEARCH_LEN];
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user