2024-01-11 20:01:50 +00:00
|
|
|
#include "..\script_component.hpp"
|
2024-01-08 21:22:52 +00:00
|
|
|
/*
|
|
|
|
* Author: Lambda.Tiger, based on fnc_dev_debugAmmo by "ACE-Team"
|
2024-02-16 02:59:58 +00:00
|
|
|
* Dumps all ammo types to see if there's any reason to spawn fragments given hit power and distance.
|
|
|
|
* Good for grasping the values used in shouldFrag to cull non-fragmenting rounds.
|
2024-01-08 21:22:52 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2024-02-16 02:59:58 +00:00
|
|
|
* 0: Display rounds that will never frag <BOOL> (default: false)
|
2024-01-08 21:22:52 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2024-02-14 22:50:09 +00:00
|
|
|
* false call ace_frag_fnc_dev_fragCalcDump
|
2024-01-08 21:22:52 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2024-01-18 02:48:27 +00:00
|
|
|
params [["_logAll", false, [false]]];
|
2024-01-08 21:22:52 +00:00
|
|
|
|
2024-01-18 02:48:27 +00:00
|
|
|
private _allAmmoConfigs = configProperties [configFile >> "CfgAmmo", "isClass _x && !('ace_frag' in configName _x)", true];
|
2024-01-08 21:22:52 +00:00
|
|
|
private _processedCfgAmmos = [];
|
|
|
|
|
2024-03-02 23:59:45 +00:00
|
|
|
private _numberPrinted = 0;
|
2024-01-08 21:22:52 +00:00
|
|
|
|
|
|
|
diag_log text "//****************** fragCalcDump Beg ******************//";
|
2024-01-15 19:13:59 +00:00
|
|
|
{ // Begin _allAmmoConfigs forEach
|
2024-01-19 01:16:39 +00:00
|
|
|
private _ammo = configName _x;
|
2024-01-13 06:35:22 +00:00
|
|
|
|
2024-02-14 22:50:09 +00:00
|
|
|
if (_ammo isEqualTo "" || {_ammo in _processedCfgAmmos}) then {
|
2024-03-02 23:59:45 +00:00
|
|
|
continue;
|
2024-01-16 00:47:21 +00:00
|
|
|
};
|
2024-01-13 06:35:22 +00:00
|
|
|
|
2024-03-29 00:59:49 +00:00
|
|
|
private _shouldFrag = _ammo call FUNC(shouldFrag);
|
2024-02-14 22:50:09 +00:00
|
|
|
if (_shouldFrag || _logAll) then {
|
2024-03-29 00:59:49 +00:00
|
|
|
private _fragInfo = _ammo call FUNC(getFragInfo);
|
2024-01-15 20:08:27 +00:00
|
|
|
_fragInfo params ["_fragRange", "_fragMaxVelocity", "", "_modifiedFragCount"];
|
2024-02-14 22:50:09 +00:00
|
|
|
private _fragCount = 4 * pi * _modifiedFragCount;
|
2024-01-16 00:10:30 +00:00
|
|
|
private _ammoConfig = configFile >> "CfgAmmo" >> _ammo;
|
|
|
|
private _indirectHitRange = getNumber (_ammoConfig >> "indirectHitRange");
|
|
|
|
private _indirectHit = getNumber (_ammoConfig >> "indirectHit");
|
2024-01-15 19:13:59 +00:00
|
|
|
private _fragPowerSpeedRange = [0.5, 1] vectorMultiply _fragMaxVelocity;
|
2024-01-08 21:22:52 +00:00
|
|
|
|
2024-01-11 23:58:47 +00:00
|
|
|
diag_log text format ["Ammo type: %1 | Should frag: %2", _ammo, _shouldFrag];
|
2024-01-08 21:22:52 +00:00
|
|
|
diag_log text format [" Indirect hit range: %1", _indirectHitRange];
|
2024-01-15 19:13:59 +00:00
|
|
|
diag_log text format [" Indirect hit: %1", _indirectHit];
|
2024-01-08 21:22:52 +00:00
|
|
|
diag_log text format [" Frag sqrtPower: %1", _fragPowerSqrt];
|
|
|
|
diag_log text format [" Frag range: %1", _fragRange];
|
|
|
|
diag_log text format [" Frag speed range: %1", _fragPowerSpeedRange];
|
2024-01-15 19:13:59 +00:00
|
|
|
diag_log text format [" Number frags: %1", _fragCount];
|
2024-03-02 23:59:45 +00:00
|
|
|
INC(_numberPrinted);
|
2024-01-08 21:22:52 +00:00
|
|
|
};
|
2024-01-13 06:35:22 +00:00
|
|
|
|
2024-01-08 21:22:52 +00:00
|
|
|
_processedCfgAmmos pushBack _ammo;
|
2024-01-11 23:58:47 +00:00
|
|
|
} forEach _allAmmoConfigs;
|
2024-01-08 21:22:52 +00:00
|
|
|
|
2024-01-15 22:10:01 +00:00
|
|
|
diag_log text "//****************** fragCalcDump End ******************//";
|
2024-03-02 23:59:45 +00:00
|
|
|
diag_log text format ["//********************** printed %1 *********************//", _numberPrinted];
|