mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'master' into medical-rewrite
Conflicts: addons/medical/ACE_Settings.hpp addons/medical/XEH_postInit.sqf addons/medical/functions/fnc_adjustPainLevel.sqf addons/medical/functions/fnc_copyDeadBody.sqf addons/medical/functions/fnc_getTriageStatus.sqf addons/medical/functions/fnc_handleBandageOpening.sqf addons/medical/functions/fnc_handleCollisionDamage.sqf addons/medical/functions/fnc_handleDamage_fractures.sqf addons/medical/functions/fnc_handleDamage_woundsOld.sqf addons/medical/functions/fnc_init.sqf addons/medical/functions/fnc_moduleAssignMedicalFacility.sqf addons/medical/functions/fnc_parseConfigForInjuries.sqf addons/medical/functions/fnc_setDead.sqf addons/medical/functions/fnc_setHitPointDamage.sqf addons/medical/functions/fnc_setUnconscious.sqf addons/medical/functions/fnc_showBloodEffect.sqf addons/medical/functions/fnc_unconsciousPFH.sqf addons/medical/stringtable.xml addons/medical_ai/functions/fnc_healUnit.sqf addons/medical_ai/functions/fnc_isInjured.sqf addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf
This commit is contained in:
commit
5c4dbdcbda
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/acemod/ACE3/releases/latest">
|
<a href="https://github.com/acemod/ACE3/releases/latest">
|
||||||
<img src="https://img.shields.io/badge/Version-3.10.2-blue.svg?style=flat-square" alt="ACE3 Version">
|
<img src="https://img.shields.io/badge/Version-3.11.0-blue.svg?style=flat-square" alt="ACE3 Version">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/acemod/ACE3/issues">
|
<a href="https://github.com/acemod/ACE3/issues">
|
||||||
<img src="https://img.shields.io/github/issues-raw/acemod/ACE3.svg?style=flat-square&label=Issues" alt="ACE3 Issues">
|
<img src="https://img.shields.io/github/issues-raw/acemod/ACE3.svg?style=flat-square&label=Issues" alt="ACE3 Issues">
|
||||||
@ -126,4 +126,4 @@ To help us test the latest development changes, download our master branch ([dir
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
ACE3 is licensed under the GNU General Public License ([GPLv2](https://github.com/acemod/ACE3/blob/master/LICENSE).
|
ACE3 is licensed under the GNU General Public License ([GPLv2](https://github.com/acemod/ACE3/blob/master/LICENSE)).
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -21,17 +21,14 @@
|
|||||||
|
|
||||||
scopeName "main";
|
scopeName "main";
|
||||||
|
|
||||||
private ["_muzzleVelocityTableCount", "_barrelLengthTableCount", "_lowerDataIndex",
|
|
||||||
"_upperDataIndex", "_lowerBarrelLength", "_upperBarrelLength", "_lowerMuzzleVelocity",
|
|
||||||
"_upperMuzzleVelocity", "_interpolationRatio"];
|
|
||||||
params ["_barrelLength", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocity"];
|
params ["_barrelLength", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocity"];
|
||||||
TRACE_4("params",_barrelLength,_muzzleVelocityTable,_barrelLengthTable,_muzzleVelocity);
|
TRACE_4("params",_barrelLength,_muzzleVelocityTable,_barrelLengthTable,_muzzleVelocity);
|
||||||
|
|
||||||
// If barrel length is not defined, then there is no point in calculating muzzle velocity
|
// If barrel length is not defined, then there is no point in calculating muzzle velocity
|
||||||
if (_barrelLength == 0) exitWith { 0 };
|
if (_barrelLength == 0) exitWith { 0 };
|
||||||
|
|
||||||
_muzzleVelocityTableCount = count _muzzleVelocityTable;
|
private _muzzleVelocityTableCount = count _muzzleVelocityTable;
|
||||||
_barrelLengthTableCount = count _barrelLengthTable;
|
private _barrelLengthTableCount = count _barrelLengthTable;
|
||||||
|
|
||||||
// Exit if tables are different sizes, have no elements or have only one element
|
// Exit if tables are different sizes, have no elements or have only one element
|
||||||
if (_muzzleVelocityTableCount != _barrelLengthTableCount || _muzzleVelocityTableCount == 0 || _barrelLengthTableCount == 0) exitWith { 0 };
|
if (_muzzleVelocityTableCount != _barrelLengthTableCount || _muzzleVelocityTableCount == 0 || _barrelLengthTableCount == 0) exitWith { 0 };
|
||||||
@ -46,6 +43,9 @@ if (_barrelLength in _barrelLengthTable) exitWith {
|
|||||||
if (_barrelLength <= (_barrelLengthTable select 0)) exitWith { (_muzzleVelocityTable select 0) - _muzzleVelocity };
|
if (_barrelLength <= (_barrelLengthTable select 0)) exitWith { (_muzzleVelocityTable select 0) - _muzzleVelocity };
|
||||||
if (_barrelLength >= (_barrelLengthTable select _barrelLengthTableCount - 1)) exitWith { (_muzzleVelocityTable select _barrelLengthTableCount - 1) - _muzzleVelocity };
|
if (_barrelLength >= (_barrelLengthTable select _barrelLengthTableCount - 1)) exitWith { (_muzzleVelocityTable select _barrelLengthTableCount - 1) - _muzzleVelocity };
|
||||||
|
|
||||||
|
private _upperDataIndex = -1;
|
||||||
|
private _lowerDataIndex = -1;
|
||||||
|
|
||||||
// Find closest bordering values for barrel length
|
// Find closest bordering values for barrel length
|
||||||
{
|
{
|
||||||
if (_barrelLength <= _x) then {
|
if (_barrelLength <= _x) then {
|
||||||
@ -56,19 +56,15 @@ if (_barrelLength >= (_barrelLengthTable select _barrelLengthTableCount - 1)) ex
|
|||||||
} forEach _barrelLengthTable;
|
} forEach _barrelLengthTable;
|
||||||
|
|
||||||
// Worst case scenario
|
// Worst case scenario
|
||||||
if (isNil "_lowerDataIndex" || isNil "_upperDataIndex") exitWith {0};
|
if (_upperDataIndex == -1 || _lowerDataIndex == -1) exitWith {0};
|
||||||
|
|
||||||
_lowerBarrelLength = _barrelLengthTable select _lowerDataIndex;
|
private _lowerBarrelLength = _barrelLengthTable select _lowerDataIndex;
|
||||||
_upperBarrelLength = _barrelLengthTable select _upperDataIndex;
|
private _upperBarrelLength = _barrelLengthTable select _upperDataIndex;
|
||||||
_lowerMuzzleVelocity = _muzzleVelocityTable select _lowerDataIndex;
|
private _lowerMuzzleVelocity = _muzzleVelocityTable select _lowerDataIndex;
|
||||||
_upperMuzzleVelocity = _muzzleVelocityTable select _upperDataIndex;
|
private _upperMuzzleVelocity = _muzzleVelocityTable select _upperDataIndex;
|
||||||
|
|
||||||
// Calculate interpolation ratio
|
// Calculate interpolation ratio
|
||||||
_interpolationRatio = if (abs (_lowerBarrelLength - _upperBarrelLength) > 0) then {
|
private _interpolationRatio = [0, (_upperBarrelLength - _barrelLength) / (_upperBarrelLength - _lowerBarrelLength)] select (abs (_lowerBarrelLength - _upperBarrelLength) > 0);
|
||||||
(_upperBarrelLength - _barrelLength) / (_upperBarrelLength - _lowerBarrelLength)
|
|
||||||
} else {
|
|
||||||
0
|
|
||||||
};
|
|
||||||
|
|
||||||
// Calculate interpolated muzzle velocity shift
|
// Calculate interpolated muzzle velocity shift
|
||||||
(_lowerMuzzleVelocity + ((_upperMuzzleVelocity - _lowerMuzzleVelocity) * (1 - _interpolationRatio))) - _muzzleVelocity // Return
|
(_lowerMuzzleVelocity + ((_upperMuzzleVelocity - _lowerMuzzleVelocity) * (1 - _interpolationRatio))) - _muzzleVelocity // Return
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private _aceTimeSecond = floor CBA_missionTime;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
_x params ["_bullet","_caliber","_bulletTraceVisible","_index"];
|
_x params ["_bullet","_caliber","_bulletTraceVisible","_index"];
|
||||||
|
|
||||||
@ -33,7 +31,7 @@ private _aceTimeSecond = floor CBA_missionTime;
|
|||||||
drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""];
|
drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""];
|
||||||
};
|
};
|
||||||
|
|
||||||
_bullet setVelocity (_bulletVelocity vectorAdd (parseSimpleArray ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, _aceTimeSecond, CBA_missionTime - _aceTimeSecond])));
|
_bullet setVelocity (_bulletVelocity vectorAdd (parseSimpleArray ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, CBA_missionTime toFixed 6])));
|
||||||
};
|
};
|
||||||
nil
|
nil
|
||||||
} count +GVAR(allBullets);
|
} count +GVAR(allBullets);
|
||||||
|
@ -19,10 +19,7 @@
|
|||||||
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"];
|
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"];
|
||||||
TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret);
|
TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret);
|
||||||
|
|
||||||
// Parameterization
|
private _abort = false;
|
||||||
private ["_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletLength", "_barrelTwist", "_stabilityFactor", "_aceTimeSecond", "_barrelVelocityShift", "_ammoTemperatureVelocityShift"];
|
|
||||||
|
|
||||||
_abort = false;
|
|
||||||
|
|
||||||
if (!(_ammo isKindOf "BulletBase")) exitWith {};
|
if (!(_ammo isKindOf "BulletBase")) exitWith {};
|
||||||
if (!alive _projectile) exitWith {};
|
if (!alive _projectile) exitWith {};
|
||||||
@ -33,8 +30,8 @@ if (!GVAR(simulateForEveryone) && !(local _unit)) then {
|
|||||||
_abort = true;
|
_abort = true;
|
||||||
if (GVAR(simulateForSnipers)) then {
|
if (GVAR(simulateForSnipers)) then {
|
||||||
if (currentWeapon _unit == primaryWeapon _unit && count primaryWeaponItems _unit > 2) then {
|
if (currentWeapon _unit == primaryWeapon _unit && count primaryWeaponItems _unit > 2) then {
|
||||||
_opticsName = (primaryWeaponItems _unit) select 2;
|
private _opticsName = (primaryWeaponItems _unit) select 2;
|
||||||
_opticType = getNumber(configFile >> "CfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType");
|
private _opticType = getNumber(configFile >> "CfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType");
|
||||||
_abort = _opticType != 2; // We only abort if the non local shooter is not a sniper
|
_abort = _opticType != 2; // We only abort if the non local shooter is not a sniper
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -46,11 +43,11 @@ if (!GVAR(simulateForEveryone) && !(local _unit)) then {
|
|||||||
if (GVAR(disabledInFullAutoMode) && getNumber(configFile >> "CfgWeapons" >> _weapon >> _mode >> "autoFire") == 1) then { _abort = true; };
|
if (GVAR(disabledInFullAutoMode) && getNumber(configFile >> "CfgWeapons" >> _weapon >> _mode >> "autoFire") == 1) then { _abort = true; };
|
||||||
|
|
||||||
// Get Weapon and Ammo Configurations
|
// Get Weapon and Ammo Configurations
|
||||||
_AmmoCacheEntry = uiNamespace getVariable format[QGVAR(%1), _ammo];
|
private _AmmoCacheEntry = uiNamespace getVariable format[QGVAR(%1), _ammo];
|
||||||
if (isNil "_AmmoCacheEntry") then {
|
if (isNil "_AmmoCacheEntry") then {
|
||||||
_AmmoCacheEntry = _ammo call FUNC(readAmmoDataFromConfig);
|
_AmmoCacheEntry = _ammo call FUNC(readAmmoDataFromConfig);
|
||||||
};
|
};
|
||||||
_WeaponCacheEntry = uiNamespace getVariable format[QGVAR(%1), _weapon];
|
private _WeaponCacheEntry = uiNamespace getVariable format[QGVAR(%1), _weapon];
|
||||||
if (isNil "_WeaponCacheEntry") then {
|
if (isNil "_WeaponCacheEntry") then {
|
||||||
_WeaponCacheEntry = _weapon call FUNC(readWeaponDataFromConfig);
|
_WeaponCacheEntry = _weapon call FUNC(readWeaponDataFromConfig);
|
||||||
};
|
};
|
||||||
@ -59,22 +56,24 @@ _AmmoCacheEntry params ["_airFriction", "_caliber", "_bulletLength", "_bulletMas
|
|||||||
_WeaponCacheEntry params ["_barrelTwist", "_twistDirection", "_barrelLength"];
|
_WeaponCacheEntry params ["_barrelTwist", "_twistDirection", "_barrelLength"];
|
||||||
|
|
||||||
|
|
||||||
_bulletVelocity = velocity _projectile;
|
private _bulletVelocity = velocity _projectile;
|
||||||
_muzzleVelocity = vectorMagnitude _bulletVelocity;
|
private _muzzleVelocity = vectorMagnitude _bulletVelocity;
|
||||||
|
|
||||||
_barrelVelocityShift = 0;
|
private _barrelVelocityShift = 0;
|
||||||
if (GVAR(barrelLengthInfluenceEnabled)) then {
|
if (GVAR(barrelLengthInfluenceEnabled)) then {
|
||||||
_barrelVelocityShift = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift);
|
_barrelVelocityShift = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift);
|
||||||
};
|
};
|
||||||
|
|
||||||
_ammoTemperatureVelocityShift = 0;
|
private _ammoTemperatureVelocityShift = 0;
|
||||||
|
private _temperature = nil; //Need the variable in this scope. So we need to init it here.
|
||||||
|
|
||||||
if (GVAR(ammoTemperatureEnabled)) then {
|
if (GVAR(ammoTemperatureEnabled)) then {
|
||||||
_temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight);
|
_temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight);
|
||||||
_ammoTemperatureVelocityShift = ([_ammoTempMuzzleVelocityShifts, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift));
|
_ammoTemperatureVelocityShift = ([_ammoTempMuzzleVelocityShifts, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift));
|
||||||
};
|
};
|
||||||
|
|
||||||
if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then {
|
if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then {
|
||||||
_muzzleVelocityShift = _barrelVelocityShift + _ammoTemperatureVelocityShift;
|
private _muzzleVelocityShift = _barrelVelocityShift + _ammoTemperatureVelocityShift;
|
||||||
TRACE_4("shift",_muzzleVelocity,_muzzleVelocityShift, _barrelVelocityShift, _ammoTemperatureVelocityShift);
|
TRACE_4("shift",_muzzleVelocity,_muzzleVelocityShift, _barrelVelocityShift, _ammoTemperatureVelocityShift);
|
||||||
if (_muzzleVelocityShift != 0) then {
|
if (_muzzleVelocityShift != 0) then {
|
||||||
_muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift;
|
_muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift;
|
||||||
@ -89,32 +88,31 @@ if (_abort || !(GVAR(extensionAvailable))) exitWith {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
_bulletTraceVisible = false;
|
private _bulletTraceVisible = false;
|
||||||
if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER") then {
|
if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER") then {
|
||||||
if (currentWeapon ACE_player == binocular ACE_player) then {
|
if (currentWeapon ACE_player == binocular ACE_player) then {
|
||||||
_bulletTraceVisible = true;
|
_bulletTraceVisible = true;
|
||||||
} else {
|
} else {
|
||||||
if (currentWeapon ACE_player == primaryWeapon ACE_player && count primaryWeaponItems ACE_player > 2) then {
|
if (currentWeapon ACE_player == primaryWeapon ACE_player && count primaryWeaponItems ACE_player > 2) then {
|
||||||
_opticsName = (primaryWeaponItems ACE_player) select 2;
|
private _opticsName = (primaryWeaponItems ACE_player) select 2;
|
||||||
_opticType = getNumber(configFile >> "CfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType");
|
private _opticType = getNumber(configFile >> "CfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType");
|
||||||
_bulletTraceVisible = _opticType == 2;
|
_bulletTraceVisible = _opticType == 2;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
_stabilityFactor = 1.5;
|
private _stabilityFactor = 1.5;
|
||||||
if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then {
|
if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then {
|
||||||
if (isNil "_temperature") then {
|
if (isNil "_temperature") then {
|
||||||
_temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight);
|
_temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight);
|
||||||
};
|
};
|
||||||
_barometricPressure = ((getPosASL _projectile) select 2) call EFUNC(weather,calculateBarometricPressure);
|
private _barometricPressure = ((getPosASL _projectile) select 2) call EFUNC(weather,calculateBarometricPressure);
|
||||||
_stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call FUNC(calculateStabilityFactor);
|
_stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call FUNC(calculateStabilityFactor);
|
||||||
};
|
};
|
||||||
|
|
||||||
GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000;
|
GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000;
|
||||||
|
|
||||||
_aceTimeSecond = floor CBA_missionTime;
|
"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17", GVAR(currentbulletID), _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _muzzleVelocity, _transonicStabilityCoef, getPosASL _projectile, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), overcast, CBA_missionTime toFixed 6];
|
||||||
"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _muzzleVelocity, _transonicStabilityCoef, getPosASL _projectile, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), overcast, _aceTimeSecond, CBA_missionTime - _aceTimeSecond];
|
|
||||||
|
|
||||||
GVAR(allBullets) pushBack [_projectile, _caliber, _bulletTraceVisible, GVAR(currentbulletID)];
|
GVAR(allBullets) pushBack [_projectile, _caliber, _bulletTraceVisible, GVAR(currentbulletID)];
|
||||||
|
|
||||||
|
@ -19,10 +19,8 @@ if (!hasInterface) exitWith {};
|
|||||||
if (!GVAR(enabled)) exitWith {};
|
if (!GVAR(enabled)) exitWith {};
|
||||||
if (!GVAR(extensionAvailable)) exitWith {};
|
if (!GVAR(extensionAvailable)) exitWith {};
|
||||||
|
|
||||||
private ["_initStartTime", "_mapSize", "_mapGrids", "_gridCells", "_x", "_y", "_gridCenter", "_gridHeight", "_gridNumObjects", "_gridSurfaceIsWater"];
|
private _initStartTime = CBA_missionTime;
|
||||||
|
private _mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize");
|
||||||
_initStartTime = CBA_missionTime;
|
|
||||||
_mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize");
|
|
||||||
|
|
||||||
if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith {
|
if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith {
|
||||||
INFO_1("Terrain already initialized [world: %1]", worldName);
|
INFO_1("Terrain already initialized [world: %1]", worldName);
|
||||||
@ -31,8 +29,8 @@ if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _ma
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
_mapGrids = ceil(_mapSize / 50) + 1;
|
private _mapGrids = ceil(_mapSize / 50) + 1;
|
||||||
_gridCells = _mapGrids * _mapGrids;
|
private _gridCells = _mapGrids * _mapGrids;
|
||||||
|
|
||||||
GVAR(currentGrid) = 0;
|
GVAR(currentGrid) = 0;
|
||||||
|
|
||||||
@ -51,12 +49,12 @@ INFO_2("Starting Terrain Extension [cells: %1] [world: %2]", _gridCells, worldNa
|
|||||||
};
|
};
|
||||||
|
|
||||||
for "_i" from 1 to 50 do {
|
for "_i" from 1 to 50 do {
|
||||||
_x = floor(GVAR(currentGrid) / _mapGrids) * 50;
|
private _x = floor(GVAR(currentGrid) / _mapGrids) * 50;
|
||||||
_y = (GVAR(currentGrid) - floor(GVAR(currentGrid) / _mapGrids) * _mapGrids) * 50;
|
private _y = (GVAR(currentGrid) - floor(GVAR(currentGrid) / _mapGrids) * _mapGrids) * 50;
|
||||||
_gridCenter = [_x + 25, _y + 25];
|
private _gridCenter = [_x + 25, _y + 25];
|
||||||
_gridHeight = round(getTerrainHeightASL _gridCenter);
|
private _gridHeight = round(getTerrainHeightASL _gridCenter);
|
||||||
_gridNumObjects = count (_gridCenter nearObjects ["Building", 50]);
|
private _gridNumObjects = count (_gridCenter nearObjects ["Building", 50]);
|
||||||
_gridSurfaceIsWater = if (surfaceIsWater _gridCenter) then {1} else {0};
|
private _gridSurfaceIsWater = if (surfaceIsWater _gridCenter) then {1} else {0};
|
||||||
"ace_advanced_ballistics" callExtension format["set:%1:%2:%3", _gridHeight, _gridNumObjects, _gridSurfaceIsWater];
|
"ace_advanced_ballistics" callExtension format["set:%1:%2:%3", _gridHeight, _gridNumObjects, _gridSurfaceIsWater];
|
||||||
GVAR(currentGrid) = GVAR(currentGrid) + 1;
|
GVAR(currentGrid) = GVAR(currentGrid) + 1;
|
||||||
if (GVAR(currentGrid) >= _gridCells) exitWith {};
|
if (GVAR(currentGrid) >= _gridCells) exitWith {};
|
||||||
|
@ -28,30 +28,30 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
TRACE_1("Reading Ammo Config",_this);
|
TRACE_1("Reading Ammo Config",_this);
|
||||||
private ["_ammo", "_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_result"];
|
|
||||||
private _ammoConfig = configFile >> "CfgAmmo" >> _this;
|
private _ammoConfig = configFile >> "CfgAmmo" >> _this;
|
||||||
|
|
||||||
_airFriction = getNumber(_ammoConfig >> "airFriction");
|
private _airFriction = getNumber(_ammoConfig >> "airFriction");
|
||||||
_caliber = getNumber(_ammoConfig >> "ACE_caliber");
|
private _caliber = getNumber(_ammoConfig >> "ACE_caliber");
|
||||||
_bulletLength = getNumber(_ammoConfig >> "ACE_bulletLength");
|
private _bulletLength = getNumber(_ammoConfig >> "ACE_bulletLength");
|
||||||
_bulletMass = getNumber(_ammoConfig >> "ACE_bulletMass");
|
private _bulletMass = getNumber(_ammoConfig >> "ACE_bulletMass");
|
||||||
_transonicStabilityCoef = getNumber(_ammoConfig >> "ACE_transonicStabilityCoef");
|
private _transonicStabilityCoef = getNumber(_ammoConfig >> "ACE_transonicStabilityCoef");
|
||||||
if (_transonicStabilityCoef == 0) then {
|
if (_transonicStabilityCoef == 0) then {
|
||||||
_transonicStabilityCoef = 0.5;
|
_transonicStabilityCoef = 0.5;
|
||||||
};
|
};
|
||||||
_dragModel = getNumber(_ammoConfig >> "ACE_dragModel");
|
private _dragModel = getNumber(_ammoConfig >> "ACE_dragModel");
|
||||||
if (_dragModel == 0 || !(_dragModel in [1, 2, 5, 6, 7, 8])) then {
|
if (_dragModel == 0 || !(_dragModel in [1, 2, 5, 6, 7, 8])) then {
|
||||||
_dragModel = 1;
|
_dragModel = 1;
|
||||||
};
|
};
|
||||||
_ballisticCoefficients = getArray(_ammoConfig >> "ACE_ballisticCoefficients");
|
private _ballisticCoefficients = getArray(_ammoConfig >> "ACE_ballisticCoefficients");
|
||||||
_velocityBoundaries = getArray(_ammoConfig >> "ACE_velocityBoundaries");
|
private _velocityBoundaries = getArray(_ammoConfig >> "ACE_velocityBoundaries");
|
||||||
_atmosphereModel = getText(_ammoConfig >> "ACE_standardAtmosphere");
|
private _atmosphereModel = getText(_ammoConfig >> "ACE_standardAtmosphere");
|
||||||
if (_atmosphereModel isEqualTo "") then {
|
if (_atmosphereModel isEqualTo "") then {
|
||||||
_atmosphereModel = "ICAO";
|
_atmosphereModel = "ICAO";
|
||||||
};
|
};
|
||||||
_ammoTempMuzzleVelocityShifts = getArray(_ammoConfig >> "ACE_ammoTempMuzzleVelocityShifts");
|
private _ammoTempMuzzleVelocityShifts = getArray(_ammoConfig >> "ACE_ammoTempMuzzleVelocityShifts");
|
||||||
_muzzleVelocityTable = getArray(_ammoConfig >> "ACE_muzzleVelocities");
|
private _muzzleVelocityTable = getArray(_ammoConfig >> "ACE_muzzleVelocities");
|
||||||
_barrelLengthTable = getArray(_ammoConfig >> "ACE_barrelLengths");
|
private _barrelLengthTable = getArray(_ammoConfig >> "ACE_barrelLengths");
|
||||||
|
|
||||||
//Handle subsonic ammo that would have a huge muzzle velocity shift (when ballistic configs not explicitly defined)
|
//Handle subsonic ammo that would have a huge muzzle velocity shift (when ballistic configs not explicitly defined)
|
||||||
private _typicalSpeed = getNumber (_ammoConfig >> "typicalSpeed");
|
private _typicalSpeed = getNumber (_ammoConfig >> "typicalSpeed");
|
||||||
@ -89,7 +89,7 @@ if ((_typicalSpeed > 0) && {_typicalSpeed < 360}) then {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
_result = [_airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable];
|
private _result = [_airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable];
|
||||||
|
|
||||||
uiNamespace setVariable [format[QGVAR(%1), _this], _result];
|
uiNamespace setVariable [format[QGVAR(%1), _this], _result];
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
<Package name="Advanced_Fatigue">
|
<Package name="Advanced_Fatigue">
|
||||||
<Key ID="STR_ACE_Advanced_Fatigue_DisplayName">
|
<Key ID="STR_ACE_Advanced_Fatigue_DisplayName">
|
||||||
<English>Advanced Fatigue</English>
|
<English>Advanced Fatigue</English>
|
||||||
|
<German>Erweiterte Ausdauer</German>
|
||||||
<Chinese>進階疲勞</Chinese>
|
<Chinese>進階疲勞</Chinese>
|
||||||
<Chinesesimp>进阶疲劳</Chinesesimp>
|
<Chinesesimp>进阶疲劳</Chinesesimp>
|
||||||
<Japanese>アドバンスド疲労</Japanese>
|
<Japanese>アドバンスド疲労</Japanese>
|
||||||
@ -22,7 +23,7 @@
|
|||||||
<Key ID="STR_ACE_Advanced_Fatigue_PerformanceFactor_Description">
|
<Key ID="STR_ACE_Advanced_Fatigue_PerformanceFactor_Description">
|
||||||
<English>Influences the overall performance of all players with no custom factor. Higher means better.</English>
|
<English>Influences the overall performance of all players with no custom factor. Higher means better.</English>
|
||||||
<German>Beinflusst die Leistungsfähigkeit aller Spieler ohne eigenen Leistungsfaktor. Ein höherer Wert bedeutet bessere Leistung.</German>
|
<German>Beinflusst die Leistungsfähigkeit aller Spieler ohne eigenen Leistungsfaktor. Ein höherer Wert bedeutet bessere Leistung.</German>
|
||||||
<Japanese>非カスタム要因をもつ全プレイヤーへ全体的に動作を影響させます。高いほど影響がでます。</Japanese>
|
<Japanese>非カスタム要因をもつ全プレイヤーへ全体的に動作を影響させます。高いほど良い効果があります。</Japanese>
|
||||||
<Polish>Wpływa na ogólną wydolność organizmu u wszystkich graczy bez ustawionego niestandardowego współczynnika. Więcej znaczy lepiej.</Polish>
|
<Polish>Wpływa na ogólną wydolność organizmu u wszystkich graczy bez ustawionego niestandardowego współczynnika. Więcej znaczy lepiej.</Polish>
|
||||||
<Korean>모든 성능이 임의로 설정된 값 없이 영향받습니다. 값이 클수록 더 나은 성능을 발휘합니다</Korean>
|
<Korean>모든 성능이 임의로 설정된 값 없이 영향받습니다. 값이 클수록 더 나은 성능을 발휘합니다</Korean>
|
||||||
<French>Influence les performances générales de tous les joueurs sans facteurs personalisés. Une valeur plus élevée implique de meilleures performances.</French>
|
<French>Influence les performances générales de tous les joueurs sans facteurs personalisés. Une valeur plus élevée implique de meilleures performances.</French>
|
||||||
@ -33,7 +34,7 @@
|
|||||||
<Key ID="STR_ACE_Advanced_Fatigue_PerformanceFactor_EdenDescription">
|
<Key ID="STR_ACE_Advanced_Fatigue_PerformanceFactor_EdenDescription">
|
||||||
<English>Influences the overall performance of this unit. Higher means better.</English>
|
<English>Influences the overall performance of this unit. Higher means better.</English>
|
||||||
<German>Beinflusst die Leistungsfähigkeit dieser Einheit. Ein höherer Wert bedeutet bessere Leistung.</German>
|
<German>Beinflusst die Leistungsfähigkeit dieser Einheit. Ein höherer Wert bedeutet bessere Leistung.</German>
|
||||||
<Japanese>非カスタム要因をもつ全プレイヤーへ全体的に動作を影響させます。高いほど影響がでます。</Japanese>
|
<Japanese>このユニットの全体的な動作に影響させます。高いほど良い効果があります。</Japanese>
|
||||||
<Polish>Wpływa na ogólną wydolność tej jednostki. Więcej znaczy lepiej.</Polish>
|
<Polish>Wpływa na ogólną wydolność tej jednostki. Więcej znaczy lepiej.</Polish>
|
||||||
<Korean>모든 성능이 이 단위로 영향을 받습니다. 값이 클수록 더 나은 성능을 발휘합니다</Korean>
|
<Korean>모든 성능이 이 단위로 영향을 받습니다. 값이 클수록 더 나은 성능을 발휘합니다</Korean>
|
||||||
<French>Influence les performances générales de cette unité. Une valeur plus élevée implique de meilleures performances.</French>
|
<French>Influence les performances générales de cette unité. Une valeur plus élevée implique de meilleures performances.</French>
|
||||||
@ -55,7 +56,7 @@
|
|||||||
<Key ID="STR_ACE_Advanced_Fatigue_RecoveryFactor_Description">
|
<Key ID="STR_ACE_Advanced_Fatigue_RecoveryFactor_Description">
|
||||||
<English>Changes how fast the player recovers when resting. Higher is faster.</English>
|
<English>Changes how fast the player recovers when resting. Higher is faster.</English>
|
||||||
<German>Ändert, wie schnell ein Spieler Ausdauer regeneriert. Ein höherer Wert bedeutet eine schnellere Regeneration.</German>
|
<German>Ändert, wie schnell ein Spieler Ausdauer regeneriert. Ein höherer Wert bedeutet eine schnellere Regeneration.</German>
|
||||||
<Japanese>休憩時は、プレイヤーが早く回復します。高いほど早くなります。</Japanese>
|
<Japanese>休憩時はプレイヤーが早く回復します。高いほど早くなります。</Japanese>
|
||||||
<Polish>Wpływa na czas regeneracji podczas postoju. Więcej znaczy szybciej.</Polish>
|
<Polish>Wpływa na czas regeneracji podczas postoju. Więcej znaczy szybciej.</Polish>
|
||||||
<Korean>얼마나 빨리 회복하는지를 바꿉니다. 값이 클수록 더 나은 성능을 발휘합니다</Korean>
|
<Korean>얼마나 빨리 회복하는지를 바꿉니다. 값이 클수록 더 나은 성능을 발휘합니다</Korean>
|
||||||
<French>Change la vitesse à laquelle les joueurs récupèrent leur endurance lorsqu'ils se reposent. Une valeur plus élevée implique une récupération plus rapide.</French>
|
<French>Change la vitesse à laquelle les joueurs récupèrent leur endurance lorsqu'ils se reposent. Une valeur plus élevée implique une récupération plus rapide.</French>
|
||||||
@ -77,7 +78,7 @@
|
|||||||
<Key ID="STR_ACE_Advanced_Fatigue_LoadFactor_Description">
|
<Key ID="STR_ACE_Advanced_Fatigue_LoadFactor_Description">
|
||||||
<English>Increases or decreases how much weight influences the players performance. Zero means equipment weight has no performance influence.</English>
|
<English>Increases or decreases how much weight influences the players performance. Zero means equipment weight has no performance influence.</English>
|
||||||
<German>Erhöht oder verringert, wie viel Einfluss das Ausrüstungsgewicht auf die Leistung hat. Null heißt, dass es keinen Einfluss hat.</German>
|
<German>Erhöht oder verringert, wie viel Einfluss das Ausrüstungsgewicht auf die Leistung hat. Null heißt, dass es keinen Einfluss hat.</German>
|
||||||
<Japanese>重量によりプレイヤーの動作への影響下増加したり、低下します。装備を持っていない場合、影響はしません。</Japanese>
|
<Japanese>重量の増減によりプレイヤーの動作へ影響を与えます。装備を持っていない場合、影響はしません。</Japanese>
|
||||||
<Polish>Zmniejsza lub zwiększa wpływ ciężaru ekwipunku na wydolność gracza. Zero oznacza kompletny brak wpływu na wydolność.</Polish>
|
<Polish>Zmniejsza lub zwiększa wpływ ciężaru ekwipunku na wydolność gracza. Zero oznacza kompletny brak wpływu na wydolność.</Polish>
|
||||||
<Korean>플레이어가 무게에 따라 얼마나 영향받는지를 증가시키거나 감소시킵니다. 0의 경우 플레이어가 장비 무게에 영향받지 않습니다.</Korean>
|
<Korean>플레이어가 무게에 따라 얼마나 영향받는지를 증가시키거나 감소시킵니다. 0의 경우 플레이어가 장비 무게에 영향받지 않습니다.</Korean>
|
||||||
<French>Augmente ou réduit l'influence que le poids à sur les performances des joueurs. Zéro implique que le poids de l'équipement n'a pas d'influence sur les performances.</French>
|
<French>Augmente ou réduit l'influence que le poids à sur les performances des joueurs. Zéro implique que le poids de l'équipement n'a pas d'influence sur les performances.</French>
|
||||||
|
7
addons/advanced_throwing/CfgAmmo.hpp
Normal file
7
addons/advanced_throwing/CfgAmmo.hpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
class CfgAmmo {
|
||||||
|
class Default;
|
||||||
|
class Grenade: Default {
|
||||||
|
GVAR(torqueDirection)[] = {1, 1, 0};
|
||||||
|
GVAR(torqueMagnitude) = "(50 + random 100) * selectRandom [1, -1]";
|
||||||
|
};
|
||||||
|
};
|
@ -117,7 +117,9 @@ addMissionEventHandler ["Draw3D", { // Blue is predicted before throw, red is re
|
|||||||
drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\icon_text\group_1_ca.paa", [0,0,1,1], _newTrajAGL, 1, 1, 0, "", 2];
|
drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\icon_text\group_1_ca.paa", [0,0,1,1], _newTrajAGL, 1, 1, 0, "", 2];
|
||||||
} forEach GVAR(predictedPath);
|
} forEach GVAR(predictedPath);
|
||||||
{
|
{
|
||||||
drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\icon_text\group_1_ca.paa", [1,0,0,1], _x, 1, 1, 0, "", 2];
|
_x params ["_pos", "_vectorUp"];
|
||||||
} forEach GVAR(flightPath)
|
drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\icon_text\group_1_ca.paa", [1,0,0,1], _pos, 1, 1, 0, "", 2];
|
||||||
|
drawLine3D [_pos, _pos vectorAdd _vectorUp, [1,0,1,1]];
|
||||||
|
} forEach GVAR(flightPath);
|
||||||
}];
|
}];
|
||||||
#endif
|
#endif
|
||||||
|
@ -15,5 +15,6 @@ class CfgPatches {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#include "ACE_Settings.hpp"
|
#include "ACE_Settings.hpp"
|
||||||
|
#include "CfgAmmo.hpp"
|
||||||
#include "CfgEventHandlers.hpp"
|
#include "CfgEventHandlers.hpp"
|
||||||
#include "CfgVehicles.hpp"
|
#include "CfgVehicles.hpp"
|
||||||
|
@ -67,7 +67,7 @@ for "_i" from 0.05 to 1.45 step 0.1 do {
|
|||||||
private _col = [ [1, 1, 1, _alpha], [0, 1, 0, _alpha], [1, 0, 0, _alpha], [1, 1, 0, _alpha] ] select _cross;
|
private _col = [ [1, 1, 1, _alpha], [0, 1, 0, _alpha], [1, 0, 0, _alpha], [1, 1, 0, _alpha] ] select _cross;
|
||||||
|
|
||||||
if (_cross != 2 && {lineIntersects [eyePos ACE_player, _newTrajASL]}) then {
|
if (_cross != 2 && {lineIntersects [eyePos ACE_player, _newTrajASL]}) then {
|
||||||
_col set [3, 0.1]
|
_col set [3, 0.1];
|
||||||
};
|
};
|
||||||
|
|
||||||
_pathData pushBack [_col, ASLToAGL _newTrajASL, _iDim];
|
_pathData pushBack [_col, ASLToAGL _newTrajASL, _iDim];
|
||||||
|
@ -49,9 +49,15 @@ if (!(_unit getVariable [QGVAR(primed), false])) then {
|
|||||||
_newVelocity = _newVelocity vectorAdd (velocity (vehicle _unit));
|
_newVelocity = _newVelocity vectorAdd (velocity (vehicle _unit));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private _config = configFile >> "CfgAmmo" >> typeOf _activeThrowable;
|
||||||
|
private _torqueDir = vectorNormalized (getArray (_config >> QGVAR(torqueDirection)));
|
||||||
|
private _torqueMag = getNumber (_config >> QGVAR(torqueMagnitude));
|
||||||
|
private _torque = _torqueDir vectorMultiply _torqueMag;
|
||||||
|
|
||||||
// Drop if unit dies during throw process
|
// Drop if unit dies during throw process
|
||||||
if (alive _unit) then {
|
if (alive _unit) then {
|
||||||
_activeThrowable setVelocity _newVelocity;
|
_activeThrowable setVelocity _newVelocity;
|
||||||
|
_activeThrowable addTorque (_unit vectorModelToWorld _torque);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Invoke listenable event
|
// Invoke listenable event
|
||||||
@ -67,12 +73,12 @@ if (!(_unit getVariable [QGVAR(primed), false])) then {
|
|||||||
|
|
||||||
|
|
||||||
#ifdef DRAW_THROW_PATH
|
#ifdef DRAW_THROW_PATH
|
||||||
GVAR(predictedPath) = call FUNC(drawArc); // save the current throw arc
|
GVAR(predictedPath) = call FUNC(drawArc); // Save the current throw arc
|
||||||
GVAR(flightPath) = [];
|
GVAR(flightPath) = [];
|
||||||
[_unit getVariable QGVAR(activeThrowable)] spawn {
|
GVAR(flightRotation) = [];
|
||||||
params ["_grenade"];
|
(_unit getVariable QGVAR(activeThrowable)) spawn {
|
||||||
while {!isNull _grenade} do {
|
while {!isNull _this && {(getPosATL _this) select 2 > 0.05}} do {
|
||||||
GVAR(flightPath) pushBack ASLtoAGL getPosASL _grenade;
|
GVAR(flightPath) pushBack [ASLtoAGL (getPosASL _this), vectorUp _this];
|
||||||
sleep 0.05;
|
sleep 0.05;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -148,7 +148,7 @@
|
|||||||
<Key ID="STR_ACE_Advanced_Throwing_Prepare">
|
<Key ID="STR_ACE_Advanced_Throwing_Prepare">
|
||||||
<English>Prepare/Change Throwable</English>
|
<English>Prepare/Change Throwable</English>
|
||||||
<Russian>Подготовить/заменить гранату</Russian>
|
<Russian>Подготовить/заменить гранату</Russian>
|
||||||
<Japanese>機能の起動/変更</Japanese>
|
<Japanese>投てき物の準備/変更</Japanese>
|
||||||
<Polish>Przygotuj/zmień ob. miotany</Polish>
|
<Polish>Przygotuj/zmień ob. miotany</Polish>
|
||||||
<German>Wurfobjekt vorbereiten/wechseln</German>
|
<German>Wurfobjekt vorbereiten/wechseln</German>
|
||||||
<Korean>투척물 준비/변경</Korean>
|
<Korean>투척물 준비/변경</Korean>
|
||||||
@ -172,7 +172,7 @@
|
|||||||
<Key ID="STR_ACE_Advanced_Throwing_DropModeToggle">
|
<Key ID="STR_ACE_Advanced_Throwing_DropModeToggle">
|
||||||
<English>Throwable Drop Mode (Toggle)</English>
|
<English>Throwable Drop Mode (Toggle)</English>
|
||||||
<Russian>Режим броска гранаты (переключить)</Russian>
|
<Russian>Режим броска гранаты (переключить)</Russian>
|
||||||
<Japanese>投てきモード (トグル)</Japanese>
|
<Japanese>投てきモード (切り替え)</Japanese>
|
||||||
<Polish>Tryb upuszczania ob. miotanego (przełącz)</Polish>
|
<Polish>Tryb upuszczania ob. miotanego (przełącz)</Polish>
|
||||||
<German>Wurfobjekt Fallmodus (umschalten)</German>
|
<German>Wurfobjekt Fallmodus (umschalten)</German>
|
||||||
<Korean>투척물 떨어뜨리기 모드(토글)</Korean>
|
<Korean>투척물 떨어뜨리기 모드(토글)</Korean>
|
||||||
|
18
addons/ai/CfgEventHandlers.hpp
Normal file
18
addons/ai/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
class Extended_PreStart_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_FILE(XEH_preStart));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class Extended_PreInit_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class Extended_PostInit_EventHandlers {
|
||||||
|
class ADDON {
|
||||||
|
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||||
|
};
|
||||||
|
};
|
3
addons/ai/XEH_PREP.hpp
Normal file
3
addons/ai/XEH_PREP.hpp
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
PREP(garrison);
|
||||||
|
PREP(unGarrison);
|
||||||
|
PREP(garrisonMove);
|
84
addons/ai/XEH_postInit.sqf
Normal file
84
addons/ai/XEH_postInit.sqf
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
[QGVAR(AISection), {
|
||||||
|
params [["_units", [], [[]]], ["_sections", [], [[]]], ["_bool", true, [true]]];
|
||||||
|
{
|
||||||
|
private _section = _x;
|
||||||
|
{
|
||||||
|
if (_bool) then {
|
||||||
|
_x enableAI _section;
|
||||||
|
} else {
|
||||||
|
_x disableAI _section;
|
||||||
|
};
|
||||||
|
LOG(format [ARR_4("XEH_postInit: %1 disableAI %2 | ID %3", _x, _section, clientOwner)]);
|
||||||
|
} foreach (_units select {local _x});
|
||||||
|
} foreach _sections
|
||||||
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
|
[QGVAR(unGarrison), FUNC(unGarrison)] call CBA_fnc_addEventHandler;
|
||||||
|
[QGVAR(doMove), {
|
||||||
|
params ["_unitsArray"];
|
||||||
|
{
|
||||||
|
_x params ["_unit", "_pos"];
|
||||||
|
//_unit doFollow leader _unit;
|
||||||
|
_unit setDestination [_pos, "LEADER PLANNED", true];
|
||||||
|
_unit doMove _pos;
|
||||||
|
LOG(format [ARR_4("XEH_postInit: %1 doMove %2 | ID %3", _unit, _pos, clientOwner)]);
|
||||||
|
} foreach _unitsArray
|
||||||
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
[QGVAR(setBehaviour), {
|
||||||
|
params ["_groupsArray", "_behaviour"];
|
||||||
|
{
|
||||||
|
_x params ["_group"];
|
||||||
|
_group setBehaviour _behaviour;
|
||||||
|
LOG(format [ARR_4("XEH_postInit: %1 setBehaviour %2 | ID %3", _group, _behaviour, clientOwner)]);
|
||||||
|
} foreach _groupsArray
|
||||||
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
[QGVAR(enableAttack), {
|
||||||
|
params ["_unitsArray", "_mode"];
|
||||||
|
{
|
||||||
|
_x params ["_unit"];
|
||||||
|
_unit enableAttack _mode;
|
||||||
|
LOG(format [ARR_4("XEH_postInit: %1 enableAttack %2 | ID %3", _unit, _mode, clientOwner)]);
|
||||||
|
} foreach _unitsArray
|
||||||
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
|
#ifdef DEBUG_MODE_FULL
|
||||||
|
addMissionEventHandler ["Draw3D", {
|
||||||
|
private _unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []];
|
||||||
|
|
||||||
|
{
|
||||||
|
_x params ["_unit", "_pos"];
|
||||||
|
|
||||||
|
switch true do {
|
||||||
|
case (surfaceIsWater (getPos _unit) && {surfaceIsWater _pos}) : {
|
||||||
|
for "_i" from 0 to 3 do {
|
||||||
|
drawLine3D [_unit modelToWorldVisualWorld [0,0,1], (AGLtoASL _pos), [1,0,0,1]];
|
||||||
|
};
|
||||||
|
drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], (AGLtoASL _pos), 0.75, 0.75, 0.75];
|
||||||
|
};
|
||||||
|
|
||||||
|
case (!surfaceIsWater (getPos _unit) && {!surfaceIsWater _pos}) : {
|
||||||
|
for "_i" from 0 to 3 do {
|
||||||
|
drawLine3D [_unit modelToWorldVisual [0,0,1], _pos, [1,0,0,1]];
|
||||||
|
};
|
||||||
|
drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], _pos, 0.75, 0.75, 0.75];
|
||||||
|
};
|
||||||
|
|
||||||
|
case (!surfaceIsWater (getPos _unit) && {surfaceIsWater _pos}) : {
|
||||||
|
for "_i" from 0 to 3 do {
|
||||||
|
drawLine3D [_unit modelToWorldVisual [0,0,1], (AGLToASL _pos), [1,0,0,1]];
|
||||||
|
};
|
||||||
|
drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], (AGLtoASL _pos), 0.75, 0.75, 0.75];
|
||||||
|
};
|
||||||
|
|
||||||
|
case (surfaceIsWater (getPos _unit) && {!surfaceIsWater _pos}) : {
|
||||||
|
for "_i" from 0 to 3 do {
|
||||||
|
drawLine3D [_unit modelToWorldVisualWorld [0,0,1], _pos, [1,0,0,1]];
|
||||||
|
};
|
||||||
|
drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], _pos, 0.75, 0.75, 0.75];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
} foreach _unitMoveList;
|
||||||
|
}];
|
||||||
|
#endif
|
9
addons/ai/XEH_preInit.sqf
Normal file
9
addons/ai/XEH_preInit.sqf
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
ADDON = false;
|
||||||
|
|
||||||
|
PREP_RECOMPILE_START;
|
||||||
|
#include "XEH_PREP.hpp"
|
||||||
|
PREP_RECOMPILE_END;
|
||||||
|
|
||||||
|
ADDON = true;
|
3
addons/ai/XEH_preStart.sqf
Normal file
3
addons/ai/XEH_preStart.sqf
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
#include "XEH_PREP.hpp"
|
@ -15,3 +15,4 @@ class CfgPatches {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#include "CfgWeapons.hpp"
|
#include "CfgWeapons.hpp"
|
||||||
|
#include "CfgEventHandlers.hpp"
|
||||||
|
278
addons/ai/functions/fnc_garrison.sqf
Normal file
278
addons/ai/functions/fnc_garrison.sqf
Normal file
@ -0,0 +1,278 @@
|
|||||||
|
/*
|
||||||
|
* Author: alganthe
|
||||||
|
* Garrison function used to garrison AI inside buildings.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: The building(s) nearest this position are used <POSITION>
|
||||||
|
* 1: Limit the building search to those type of building <ARRAY>
|
||||||
|
* 2: Units that will be garrisoned <ARRAY>
|
||||||
|
* 3: Radius to fill building(s) <SCALAR> (default: 50)
|
||||||
|
* 4: 0: even filling, 1: building by building, 2: random filling <SCALAR> (default: 0)
|
||||||
|
* 5: True to fill building(s) from top to bottom <BOOL> (default: false) (note: only works with filling mode 0 and 1)
|
||||||
|
* 6: Teleport units <BOOL> (default: false)
|
||||||
|
|
||||||
|
* Return Value:
|
||||||
|
* Units not garrisoned <ARRAY>
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [position, nil, [unit1, unit2, unit3, unitN], 200, 1, false, false] call ace_ai_fnc_garrison
|
||||||
|
*
|
||||||
|
* Public: Yes
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params [["_startingPos",[0,0,0], [[]], 3], ["_buildingTypes", ["Building"], [[]]], ["_unitsArray", [], [[]]], ["_fillingRadius", 50, [0]], ["_fillingType", 0, [0]], ["_topDownFilling", false, [true]], ["_teleport", false, [true]]];
|
||||||
|
|
||||||
|
TRACE_6("fnc_garrison: Start",_startingPos,_buldingTypes,count _unitsArray,_fillingRadius,_fillingTYpe,_topDownFilling);
|
||||||
|
|
||||||
|
_unitsArray = _unitsArray select {alive _x && {!isPlayer _x}};
|
||||||
|
|
||||||
|
if (_startingPos isEqualTo [0,0,0]) exitWith {
|
||||||
|
TRACE_1("fnc_garrison: StartingPos error",_startingPos);
|
||||||
|
[LSTRING(GarrisonInvalidPosition)] call EFUNC(common,displayTextStructured);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (count _unitsArray == 0 || {isNull (_unitsArray select 0)}) exitWith {
|
||||||
|
TRACE_1("fnc_garrison: Units error",_unitsArray);
|
||||||
|
[LSTRING(GarrisonNoUnits)] call EFUNC(common,displayTextStructured);
|
||||||
|
};
|
||||||
|
|
||||||
|
private _buildings = nearestObjects [_startingPos, _buildingTypes, ([_fillingRadius, 50] select (_fillingRadius < 50))];
|
||||||
|
if (_fillingRadius >= 50) then {
|
||||||
|
_buildings = [_buildings] call CBA_fnc_shuffle;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (count _buildings == 0) exitWith {
|
||||||
|
TRACE_1("fnc_garrison: Building error",_buildings);
|
||||||
|
[LSTRING(GarrisonNoBuilding)] call EFUNC(common,displayTextStructured);
|
||||||
|
};
|
||||||
|
|
||||||
|
private _buildingsIndex = [];
|
||||||
|
|
||||||
|
if (_topDownFilling) then {
|
||||||
|
{
|
||||||
|
private _buildingPos = _x buildingPos -1;
|
||||||
|
|
||||||
|
// Those reverse are necessary, as dumb as it is there's no better way to sort those subarrays in sqf
|
||||||
|
{
|
||||||
|
reverse _x;
|
||||||
|
} foreach _buildingPos;
|
||||||
|
|
||||||
|
_buildingPos sort false;
|
||||||
|
|
||||||
|
{
|
||||||
|
reverse _x;
|
||||||
|
} foreach _buildingPos;
|
||||||
|
|
||||||
|
_buildingsIndex pushBack _buildingPos;
|
||||||
|
} foreach _buildings;
|
||||||
|
} else {
|
||||||
|
{
|
||||||
|
_buildingsIndex pushBack (_x buildingPos -1);
|
||||||
|
} foreach _buildings;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Remove buildings without positions
|
||||||
|
{
|
||||||
|
_buildingsIndex deleteAt (_buildingsIndex find _x);
|
||||||
|
} foreach (_buildingsIndex select {count _x == 0});
|
||||||
|
|
||||||
|
//Remove positions units are already pathing to
|
||||||
|
_buildingsIndex = _buildingsIndex apply {
|
||||||
|
private _testedBuilding = _x;
|
||||||
|
|
||||||
|
_testedBuilding select {
|
||||||
|
private _testedPos = _x;
|
||||||
|
(({(_x select 1) isEqualTo _testedPos} count (missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []])) == 0)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Warn the user that there's not enough positions to place all units
|
||||||
|
private _count = 0;
|
||||||
|
{_count = _count + count _x} foreach _buildingsIndex;
|
||||||
|
if ( (count _unitsArray) - _count > 0) then {
|
||||||
|
TRACE_4("fnc_garrison: Not enough spots to place all units",_unitsArray,count _unitsArray,_count,((count _unitsArray) - _count > 0));
|
||||||
|
[LSTRING(GarrisonNotEnoughPos)] call EFUNC(common,displayTextStructured);
|
||||||
|
};
|
||||||
|
|
||||||
|
private _placedUnits = [];
|
||||||
|
private _unitMoveList = [];
|
||||||
|
|
||||||
|
// Force all units to un-garrison
|
||||||
|
[QGVAR(unGarrison), [_unitsArray], _unitsArray] call CBA_fnc_targetEvent;
|
||||||
|
|
||||||
|
private _fnc_comparePos = {
|
||||||
|
params ["_nearestUnits", "_pos"];
|
||||||
|
({
|
||||||
|
if (surfaceIsWater getPos _x) then {
|
||||||
|
floor ((getPosASL _x) select 2) == floor ((AGLtoASL _pos) select 2)
|
||||||
|
} else {
|
||||||
|
floor ((getPosATL _x) select 2) == floor (_pos select 2)
|
||||||
|
};
|
||||||
|
} count _nearestUnits) > 0
|
||||||
|
};
|
||||||
|
|
||||||
|
// Do the placement
|
||||||
|
switch (_fillingType) do {
|
||||||
|
|
||||||
|
// Even filling
|
||||||
|
case 0: {
|
||||||
|
|
||||||
|
while {count _unitsArray > 0} do {
|
||||||
|
if (count _buildingsIndex == 0) exitWith {};
|
||||||
|
private _building = _buildingsIndex select 0;
|
||||||
|
|
||||||
|
if (_building isEqualTo []) then {
|
||||||
|
LOG(format [ARR_2("fnc_garrison: Empty building array | removing building from buildingsIndex | %1 buildings remaining",count _buildingsIndex)]);
|
||||||
|
_buildingsIndex deleteAt 0;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
private _pos = _building select 0;
|
||||||
|
private _nearestUnits = (_pos nearEntities ["CAManBase", 2]);
|
||||||
|
LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits, {floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]);
|
||||||
|
|
||||||
|
if (count _nearestUnits > 0 && {[_nearestUnits, _pos] call _fnc_comparePos}) then {
|
||||||
|
LOG(format [ARR_2("fnc_garrison: Unit present | removing position | %1 positions remaining for this building",count (_buildingsIndex select (_buildingsIndex find _building)) - 1)]);
|
||||||
|
_buildingsIndex set [0, _building - [_pos]];
|
||||||
|
|
||||||
|
} else {
|
||||||
|
private _unit = _unitsArray select 0;
|
||||||
|
private _posSurface = surfaceIsWater _pos;
|
||||||
|
|
||||||
|
if (_teleport) then {
|
||||||
|
doStop _unit;
|
||||||
|
if (_posSurface) then {
|
||||||
|
_unit setPosASL (AGLtoASL _pos);
|
||||||
|
} else {
|
||||||
|
_unit setPosATL _pos;
|
||||||
|
};
|
||||||
|
|
||||||
|
} else {
|
||||||
|
_unitMoveList pushBack [_unit,[_pos, AGLToASL _pos] select (_posSurface)];
|
||||||
|
};
|
||||||
|
|
||||||
|
_placedUnits pushBack _unit;
|
||||||
|
_unitsArray deleteAt (_unitsArray find _unit);
|
||||||
|
_building deleteAt 0;
|
||||||
|
_buildingsIndex deleteAt 0;
|
||||||
|
_buildingsIndex pushBackUnique _building;
|
||||||
|
_unit setVariable [QGVAR(garrisonned), true, true];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// Building by building
|
||||||
|
case 1: {
|
||||||
|
|
||||||
|
while {count _unitsArray > 0} do {
|
||||||
|
if (count _buildingsIndex == 0) exitWith {};
|
||||||
|
private _building = _buildingsIndex select 0;
|
||||||
|
|
||||||
|
if (_building isEqualTo []) then {
|
||||||
|
LOG(format [ARR_2("fnc_garrison: empty building array | removing building from buildingsIndex | %1 buildings remaining",count _buildingsIndex)]);
|
||||||
|
_buildingsIndex deleteAt 0;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
private _pos = _building select 0;
|
||||||
|
private _nearestUnits = (_pos nearEntities ["CAManBase", 2]);
|
||||||
|
LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits, {floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]);
|
||||||
|
|
||||||
|
if (count _nearestUnits > 0 && {[_nearestUnits, _pos] call _fnc_comparePos}) then {
|
||||||
|
LOG(format [ARR_2("fnc_garrison: Unit present | removing position | %1 positions remaining for this building",count (_buildingsIndex select (_buildingsIndex find _building)) - 1)]);
|
||||||
|
_buildingsIndex set [0, _building - [_pos]];
|
||||||
|
|
||||||
|
} else {
|
||||||
|
private _unit = _unitsArray select 0;
|
||||||
|
private _posSurface = surfaceIsWater _pos;
|
||||||
|
|
||||||
|
if (_teleport) then {
|
||||||
|
doStop _unit;
|
||||||
|
if (_posSurface) then {
|
||||||
|
_unit setPosASL (AGLtoASL _pos);
|
||||||
|
} else {
|
||||||
|
_unit setPosATL _pos;
|
||||||
|
};
|
||||||
|
|
||||||
|
} else {
|
||||||
|
_unitMoveList pushBack [_unit,[_pos, AGLToASL _pos] select (_posSurface)];
|
||||||
|
};
|
||||||
|
|
||||||
|
_placedUnits pushBack _unit;
|
||||||
|
_unitsArray deleteAt (_unitsArray find _unit);
|
||||||
|
_buildingsIndex set [0, _building - [_pos]];
|
||||||
|
_unit setVariable [QGVAR(garrisonned), true, true];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// Random
|
||||||
|
case 2: {
|
||||||
|
|
||||||
|
while {count _unitsArray > 0} do {
|
||||||
|
if (count _buildingsIndex == 0) exitWith {};
|
||||||
|
private _building = selectRandom _buildingsIndex;
|
||||||
|
|
||||||
|
if (_building isEqualTo []) then {
|
||||||
|
LOG(format [ARR_2("fnc_garrison: empty building array | removing building from buildingsIndex | %1 buildings remaining",count _buildingsIndex)]);
|
||||||
|
_buildingsIndex deleteAt (_buildingsIndex find _building);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
private _pos = selectRandom _building;
|
||||||
|
private _nearestUnits = (_pos nearEntities ["CAManBase", 2]);
|
||||||
|
LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits, {floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]);
|
||||||
|
|
||||||
|
if (count _nearestUnits > 0 && {[_nearestUnits, _pos] call _fnc_comparePos}) then {
|
||||||
|
LOG(format [ARR_2("fnc_garrison: Unit present | removing position | %1 positions remaining for this building",count (_buildingsIndex select (_buildingsIndex find _building)) - 1)]);
|
||||||
|
_buildingsIndex set [(_buildingsIndex find _building), _building - [_pos]];
|
||||||
|
|
||||||
|
} else {
|
||||||
|
private _unit = _unitsArray select 0;
|
||||||
|
private _posSurface = surfaceIsWater _pos;
|
||||||
|
|
||||||
|
if (_teleport) then {
|
||||||
|
doStop _unit;
|
||||||
|
if (_posSurface) then {
|
||||||
|
_unit setPosASL (AGLtoASL _pos);
|
||||||
|
} else {
|
||||||
|
_unit setPosATL _pos;
|
||||||
|
};
|
||||||
|
|
||||||
|
} else {
|
||||||
|
_unitMoveList pushBack [_unit,[_pos, AGLToASL _pos] select (_posSurface)];
|
||||||
|
};
|
||||||
|
|
||||||
|
_placedUnits pushBack _unit;
|
||||||
|
_unitsArray deleteAt (_unitsArray find _unit);
|
||||||
|
_buildingsIndex set [(_buildingsIndex find _building), _building - [_pos]];
|
||||||
|
_unit setVariable [QGVAR(garrisonned), true, true];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
TRACE_1(format [ARR_2("fnc_garrison: while loop ended | %1 units ready to be treated by PFH",count _unitMoveList)], _teleport);
|
||||||
|
|
||||||
|
// Update the unit list and remove duplicate positions and units
|
||||||
|
private _garrison_unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []];
|
||||||
|
|
||||||
|
_garrison_unitMoveList = _garrison_unitMoveList select {
|
||||||
|
_x params ["_testedUnit", "_testedPos"];
|
||||||
|
({(_x select 0) isEqualTo _testedUnit} count _unitMoveList == 0)
|
||||||
|
};
|
||||||
|
|
||||||
|
_garrison_unitMoveList append _unitMoveList;
|
||||||
|
|
||||||
|
missionNameSpace setVariable [QGVAR(garrison_unitMoveList), _garrison_unitMoveList, true];
|
||||||
|
|
||||||
|
if (_teleport) then {
|
||||||
|
[QGVAR(AISection), [_placedUnits, ["PATH"], false], _placedUnits] call CBA_fnc_targetEvent;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
[_unitMoveList] call FUNC(garrisonMove);
|
||||||
|
};
|
||||||
|
|
||||||
|
TRACE_1(format [ARR_3("fnc_garrison: End | %1 units left | %2 buildings left", count _unitsArray, count _buildingsIndex)], _unitsArray);
|
||||||
|
_unitsArray
|
149
addons/ai/functions/fnc_garrisonMove.sqf
Normal file
149
addons/ai/functions/fnc_garrisonMove.sqf
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
/*
|
||||||
|
* Author: alganthe
|
||||||
|
* Internal function used by ace_ai_fnc_garrison to make the units move to the positions it picked.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Array of arrays <ARRAY>
|
||||||
|
* 0: Unit needing to be placed <UNIT>
|
||||||
|
* 1: Position the unit need to be placed at <POSITION>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [ [unit1, [10, 10, 10]], [unit2, [30, 30, 30]], [unitN, getPos player] ] call ace_ai_fnc_garrisonMove
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params [ ["_unitMoveList", nil, [[]]] ];
|
||||||
|
|
||||||
|
if (isNil "_unitMoveList") exitWith {};
|
||||||
|
|
||||||
|
// Start initial movement
|
||||||
|
private _unitMoveListUnits = (_unitMoveList apply {_x select 0});
|
||||||
|
[QGVAR(setBehaviour), [(_unitMoveListUnits select {leader _x == _x}), "AWARE"], _unitMoveListUnits] call CBA_fnc_targetEvent;
|
||||||
|
[QGVAR(AISection), [_unitMoveListUnits, ["FSM"], false], _unitMoveListUnits] call CBA_fnc_targetEvent;
|
||||||
|
[QGVAR(doMove), [_unitMoveList], _unitMoveListUnits] call CBA_fnc_targetEvent;
|
||||||
|
[QGVAR(enableAttack), [_unitMoveListUnits select {leader _x == _x}, false], _unitMoveListUnits] call CBA_fnc_targetEvent;
|
||||||
|
|
||||||
|
{
|
||||||
|
_x setVariable [QGVAR(garrisonMove_failSafe), nil, true];
|
||||||
|
_x setVariable [QGVAR(garrisonMove_unitPosMemory), nil, true];
|
||||||
|
} foreach _unitMoveListUnits;
|
||||||
|
|
||||||
|
// Avoid duplicate PFHs
|
||||||
|
if (isNil QGVAR(garrison_moveUnitPFH)) then {
|
||||||
|
missionNameSpace setVariable [QGVAR(garrison_moveUnitPFH), true, true];
|
||||||
|
|
||||||
|
// PFH checking if the units have reached their destination
|
||||||
|
[{
|
||||||
|
params ["_args", "_pfhID"];
|
||||||
|
|
||||||
|
private _unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []];
|
||||||
|
|
||||||
|
// End PFH if all units are placed / unable to reach position
|
||||||
|
if (_unitMoveList isEqualTo []) then {
|
||||||
|
missionNameSpace setVariable [QGVAR(garrison_moveUnitPFH), nil, true];
|
||||||
|
LOG("garrisonMove PFH: PFH finished it's job | deleting PFH");
|
||||||
|
_pfhID call CBA_fnc_removePerFrameHandler;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
{
|
||||||
|
_x params ["_unit", "_pos"];
|
||||||
|
|
||||||
|
// Check if unit is alive or even existing
|
||||||
|
if (!alive _unit) then {
|
||||||
|
_unitMoveList deleteAt (_unitMoveList find _x);
|
||||||
|
LOG(format [ARR_2("garrisonMove PFH: unit dead or deleted | %1 units left", count _unitMoveList)]);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
private _unitPos = getPos _unit;
|
||||||
|
if (surfaceisWater _unitPos) then {
|
||||||
|
_unitPos = getPosASL _unit;
|
||||||
|
} else {
|
||||||
|
_unitPos = getPosATL _unit;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (unitReady _unit) then {
|
||||||
|
// Check for distance, doMove and AI are moody and may stop for no reason, within 6 meters and ready should be fine
|
||||||
|
if (_unitPos distance _pos < 3) then {
|
||||||
|
_unit setVariable [QGVAR(garrisonMove_failSafe), nil, true];
|
||||||
|
_unit setVariable [QGVAR(garrisonMove_unitPosMemory), nil, true];
|
||||||
|
_unit setVariable [QGVAR(garrisonned), true, true];
|
||||||
|
_unitMoveList deleteAt (_unitMoveList find _x);
|
||||||
|
|
||||||
|
[QGVAR(AISection), [[_unit], ["PATH"], false], _unit] call CBA_fnc_targetEvent;
|
||||||
|
[QGVAR(AISection), [[_unit], ["FSM"], true], _unit] call CBA_fnc_targetEvent;
|
||||||
|
|
||||||
|
if ({(_x select 0) in units _unit && {!isPlayer (_x select 0)}} count _unitMoveList == 0) then {
|
||||||
|
[QGVAR(enableAttack), [[_unit], true], _unit] call CBA_fnc_targetEvent;
|
||||||
|
};
|
||||||
|
|
||||||
|
LOG(format [ARR_2("garrisonMove PFH: unit in position | %1 units left", count _unitMoveList)]);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Tell the unit to move if an order wasn't given within 30s, avoid doMove spam
|
||||||
|
(_unit getVariable [QGVAR(garrisonMove_failSafe), [CBA_missionTime, 5]]) params ["_failSafeTimer", "_failSafeRemainingAttemps"];
|
||||||
|
|
||||||
|
if (_failSafeTimer <= CBA_missionTime) then {
|
||||||
|
if (_failSafeRemainingAttemps == 0 ) then {
|
||||||
|
_unit setVariable [QGVAR(garrisonMove_failSafe), nil, true];
|
||||||
|
_unit setVariable [QGVAR(garrisonMove_unitPosMemory), nil, true];
|
||||||
|
[QGVAR(unGarrison), [[_unit]], _unit] call CBA_fnc_targetEvent;
|
||||||
|
_unitMoveList deleteAt (_unitMoveList find _x);
|
||||||
|
LOG("garrisonMove PFH unitReady: all moving commands failed | restoring AI capabilities");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
_unit setVariable [QGVAR(garrisonMove_failSafe), [_failSafeTimer + 15, _failSafeRemainingAttemps - 1]];
|
||||||
|
[QGVAR(doMove), [[[_unit, _pos]]], _unit] call CBA_fnc_targetEvent;
|
||||||
|
LOG("garrisonMove PFH unitReady: unit not close enough | Sending another doMove command");
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
(_unit getVariable [QGVAR(garrisonMove_unitPosMemory), [CBA_missionTime, [0,0,0]]]) params ["_unitPosTimer", "_unitOldPos"];
|
||||||
|
|
||||||
|
// AI may sometimes not be able to report unitReady, this is to avoid the PFH running forever
|
||||||
|
switch true do {
|
||||||
|
case ((_unitPosTimer + 15) < CBA_missionTime && {(_unitPos distance _pos) < 3}) : {
|
||||||
|
TRACE_1("case 1",_unit);
|
||||||
|
_unit setVariable [QGVAR(garrisonMove_failSafe), nil, true];
|
||||||
|
_unit setVariable [QGVAR(garrisonMove_unitPosMemory), nil, true];
|
||||||
|
_unit setVariable [QGVAR(garrisonned), true, true];
|
||||||
|
_unitMoveList deleteAt (_unitMoveList find _x);
|
||||||
|
|
||||||
|
[QGVAR(AISection), [[_unit], ["PATH"], false], _unit] call CBA_fnc_targetEvent;
|
||||||
|
[QGVAR(AISection), [[_unit], ["FSM"], true], _unit] call CBA_fnc_targetEvent;
|
||||||
|
|
||||||
|
if ({(_x select 0) in units _unit && {!isPlayer (_x select 0)}} count _unitMoveList == 0) then {
|
||||||
|
[QGVAR(enableAttack), [[_unit], true], _unit] call CBA_fnc_targetEvent;
|
||||||
|
};
|
||||||
|
|
||||||
|
LOG(format [ARR_2("garrisonMove PFH unitNotReady: unit in position | %1 units left", count _unitMoveList)]);
|
||||||
|
};
|
||||||
|
|
||||||
|
case ((_unitPosTimer + 15) < CBA_missionTime && {_unitOldPos distance _unitPos < 0.5}) : {
|
||||||
|
TRACE_3("case 2",_unit, ((_unitPosTimer + 15) < CBA_missionTime), (_unitOldPos distance _unitPos < 0.5));
|
||||||
|
_unit setVariable [QGVAR(garrisonMove_failSafe), nil, true];
|
||||||
|
_unit setVariable [QGVAR(garrisonMove_unitPosMemory), nil, true];
|
||||||
|
[QGVAR(unGarrison), [[_unit]], _unit] call CBA_fnc_targetEvent;
|
||||||
|
_unitMoveList deleteAt (_unitMoveList find _x);
|
||||||
|
LOG("garrisonMove PFH unitNotReady: all moving commands failed | restoring AI capabilities");
|
||||||
|
};
|
||||||
|
|
||||||
|
case (_unitOldPos distance _unitPos < 0.5) : {};
|
||||||
|
|
||||||
|
default {
|
||||||
|
_unit setVariable [QGVAR(garrisonMove_unitPosMemory), [CBA_missionTime, _unitPos]];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
} foreach _unitMoveList;
|
||||||
|
|
||||||
|
missionNameSpace setVariable [QGVAR(garrison_unitMoveList), _unitMoveList, true];
|
||||||
|
};
|
||||||
|
}, 0.5, []] call CBA_fnc_addPerFrameHandler;
|
||||||
|
};
|
57
addons/ai/functions/fnc_unGarrison.sqf
Normal file
57
addons/ai/functions/fnc_unGarrison.sqf
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* Author: alganthe
|
||||||
|
* Used to un-garrison units.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Units to un-garrison <ARRAY>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [unit1, unit2, unit3] call ace_ai_fnc_unGarrison
|
||||||
|
*
|
||||||
|
* Public: Yes
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params [["_units", [], [[]]]];
|
||||||
|
|
||||||
|
_units = _units select {local _x};
|
||||||
|
|
||||||
|
{
|
||||||
|
if (!isPlayer _x && {local _x}) then {
|
||||||
|
_x enableAI "PATH";
|
||||||
|
_x enableAI "FSM";
|
||||||
|
|
||||||
|
private _leader = leader _x;
|
||||||
|
|
||||||
|
TRACE_3("fnc_ungarrison: unit and leader",_x , _leader, (_leader == _x));
|
||||||
|
|
||||||
|
_x setVariable [QGVAR(garrisonned), false, true];
|
||||||
|
|
||||||
|
if (_leader != _x) then {
|
||||||
|
doStop _x;
|
||||||
|
_x doFollow _leader;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
_x doMove ((nearestBuilding (getPos _x)) buildingExit 0);
|
||||||
|
};
|
||||||
|
|
||||||
|
private _fnc_countGarrisonnedUnits = {
|
||||||
|
params ["_unit", "_bool"];
|
||||||
|
if (_bool) then {
|
||||||
|
({(_x getVariable [QGVAR(garrisonned), false]) && {!isPlayer _x}} count units _unit)
|
||||||
|
} else {
|
||||||
|
({!(_x getVariable [QGVAR(garrisonned), false]) && {!isPlayer _x}} count units _unit)
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
if ([_x, true] call _fnc_countGarrisonnedUnits == ({!isPlayer _x} count (units _x)) - 1 || {[_x, false] call _fnc_countGarrisonnedUnits == {!isPlayer _x} count (units _x)}) then {
|
||||||
|
LOG("fnc_ungarrison: enableAttack true");
|
||||||
|
(group _x) enableAttack true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
} foreach _units;
|
1
addons/ai/functions/script_component.hpp
Normal file
1
addons/ai/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "\z\ace\addons\ai\script_component.hpp"
|
@ -2,8 +2,8 @@
|
|||||||
#define COMPONENT_BEAUTIFIED AI
|
#define COMPONENT_BEAUTIFIED AI
|
||||||
#include "\z\ace\addons\main\script_mod.hpp"
|
#include "\z\ace\addons\main\script_mod.hpp"
|
||||||
|
|
||||||
// #define DEBUG_MODE_FULL
|
//#define DEBUG_MODE_FULL
|
||||||
// #define DISABLE_COMPILE_CACHE
|
//#define DISABLE_COMPILE_CACHE
|
||||||
// #define ENABLE_PERFORMANCE_COUNTERS
|
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||||
|
|
||||||
#ifdef DEBUG_ENABLED_AI
|
#ifdef DEBUG_ENABLED_AI
|
||||||
|
37
addons/ai/stringtable.xml
Normal file
37
addons/ai/stringtable.xml
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project name="ACE">
|
||||||
|
<Package name="ai">
|
||||||
|
<Key ID="STR_ACE_ai_GarrisonInvalidPosition">
|
||||||
|
<English>Invalid position provided.</English>
|
||||||
|
<French>Position invalide fourni</French>
|
||||||
|
<Japanese>位置が無効です。</Japanese>
|
||||||
|
<Italian>Posizione invalida fornita.</Italian>
|
||||||
|
<Chinese>提供的位置無效。</Chinese>
|
||||||
|
<Chinesesimp>提供的位置无效。</Chinesesimp>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_ai_GarrisonNoUnits">
|
||||||
|
<English>No units provided.</English>
|
||||||
|
<French>Aucune unité fourni</French>
|
||||||
|
<Japanese>ユニットがありません。</Japanese>
|
||||||
|
<Italian>Nessuna unità fornita.</Italian>
|
||||||
|
<Chinese>找不到可用的單位。</Chinese>
|
||||||
|
<Chinesesimp>找不到可用的单位。</Chinesesimp>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_ai_GarrisonNotEnoughPos">
|
||||||
|
<English>There aren't enough positions to place all units.</English>
|
||||||
|
<French>Il n'y a pas assez de positions pour placer toutes les unités</French>
|
||||||
|
<Japanese>全ユニットを置くために十分な位置がありません。</Japanese>
|
||||||
|
<Italian>Non ci sono abbastanza posizioni per piazzare tutte le unità.</Italian>
|
||||||
|
<Chinese>沒有足夠的位置能擺放所有單位。</Chinese>
|
||||||
|
<Chinesesimp>没有足够的位置能摆放所有单位。</Chinesesimp>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_ai_GarrisonNoBuilding">
|
||||||
|
<English>No building found.</English>
|
||||||
|
<French>Aucun bâtiment trouvé</French>
|
||||||
|
<Japanese>建物がありません。</Japanese>
|
||||||
|
<Italian>Nessun edificio trovato.</Italian>
|
||||||
|
<Chinese>沒找到建築物。</Chinese>
|
||||||
|
<Chinesesimp>没找到建筑物。</Chinesesimp>
|
||||||
|
</Key>
|
||||||
|
</Package>
|
||||||
|
</Project>
|
@ -29,7 +29,8 @@ private _distance = 0;
|
|||||||
while {_velocity > _thresholdVelocity} do {
|
while {_velocity > _thresholdVelocity} do {
|
||||||
private _bc = GVAR(targetSolutionInput) select 14;
|
private _bc = GVAR(targetSolutionInput) select 14;
|
||||||
private _dragModel = GVAR(targetSolutionInput) select 15;
|
private _dragModel = GVAR(targetSolutionInput) select 15;
|
||||||
private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3", _dragModel, _bc, _velocity]));
|
private _temperature = GVAR(targetSolutionInput) select 5;
|
||||||
|
private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3:%4", _dragModel, _bc, _velocity, _temperature]));
|
||||||
_distance = _distance + _velocity * __DELTA_T;
|
_distance = _distance + _velocity * __DELTA_T;
|
||||||
_velocity = _velocity - (_drag * __DELTA_T);
|
_velocity = _velocity - (_drag * __DELTA_T);
|
||||||
};
|
};
|
||||||
|
@ -51,37 +51,34 @@ params [
|
|||||||
];
|
];
|
||||||
_windSpeed params ["_windSpeed1", "_windSpeed2"];
|
_windSpeed params ["_windSpeed1", "_windSpeed2"];
|
||||||
|
|
||||||
private ["_tx", "_tz", "_lastBulletPos", "_bulletPos", "_bulletVelocity", "_bulletAccel", "_bulletSpeed", "_gravity", "_deltaT"];
|
private _tx = 0;
|
||||||
_tx = 0;
|
private _tz = 0;
|
||||||
_tz = 0;
|
private _lastBulletPos = [0, 0, 0];
|
||||||
_lastBulletPos = [0, 0, 0];
|
private _bulletPos = [0, 0, 0];
|
||||||
_bulletPos = [0, 0, 0];
|
private _bulletVelocity = [0, 0, 0];
|
||||||
_bulletVelocity = [0, 0, 0];
|
private _bulletAccel = [0, 0, 0];
|
||||||
_bulletAccel = [0, 0, 0];
|
private _bulletSpeed = 0;
|
||||||
_bulletSpeed = 0;
|
private _gravity = [0, sin(_scopeBaseAngle + _inclinationAngle) * -9.80665, cos(_scopeBaseAngle + _inclinationAngle) * -9.80665];
|
||||||
_gravity = [0, sin(_scopeBaseAngle + _inclinationAngle) * -9.80665, cos(_scopeBaseAngle + _inclinationAngle) * -9.80665];
|
private _deltaT = 1 / _simSteps;
|
||||||
_deltaT = 1 / _simSteps;
|
|
||||||
|
|
||||||
private ["_elevation", "_windage1", "_windage2", "_lead", "_TOF", "_trueVelocity", "_trueSpeed", "_kineticEnergy", "_verticalCoriolis", "_verticalDeflection", "_horizontalCoriolis", "_horizontalDeflection", "_spinDrift", "_spinDeflection"];
|
private _elevation = 0;
|
||||||
_elevation = 0;
|
private _windage1 = 0;
|
||||||
_windage1 = 0;
|
private _windage2 = 0;
|
||||||
_windage2 = 0;
|
private _lead = 0;
|
||||||
_lead = 0;
|
private _TOF = 0;
|
||||||
_TOF = 0;
|
private _trueVelocity = [0, 0, 0];
|
||||||
_trueVelocity = [0, 0, 0];
|
private _trueSpeed = 0;
|
||||||
_trueSpeed = 0;
|
private _verticalCoriolis = 0;
|
||||||
_verticalCoriolis = 0;
|
private _verticalDeflection = 0;
|
||||||
_verticalDeflection = 0;
|
private _horizontalCoriolis = 0;
|
||||||
_horizontalCoriolis = 0;
|
private _horizontalDeflection = 0;
|
||||||
_horizontalDeflection = 0;
|
private _spinDrift = 0;
|
||||||
_spinDrift = 0;
|
private _spinDeflection = 0;
|
||||||
_spinDeflection = 0;
|
|
||||||
|
|
||||||
private ["_n", "_range", "_trueRange", "_rangeFactor"];
|
private _n = 0;
|
||||||
_n = 0;
|
private _range = 0;
|
||||||
_range = 0;
|
private _trueRange = 0;
|
||||||
_trueRange = 0;
|
private _rangeFactor = 1;
|
||||||
_rangeFactor = 1;
|
|
||||||
if (_storeRangeCardData) then {
|
if (_storeRangeCardData) then {
|
||||||
if (GVAR(currentUnit) == 1) then {
|
if (GVAR(currentUnit) == 1) then {
|
||||||
_rangeFactor = 1.0936133;
|
_rangeFactor = 1.0936133;
|
||||||
@ -89,16 +86,14 @@ if (_storeRangeCardData) then {
|
|||||||
GVAR(rangeCardData) = [];
|
GVAR(rangeCardData) = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
private ["_wind1", "_wind2", "_windDrift"];
|
private _wind1 = [cos(270 - _windDirection * 30) * _windSpeed1, sin(270 - _windDirection * 30) * _windSpeed1, 0];
|
||||||
_wind1 = [cos(270 - _windDirection * 30) * _windSpeed1, sin(270 - _windDirection * 30) * _windSpeed1, 0];
|
private _wind2 = [cos(270 - _windDirection * 30) * _windSpeed2, sin(270 - _windDirection * 30) * _windSpeed2, 0];
|
||||||
_wind2 = [cos(270 - _windDirection * 30) * _windSpeed2, sin(270 - _windDirection * 30) * _windSpeed2, 0];
|
private _windDrift = 0;
|
||||||
_windDrift = 0;
|
|
||||||
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
|
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
|
||||||
_bc = parseNumber(("ace_advanced_ballistics" callExtension format["atmosphericCorrection:%1:%2:%3:%4:%5", _bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel]));
|
_bc = parseNumber(("ace_advanced_ballistics" callExtension format["atmosphericCorrection:%1:%2:%3:%4:%5", _bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel]));
|
||||||
};
|
};
|
||||||
|
|
||||||
private ["_eoetvoesMultiplier"];
|
private _eoetvoesMultiplier = 0;
|
||||||
_eoetvoesMultiplier = 0;
|
|
||||||
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
|
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
|
||||||
_eoetvoesMultiplier = 2 * (0.0000729 * _muzzleVelocity / -9.80665) * cos(_latitude) * sin(_directionOfFire);
|
_eoetvoesMultiplier = 2 * (0.0000729 * _muzzleVelocity / -9.80665) * cos(_latitude) * sin(_directionOfFire);
|
||||||
};
|
};
|
||||||
@ -118,7 +113,7 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do {
|
|||||||
_trueSpeed = vectorMagnitude _trueVelocity;
|
_trueSpeed = vectorMagnitude _trueVelocity;
|
||||||
|
|
||||||
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
|
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
|
||||||
private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3", _dragModel, _bc, _trueSpeed]));
|
private _drag = parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3:%4", _dragModel, _bc, _trueSpeed, _temperature]));
|
||||||
_bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (-1 * _drag);
|
_bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (-1 * _drag);
|
||||||
} else {
|
} else {
|
||||||
_bulletAccel = _trueVelocity vectorMultiply (_trueSpeed * _airFriction);
|
_bulletAccel = _trueVelocity vectorMultiply (_trueSpeed * _airFriction);
|
||||||
@ -144,7 +139,7 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do {
|
|||||||
_windage1 = - atan(_tx / _trueRange);
|
_windage1 = - atan(_tx / _trueRange);
|
||||||
_windDrift = (_wind2 select 0) * (_TOF - _trueRange / _muzzleVelocity);
|
_windDrift = (_wind2 select 0) * (_TOF - _trueRange / _muzzleVelocity);
|
||||||
_windage2 = - atan(_windDrift / _trueRange);
|
_windage2 = - atan(_windDrift / _trueRange);
|
||||||
_lead = (_targetSpeed * _TOF) / (Tan(3.38 / 60) * _trueRange);
|
_lead = (_targetSpeed * _TOF) / (Tan(MRAD_TO_DEG(1)) * _trueRange);
|
||||||
};
|
};
|
||||||
_kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2));
|
_kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2));
|
||||||
_kineticEnergy = _kineticEnergy * 0.737562149;
|
_kineticEnergy = _kineticEnergy * 0.737562149;
|
||||||
@ -179,7 +174,7 @@ if (_targetRange != 0) then {
|
|||||||
_windage1 = - atan(_tx / _targetRange);
|
_windage1 = - atan(_tx / _targetRange);
|
||||||
_windDrift = (_wind2 select 0) * (_TOF - _targetRange / _muzzleVelocity);
|
_windDrift = (_wind2 select 0) * (_TOF - _targetRange / _muzzleVelocity);
|
||||||
_windage2 = - atan(_windDrift / _targetRange);
|
_windage2 = - atan(_windDrift / _targetRange);
|
||||||
_lead = (_targetSpeed * _TOF) / (Tan(3.38 / 60) * _targetRange);
|
_lead = (_targetSpeed * _TOF) / (Tan(MRAD_TO_DEG(1)) * _targetRange);
|
||||||
};
|
};
|
||||||
|
|
||||||
_kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2));
|
_kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2));
|
||||||
|
@ -17,21 +17,19 @@
|
|||||||
|
|
||||||
[] call FUNC(parse_input);
|
[] call FUNC(parse_input);
|
||||||
|
|
||||||
private ["_scopeBaseAngle"];
|
private _scopeBaseAngle = (GVAR(workingMemory) select 3);
|
||||||
_scopeBaseAngle = (GVAR(workingMemory) select 3);
|
|
||||||
|
|
||||||
private ["_bulletMass", "_bulletDiameter", "_boreHeight", "_airFriction", "_barrelTwist", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel", "_twistDirection"];
|
private _bulletMass = GVAR(workingMemory) select 12;
|
||||||
_bulletMass = GVAR(workingMemory) select 12;
|
private _bulletDiameter = GVAR(workingMemory) select 13;
|
||||||
_bulletDiameter = GVAR(workingMemory) select 13;
|
private _boreHeight = GVAR(workingMemory) select 5;
|
||||||
_boreHeight = GVAR(workingMemory) select 5;
|
private _airFriction = GVAR(workingMemory) select 4;
|
||||||
_airFriction = GVAR(workingMemory) select 4;
|
private _barrelTwist = GVAR(workingMemory) select 14;
|
||||||
_barrelTwist = GVAR(workingMemory) select 14;
|
private _muzzleVelocity = GVAR(workingMemory) select 1;
|
||||||
_muzzleVelocity = GVAR(workingMemory) select 1;
|
private _bc = GVAR(workingMemory) select 15;
|
||||||
_bc = GVAR(workingMemory) select 15;
|
private _dragModel = GVAR(workingMemory) select 16;
|
||||||
_dragModel = GVAR(workingMemory) select 16;
|
private _atmosphereModel = GVAR(workingMemory) select 17;
|
||||||
_atmosphereModel = GVAR(workingMemory) select 17;
|
|
||||||
|
|
||||||
_twistDirection = 0;
|
private _twistDirection = 0;
|
||||||
if (_barrelTwist > 0) then {
|
if (_barrelTwist > 0) then {
|
||||||
_twistDirection = 1;
|
_twistDirection = 1;
|
||||||
} else {
|
} else {
|
||||||
@ -41,34 +39,31 @@ if (_barrelTwist > 0) then {
|
|||||||
};
|
};
|
||||||
_barrelTwist = abs(_barrelTwist);
|
_barrelTwist = abs(_barrelTwist);
|
||||||
|
|
||||||
private ["_altitude", "_temperature", "_barometricPressure", "_relativeHumidity"];
|
private _altitude = GVAR(altitude);
|
||||||
_altitude = GVAR(altitude);
|
private _temperature = GVAR(temperature);
|
||||||
_temperature = GVAR(temperature);
|
private _barometricPressure = GVAR(barometricPressure);
|
||||||
_barometricPressure = GVAR(barometricPressure);
|
private _relativeHumidity = GVAR(relativeHumidity);
|
||||||
_relativeHumidity = GVAR(relativeHumidity);
|
|
||||||
if (!GVAR(atmosphereModeTBH)) then {
|
if (!GVAR(atmosphereModeTBH)) then {
|
||||||
_barometricPressure = 1013.25 * (1 - (0.0065 * _altitude) / (273.15 + _temperature + 0.0065 * _altitude)) ^ 5.255754495;
|
_barometricPressure = 1013.25 * (1 - (0.0065 * _altitude) / (273.15 + _temperature + 0.0065 * _altitude)) ^ 5.255754495;
|
||||||
_relativeHumidity = 0.5;
|
_relativeHumidity = 0.5;
|
||||||
};
|
};
|
||||||
|
|
||||||
private ["_bulletLength", "_stabilityFactor"];
|
private _bulletLength = 50 * _bulletMass / ((_bulletDiameter/2)^2);
|
||||||
_bulletLength = 50 * _bulletMass / ((_bulletDiameter/2)^2);
|
private _stabilityFactor = 1.5;
|
||||||
_stabilityFactor = 1.5;
|
|
||||||
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
|
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
|
||||||
if (_bulletDiameter > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then {
|
if (_bulletDiameter > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then {
|
||||||
_stabilityFactor = [_bulletDiameter, _bulletLength, _bulletMass, _barrelTwist * 10, _muzzleVelocity, _temperature, _barometricPressure] call EFUNC(advanced_ballistics,calculateStabilityFactor);
|
_stabilityFactor = [_bulletDiameter, _bulletLength, _bulletMass, _barrelTwist * 10, _muzzleVelocity, _temperature, _barometricPressure] call EFUNC(advanced_ballistics,calculateStabilityFactor);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
private ["_latitude", "_directionOfFire", "_windSpeed1", "_windSpeed2", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange"];
|
private _latitude = GVAR(latitude) select GVAR(currentTarget);
|
||||||
_latitude = GVAR(latitude) select GVAR(currentTarget);
|
private _directionOfFire = GVAR(directionOfFire) select GVAR(currentTarget);
|
||||||
_directionOfFire = GVAR(directionOfFire) select GVAR(currentTarget);
|
private _windSpeed1 = GVAR(windSpeed1) select GVAR(currentTarget);
|
||||||
_windSpeed1 = GVAR(windSpeed1) select GVAR(currentTarget);
|
private _windSpeed2 = GVAR(windSpeed2) select GVAR(currentTarget);
|
||||||
_windSpeed2 = GVAR(windSpeed2) select GVAR(currentTarget);
|
private _windDirection = GVAR(windDirection) select GVAR(currentTarget);
|
||||||
_windDirection = GVAR(windDirection) select GVAR(currentTarget);
|
private _inclinationAngle = GVAR(inclinationAngle) select GVAR(currentTarget);
|
||||||
_inclinationAngle = GVAR(inclinationAngle) select GVAR(currentTarget);
|
private _targetSpeed = GVAR(targetSpeed) select GVAR(currentTarget);
|
||||||
_targetSpeed = GVAR(targetSpeed) select GVAR(currentTarget);
|
private _targetRange = GVAR(targetRange) select GVAR(currentTarget);
|
||||||
_targetRange = GVAR(targetRange) select GVAR(currentTarget);
|
|
||||||
|
|
||||||
GVAR(targetSolutionInput) = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, round(_muzzleVelocity),
|
GVAR(targetSolutionInput) = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, round(_muzzleVelocity),
|
||||||
[_windSpeed1, _windSpeed2], _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, false, _stabilityFactor, _twistDirection, _latitude, _directionOfFire];
|
[_windSpeed1, _windSpeed2], _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, false, _stabilityFactor, _twistDirection, _latitude, _directionOfFire];
|
||||||
|
@ -15,12 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_targetRange", "_numTicks", "_timeSecs", "_estSpeed"];
|
private _targetRange = parseNumber(ctrlText 8004);
|
||||||
|
private _numTicks = parseNumber(ctrlText 8005);
|
||||||
_targetRange = parseNumber(ctrlText 8004);
|
private _timeSecs = parseNumber(ctrlText 8006);
|
||||||
_numTicks = parseNumber(ctrlText 8005);
|
private _estSpeed = 0;
|
||||||
_timeSecs = parseNumber(ctrlText 8006);
|
|
||||||
_estSpeed = 0;
|
|
||||||
|
|
||||||
if (GVAR(currentUnit) == 1) then {
|
if (GVAR(currentUnit) == 1) then {
|
||||||
_targetRange = _targetRange / 1.0936133;
|
_targetRange = _targetRange / 1.0936133;
|
||||||
|
@ -46,8 +46,8 @@ if (_parseInput) then {
|
|||||||
};
|
};
|
||||||
switch (_dropUnit) do {
|
switch (_dropUnit) do {
|
||||||
case 0: {
|
case 0: {
|
||||||
_transonicDrop = _transonicDrop * 3.38;
|
_transonicDrop = MRAD_TO_MOA(_transonicDrop);
|
||||||
_subsonicDrop = _subsonicDrop * 3.38;
|
_subsonicDrop = MRAD_TO_MOA(_subsonicDrop);
|
||||||
};
|
};
|
||||||
case 2: {
|
case 2: {
|
||||||
_transonicDrop = _transonicDrop / 1.047;
|
_transonicDrop = _transonicDrop / 1.047;
|
||||||
|
@ -51,7 +51,7 @@ GVAR(atmosphereModeTBH) = true;
|
|||||||
GVAR(altitude) = 0;
|
GVAR(altitude) = 0;
|
||||||
GVAR(temperature) = 15;
|
GVAR(temperature) = 15;
|
||||||
GVAR(barometricPressure) = 1013.25;
|
GVAR(barometricPressure) = 1013.25;
|
||||||
GVAR(relativeHumidity) = 0.5;
|
GVAR(relativeHumidity) = 0.0;
|
||||||
|
|
||||||
GVAR(latitude) = [38, 38, 38, 38];
|
GVAR(latitude) = [38, 38, 38, 38];
|
||||||
GVAR(directionOfFire) = [0, 0, 0, 0];
|
GVAR(directionOfFire) = [0, 0, 0, 0];
|
||||||
|
@ -32,51 +32,51 @@ if ((profileNamespace getVariable ["ACE_ATragMX_profileNamespaceVersion", 0]) ==
|
|||||||
if (_resetGunList) then {
|
if (_resetGunList) then {
|
||||||
WARNING("Reseting Profile Gunlist");
|
WARNING("Reseting Profile Gunlist");
|
||||||
// Profile Name, Muzzle Velocity, Zero Range, Scope Base Angle, AirFriction, Bore Height, Scope Unit, Scope Click Unit, Scope Click Number, Maximum Elevation, Dialed Elevation, Dialed Windage, Mass, Bullet Diameter, Rifle Twist, BC, Drag Model, Atmosphere Model, Muzzle Velocity vs. Temperature Interpolation, C1 Ballistic Coefficient vs. Distance Interpolation, Persistent
|
// Profile Name, Muzzle Velocity, Zero Range, Scope Base Angle, AirFriction, Bore Height, Scope Unit, Scope Click Unit, Scope Click Number, Maximum Elevation, Dialed Elevation, Dialed Windage, Mass, Bullet Diameter, Rifle Twist, BC, Drag Model, Atmosphere Model, Muzzle Velocity vs. Temperature Interpolation, C1 Ballistic Coefficient vs. Distance Interpolation, Persistent
|
||||||
GVAR(gunList) = [["12.7x108mm" , 812, 100, 0.0666557, -0.00063800, 3.81, 0, 2, 10, 120, 0, 0, 48.28, 12.7, 38.10, 0.630, 1, "ASM" , [[-15,793],[0,800],[10,807],[15,812],[25,826],[30,835],[35,846]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
GVAR(gunList) = [["12.7x108mm" , 812, 100, 0.0958029, -0.00063800, 8.89, 0, 2, 10, 120, 0, 0, 48.28, 12.7, 38.10, 0.630, 1, "ASM" , [[-15,793],[0,800],[10,807],[15,812],[25,826],[30,835],[35,846]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
|
|
||||||
["12.7x99mm AMAX" , 852, 100, 0.0615965, -0.00036645, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 38.10, 1.050, 1, "ASM" , [[-15,833],[0,840],[10,847],[15,852],[25,866],[30,875],[35,886]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["12.7x99mm AMAX" , 852, 100, 0.0907214, -0.00037397, 8.89, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 38.10, 1.050, 1, "ASM" , [[-15,833],[0,840],[10,847],[15,852],[25,866],[30,875],[35,886]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
["12.7x99mm" , 892, 100, 0.0588284, -0.00057503, 3.81, 0, 2, 10, 120, 0, 0, 41.92, 12.7, 38.10, 0.670, 1, "ASM" , [[-15,873],[0,880],[10,887],[15,892],[25,906],[30,915],[35,926]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["12.7x99mm" , 892, 100, 0.0879633, -0.00058679, 8.89, 0, 2, 10, 120, 0, 0, 41.92, 12.7, 38.10, 0.670, 1, "ASM" , [[-15,873],[0,880],[10,887],[15,892],[25,906],[30,915],[35,926]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
|
|
||||||
["12.7x54mm" , 299, 100, 0.3406920, -0.00019268, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 24.13, 1.050, 1, "ASM" , [[-15,297],[0,298],[10,299],[15,299],[25,301],[30,302],[35,303]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["12.7x54mm" , 299, 100, 0.3567550, -0.00019568, 6.60, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 24.13, 1.050, 1, "ASM" , [[-15,297],[0,298],[10,299],[15,299],[25,301],[30,302],[35,303]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
|
|
||||||
[".50 Beowulf" , 562, 100, 0.1262000, -0.00202645, 3.81, 0, 2, 10, 120, 0, 0, 21.71, 12.7, 50.80, 0.210, 1, "ASM" , [[-15,560],[0,561],[10,562],[15,562],[25,564],[30,565],[35,566]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
[".50 Beowulf" , 562, 100, 0.1425100, -0.00205896, 6.60, 0, 2, 10, 120, 0, 0, 21.71, 12.7, 50.80, 0.210, 1, "ASM" , [[-15,560],[0,561],[10,562],[15,562],[25,564],[30,565],[35,566]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
|
|
||||||
[".408 CheyTac 305gr", 1059, 100, 0.0482146, -0.00063655, 3.81, 0, 2, 10, 120, 0, 0, 19.76, 10.4, 33.02, 0.569, 1, "ICAO", [[-15,1040],[0,1047],[10,1054],[15,1059],[25,1073],[30,1082],[35,1093]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
[".408 CheyTac 305gr", 1059, 100, 0.0686329, -0.00065414, 7.37, 0, 2, 10, 120, 0, 0, 19.76, 10.4, 33.02, 0.569, 1, "ICAO", [[-15,1040],[0,1047],[10,1054],[15,1059],[25,1073],[30,1082],[35,1093]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
[".408 CheyTac 419gr", 859, 100, 0.0611842, -0.00044958, 3.81, 0, 2, 10, 120, 0, 0, 27.15, 10.4, 33.02, 0.866, 1, "ICAO", [[-15,840],[0,847],[10,854],[15,859],[25,873],[30,882],[35,893]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
[".408 CheyTac 419gr", 859, 100, 0.0816039, -0.00046249, 7.37, 0, 2, 10, 120, 0, 0, 27.15, 10.4, 33.02, 0.866, 1, "ICAO", [[-15,840],[0,847],[10,854],[15,859],[25,873],[30,882],[35,893]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
|
|
||||||
["9.3×64mm" , 862, 100, 0.0627652, -0.00108571, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 9.30, 35.56, 0.368, 1, "ASM" , [[-15,843],[0,850],[10,857],[15,862],[25,876],[30,885],[35,896]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["9.3×64mm" , 862, 100, 0.0875873, -0.00110727, 8.13, 0, 2, 10, 120, 0, 0, 14.90, 9.30, 35.56, 0.368, 1, "ASM" , [[-15,843],[0,850],[10,857],[15,862],[25,876],[30,885],[35,896]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
|
|
||||||
[".338LM 250gr" , 872, 100, 0.0604821, -0.00059133, 3.81, 0, 2, 10, 120, 0, 0, 16.20, 8.58, 25.40, 0.645, 1, "ICAO", [[-15,853],[0,860],[10,867],[15,872],[25,886],[30,895],[35,906]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
[".338LM 250gr" , 872, 100, 0.0809096, -0.00060841, 7.37, 0, 2, 10, 120, 0, 0, 16.20, 8.58, 25.40, 0.645, 1, "ICAO", [[-15,853],[0,860],[10,867],[15,872],[25,886],[30,895],[35,906]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
[".338LM 300gr" , 792, 100, 0.0685883, -0.00052190, 3.81, 0, 2, 10, 120, 0, 0, 19.44, 8.58, 25.40, 0.759, 1, "ICAO", [[-15,773],[0,780],[10,787],[15,792],[25,806],[30,815],[35,826]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
[".338LM 300gr" , 792, 100, 0.0890193, -0.00055706, 7.37, 0, 2, 10, 120, 0, 0, 19.44, 8.58, 25.40, 0.759, 1, "ICAO", [[-15,773],[0,780],[10,787],[15,792],[25,806],[30,815],[35,826]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
[".338LM API526" , 872, 100, 0.0602535, -0.00069611, 3.81, 0, 2, 10, 120, 0, 0, 16.39, 8.58, 25.40, 0.580, 1, "ICAO", [[-15,853],[0,860],[10,867],[15,872],[25,886],[30,895],[35,906]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
[".338LM API526" , 872, 100, 0.0810834, -0.00069220, 7.37, 0, 2, 10, 120, 0, 0, 16.39, 8.58, 25.40, 0.580, 1, "ICAO", [[-15,853],[0,860],[10,867],[15,872],[25,886],[30,895],[35,906]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
|
|
||||||
[".300WM Mk248 Mod0" , 857, 100, 0.0621425, -0.00070530, 3.81, 0, 2, 10, 120, 0, 0, 12.31, 7.80, 25.40, 0.537, 1, "ICAO", [[-15,838],[0,845],[10,852],[15,857],[25,871],[30,880],[35,891]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
[".300WM Mk248 Mod0" , 857, 100, 0.0825862, -0.00072468, 7.37, 0, 2, 10, 120, 0, 0, 12.31, 7.80, 25.40, 0.537, 1, "ICAO", [[-15,838],[0,845],[10,852],[15,857],[25,871],[30,880],[35,891]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
[".300WM Mk248 Mod1" , 839, 100, 0.0637038, -0.00061188, 3.81, 0, 2, 10, 120, 0, 0, 14.26, 7.80, 25.40, 0.619, 1, "ICAO", [[-15,820],[0,827],[10,834],[15,839],[25,853],[30,862],[35,873]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
[".300WM Mk248 Mod1" , 839, 100, 0.0841417, -0.00063027, 7.37, 0, 2, 10, 120, 0, 0, 14.26, 7.80, 25.40, 0.619, 1, "ICAO", [[-15,820],[0,827],[10,834],[15,839],[25,853],[30,862],[35,873]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
[".300WM Berger OTM" , 792, 100, 0.0686968, -0.00053733, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 7.80, 25.40, 0.715, 1, "ICAO", [[-15,773],[0,780],[10,787],[15,792],[25,806],[30,815],[35,826]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
[".300WM Berger OTM" , 792, 100, 0.0891300, -0.00055262, 7.37, 0, 2, 10, 120, 0, 0, 14.90, 7.80, 25.40, 0.715, 1, "ICAO", [[-15,773],[0,780],[10,787],[15,792],[25,806],[30,815],[35,826]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
|
|
||||||
["7.62x54mmR" , 812, 100, 0.0678441, -0.00100023, 3.81, 0, 2, 10, 120, 0, 0, 9.849, 7.92, 24.13, 0.400, 1, "ICAO", [[-15,793],[0,800],[10,807],[15,812],[25,826],[30,835],[35,846]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["7.62x54mmR" , 812, 100, 0.0868171, -0.00102329, 7.11, 0, 2, 10, 120, 0, 0, 9.849, 7.92, 24.13, 0.400, 1, "ICAO", [[-15,793],[0,800],[10,807],[15,812],[25,826],[30,835],[35,846]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
|
|
||||||
["7.62x51mm M80" , 802, 100, 0.0690229, -0.00100957, 3.81, 0, 2, 10, 120, 0, 0, 9.461, 7.82, 25.40, 0.398, 1, "ICAO", [[-15,783],[0,790],[10,797],[15,802],[25,816],[30,825],[35,836]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["7.62x51mm M80" , 802, 100, 0.0909184, -0.00103711, 7.62, 0, 2, 10, 120, 0, 0, 9.461, 7.82, 25.40, 0.398, 1, "ICAO", [[-15,783],[0,790],[10,797],[15,802],[25,816],[30,825],[35,836]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
["7.62x51mm M118LR" , 757, 100, 0.0739989, -0.00082828, 3.81, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.482, 1, "ICAO", [[-15,738],[0,745],[10,752],[15,757],[25,771],[30,780],[35,791]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["7.62x51mm M118LR" , 757, 100, 0.0958841, -0.00085157, 7.62, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.482, 1, "ICAO", [[-15,738],[0,745],[10,752],[15,757],[25,771],[30,780],[35,791]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
["7.62x51mm Mk316" , 781, 100, 0.0709422, -0.00082029, 3.81, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.483, 1, "ICAO", [[-15,777],[0,778],[10,779],[15,781],[25,783],[30,785],[35,787]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["7.62x51mm Mk316" , 781, 100, 0.0928267, -0.00084311, 7.62, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.483, 1, "ICAO", [[-15,777],[0,778],[10,779],[15,781],[25,783],[30,785],[35,787]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
["7.62x51mm Mk319" , 900, 100, 0.0593025, -0.00102338, 3.81, 0, 2, 10, 120, 0, 0, 8.424, 7.82, 25.40, 0.377, 1, "ICAO", [[-15,898],[0,899],[10,900],[15,900],[25,902],[30,903],[35,904]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["7.62x51mm Mk319" , 900, 100, 0.0811838, -0.00104515, 7.62, 0, 2, 10, 120, 0, 0, 8.424, 7.82, 25.40, 0.377, 1, "ICAO", [[-15,898],[0,899],[10,900],[15,900],[25,902],[30,903],[35,904]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
["7.62x51mm M993" , 912, 100, 0.0585007, -0.00107148, 3.81, 0, 2, 10, 120, 0, 0, 8.230, 7.82, 25.40, 0.359, 1, "ICAO", [[-15,893],[0,900],[10,907],[15,912],[25,926],[30,935],[35,946]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["7.62x51mm M993" , 912, 100, 0.0803840, -0.00109390, 7.62, 0, 2, 10, 120, 0, 0, 8.230, 7.82, 25.40, 0.359, 1, "ICAO", [[-15,893],[0,900],[10,907],[15,912],[25,926],[30,935],[35,946]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
["7.62x51mm Subsonic", 314, 100, 0.3168140, -0.00049899, 3.81, 0, 2, 10, 120, 0, 0, 12.96, 7.82, 25.40, 0.502, 1, "ICAO", [[-15,312],[0,313],[10,314],[15,314],[25,316],[30,317],[35,318]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["7.62x51mm Subsonic", 314, 100, 0.3344490, -0.00060194, 6.86, 0, 2, 10, 120, 0, 0, 12.96, 7.82, 25.40, 0.502, 1, "ICAO", [[-15,312],[0,313],[10,314],[15,314],[25,316],[30,317],[35,318]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
|
|
||||||
["7.62x39mm" , 708, 100, 0.0846559, -0.00151621, 3.81, 0, 2, 10, 120, 0, 0, 7.970, 7.82, 25.40, 0.275, 1, "ICAO", [[-15,689],[0,696],[10,703],[15,708],[25,722],[30,731],[35,742]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["7.62x39mm" , 708, 100, 0.1066160, -0.00154815, 7.62, 0, 2, 10, 120, 0, 0, 7.970, 7.82, 25.40, 0.275, 1, "ICAO", [[-15,689],[0,696],[10,703],[15,708],[25,722],[30,731],[35,742]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
|
|
||||||
["6.5x39mm" , 766, 100, 0.0725986, -0.00075308, 3.81, 0, 2, 10, 120, 0, 0, 7.970, 6.71, 22.86, 0.524, 1, "ICAO", [[-15,747],[0,754],[10,761],[15,766],[25,780],[30,789],[35,800]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["6.5x39mm" , 766, 100, 0.0872025, -0.00077363, 6.35, 0, 2, 10, 120, 0, 0, 7.970, 6.71, 22.86, 0.524, 1, "ICAO", [[-15,747],[0,754],[10,761],[15,766],[25,780],[30,789],[35,800]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
["6.5x47mm Lapua" , 767, 100, 0.0722256, -0.00067037, 3.81, 0, 2, 10, 120, 0, 0, 9.007, 6.71, 22.86, 0.577, 1, "ICAO", [[-15,748],[0,755],[10,762],[15,767],[25,781],[30,790],[35,801]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["6.5x47mm Lapua" , 767, 100, 0.0868248, -0.00069003, 6.35, 0, 2, 10, 120, 0, 0, 9.007, 6.71, 22.86, 0.577, 1, "ICAO", [[-15,748],[0,755],[10,762],[15,767],[25,781],[30,790],[35,801]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
["6.5mm Creedmor" , 822, 100, 0.0655022, -0.00060887, 3.81, 0, 2, 10, 120, 0, 0, 9.072, 6.71, 22.86, 0.632, 1, "ICAO", [[-15,803],[0,810],[10,817],[15,822],[25,836],[30,845],[35,856]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["6.5mm Creedmor" , 822, 100, 0.0800956, -0.00062437, 6.35, 0, 2, 10, 120, 0, 0, 9.072, 6.71, 22.86, 0.632, 1, "ICAO", [[-15,803],[0,810],[10,817],[15,822],[25,836],[30,845],[35,856]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
|
|
||||||
["5.8x42mm DBP87" , 942, 100, 0.0566639, -0.00117956, 3.81, 0, 2, 10, 120, 0, 0, 4.150, 5.99, 24.40, 0.313, 1, "ICAO", [[-15,923],[0,930],[10,937],[15,942],[25,956],[30,965],[35,976]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["5.8x42mm DBP87" , 942, 100, 0.0916742, -0.00121087, 9.91, 0, 2, 10, 120, 0, 0, 4.150, 5.99, 24.40, 0.313, 1, "ICAO", [[-15,923],[0,930],[10,937],[15,942],[25,956],[30,965],[35,976]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
|
|
||||||
["5.56x45mm M855" , 862, 100, 0.0635456, -0.00126466, 3.81, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.302, 1, "ASM" , [[-15,843],[0,849],[10,857],[15,862],[25,876],[30,885],[35,898]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["5.56x45mm M855" , 862, 100, 0.0825404, -0.00130094, 7.11, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.302, 1, "ASM" , [[-15,843],[0,849],[10,857],[15,862],[25,876],[30,885],[35,898]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
["5.56x45mm Mk262" , 812, 100, 0.0682606, -0.00109563, 3.81, 0, 2, 10, 120, 0, 0, 4.990, 5.70, 17.78, 0.361, 1, "ASM" , [[-15,793],[0,800],[10,807],[15,812],[25,826],[30,835],[35,846]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["5.56x45mm Mk262" , 812, 100, 0.0872422, -0.00111805, 7.11, 0, 2, 10, 120, 0, 0, 4.990, 5.70, 17.78, 0.361, 1, "ASM" , [[-15,793],[0,800],[10,807],[15,812],[25,826],[30,835],[35,846]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
["5.56x45mm Mk318" , 872, 100, 0.0624569, -0.00123318, 3.81, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.307, 1, "ASM" , [[-15,853],[0,860],[10,867],[15,872],[25,886],[30,895],[35,906]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["5.56x45mm Mk318" , 872, 100, 0.0814490, -0.00125880, 7.11, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.307, 1, "ASM" , [[-15,853],[0,860],[10,867],[15,872],[25,886],[30,895],[35,906]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
["5.56x45mm M995" , 861, 100, 0.0635355, -0.00123272, 3.81, 0, 2, 10, 120, 0, 0, 4.536, 5.70, 17.78, 0.310, 1, "ASM" , [[-15,842],[0,849],[10,856],[15,861],[25,875],[30,884],[35,895]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
["5.56x45mm M995" , 861, 100, 0.0825279, -0.00126182, 7.11, 0, 2, 10, 120, 0, 0, 4.536, 5.70, 17.78, 0.310, 1, "ASM" , [[-15,842],[0,849],[10,856],[15,861],[25,875],[30,884],[35,895]] , [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true],
|
||||||
|
|
||||||
["5.45x39mm 7N6M" , 727, 100, 0.0801269, -0.00116278, 3.81, 0, 2, 10, 120, 0, 0, 3.428, 5.59, 16.00, 0.336, 1, "ICAO", [[-15,708],[0,715],[10,722],[15,727],[25,741],[30,750],[35,761]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true]];
|
["5.45x39mm 7N6M" , 727, 100, 0.0802286, -0.00119458, 3.81, 0, 2, 10, 120, 0, 0, 3.428, 5.59, 16.00, 0.336, 1, "ICAO", [[-15,708],[0,715],[10,722],[15,727],[25,741],[30,750],[35,761]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]], true]];
|
||||||
|
|
||||||
[] call FUNC(clear_user_data);
|
[] call FUNC(clear_user_data);
|
||||||
profileNamespace setVariable ["ACE_ATragMX_gunList", GVAR(gunList)];
|
profileNamespace setVariable ["ACE_ATragMX_gunList", GVAR(gunList)];
|
||||||
|
@ -77,11 +77,10 @@ if (GVAR(currentUnit) != 2) then {
|
|||||||
GVAR(barometricPressure) = 340 max GVAR(barometricPressure) min 1350;
|
GVAR(barometricPressure) = 340 max GVAR(barometricPressure) min 1350;
|
||||||
};
|
};
|
||||||
|
|
||||||
private ["_windSpeed1", "_windSpeed2", "_targetSpeed", "_targetRange", "_inclinationAngleCosine", "_inclinationAngleDegree"];
|
private _windSpeed1 = parseNumber(ctrlText 140020);
|
||||||
_windSpeed1 = parseNumber(ctrlText 140020);
|
private _windSpeed2 = parseNumber(ctrlText 140021);
|
||||||
_windSpeed2 = parseNumber(ctrlText 140021);
|
private _targetSpeed = parseNumber(ctrlText 140050);
|
||||||
_targetSpeed = parseNumber(ctrlText 140050);
|
private _targetRange = parseNumber(ctrlText 140060);
|
||||||
_targetRange = parseNumber(ctrlText 140060);
|
|
||||||
if (GVAR(currentUnit) != 2) then {
|
if (GVAR(currentUnit) != 2) then {
|
||||||
_windSpeed1 = 0 max _windSpeed1 min 50;
|
_windSpeed1 = 0 max _windSpeed1 min 50;
|
||||||
_windSpeed2 = 0 max _windSpeed2 min 50;
|
_windSpeed2 = 0 max _windSpeed2 min 50;
|
||||||
@ -107,8 +106,8 @@ GVAR(windSpeed2) set [GVAR(currentTarget), _windSpeed2];
|
|||||||
GVAR(windDirection) set [GVAR(currentTarget), 1 max Round(parseNumber(ctrlText 140030)) min 12];
|
GVAR(windDirection) set [GVAR(currentTarget), 1 max Round(parseNumber(ctrlText 140030)) min 12];
|
||||||
GVAR(targetSpeed) set [GVAR(currentTarget), _targetSpeed];
|
GVAR(targetSpeed) set [GVAR(currentTarget), _targetSpeed];
|
||||||
GVAR(targetRange) set [GVAR(currentTarget), _targetRange];
|
GVAR(targetRange) set [GVAR(currentTarget), _targetRange];
|
||||||
_inclinationAngleCosine = 0.5 max parseNumber(ctrlText 140041) min 1;
|
private _inclinationAngleCosine = 0.5 max parseNumber(ctrlText 140041) min 1;
|
||||||
_inclinationAngleDegree = -60 max round(parseNumber(ctrlText 140040)) min 60;
|
private _inclinationAngleDegree = -60 max round(parseNumber(ctrlText 140040)) min 60;
|
||||||
if (_inclinationAngleDegree != GVAR(inclinationAngle) select GVAR(currentTarget)) then {
|
if (_inclinationAngleDegree != GVAR(inclinationAngle) select GVAR(currentTarget)) then {
|
||||||
GVAR(inclinationAngle) set [GVAR(currentTarget), _inclinationAngleDegree];
|
GVAR(inclinationAngle) set [GVAR(currentTarget), _inclinationAngleDegree];
|
||||||
} else {
|
} else {
|
||||||
@ -122,19 +121,18 @@ if ((ctrlText 140051) == ">") then {
|
|||||||
GVAR(targetSpeedDirection) set [GVAR(currentTarget), -1];
|
GVAR(targetSpeedDirection) set [GVAR(currentTarget), -1];
|
||||||
};
|
};
|
||||||
|
|
||||||
private ["_boreHeight", "_bulletMass", "_bulletDiameter", "_airFriction", "_rifleTwist", "_muzzleVelocity", "_zeroRange"];
|
private _boreHeight = parseNumber(ctrlText 120000);
|
||||||
_boreHeight = parseNumber(ctrlText 120000);
|
private _bulletMass = parseNumber(ctrlText 120010);
|
||||||
_bulletMass = parseNumber(ctrlText 120010);
|
private _bulletDiameter = parseNumber(ctrlText 120020);
|
||||||
_bulletDiameter = parseNumber(ctrlText 120020);
|
private _airFriction = parseNumber(ctrlText 120030);
|
||||||
_airFriction = parseNumber(ctrlText 120030);
|
|
||||||
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
|
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
|
||||||
_airFriction = 0.1 max _airFriction min 2;
|
_airFriction = 0.1 max _airFriction min 2;
|
||||||
} else {
|
} else {
|
||||||
_airFriction = _airFriction / -1000;
|
_airFriction = _airFriction / -1000;
|
||||||
};
|
};
|
||||||
_rifleTwist = parseNumber(ctrlText 120040);
|
private _rifleTwist = parseNumber(ctrlText 120040);
|
||||||
_muzzleVelocity = parseNumber(ctrlText 120050);
|
private _muzzleVelocity = parseNumber(ctrlText 120050);
|
||||||
_zeroRange = parseNumber(ctrlText 120060);
|
private _zeroRange = parseNumber(ctrlText 120060);
|
||||||
if (GVAR(currentUnit) != 2) then {
|
if (GVAR(currentUnit) != 2) then {
|
||||||
_boreHeight = 0.1 max _boreHeight min 5;
|
_boreHeight = 0.1 max _boreHeight min 5;
|
||||||
_bulletMass = 1 max _bulletMass min 1500;
|
_bulletMass = 1 max _bulletMass min 1500;
|
||||||
|
@ -33,19 +33,20 @@ private _lookupTableSize = count _lookupTable;
|
|||||||
if (_lookupTableSize < 2) exitWith {};
|
if (_lookupTableSize < 2) exitWith {};
|
||||||
_lookupTable sort true;
|
_lookupTable sort true;
|
||||||
|
|
||||||
private ["_lowerIndex", "_upperIndex"];
|
private _lowerIndex = -1;
|
||||||
|
private _upperIndex = -1;
|
||||||
|
|
||||||
for "_index" from 1 to (_lookupTableSize - 1) do {
|
for "_index" from 1 to (_lookupTableSize - 1) do {
|
||||||
_upperIndex = _index;
|
_upperIndex = _index;
|
||||||
_lowerIndex = _upperIndex - 1;
|
_lowerIndex = _upperIndex - 1;
|
||||||
if (((_lookupTable select _index) select 0) >= (GVAR(targetRange) select GVAR(currentTarget))) exitWith {};
|
if (((_lookupTable select _index) select 0) >= (GVAR(targetRange) select GVAR(currentTarget))) exitWith {};
|
||||||
};
|
};
|
||||||
|
|
||||||
private ["_lowerDistance", "_upperDistance", "_lowerC1", "_upperC1", "_c1"];
|
private _lowerDistance = (_lookupTable select _lowerIndex) select 0;
|
||||||
_lowerDistance = (_lookupTable select _lowerIndex) select 0;
|
private _upperDistance = (_lookupTable select _upperIndex) select 0;
|
||||||
_upperDistance = (_lookupTable select _upperIndex) select 0;
|
private _lowerC1 = (_lookupTable select _lowerIndex) select 1;
|
||||||
_lowerC1 = (_lookupTable select _lowerIndex) select 1;
|
private _upperC1 = (_lookupTable select _upperIndex) select 1;
|
||||||
_upperC1 = (_lookupTable select _upperIndex) select 1;
|
private _c1 = _lowerC1;
|
||||||
_c1 = _lowerC1;
|
|
||||||
if (_lowerDistance != _upperDistance) then {
|
if (_lowerDistance != _upperDistance) then {
|
||||||
private _slope = (_upperC1 - _lowerC1) / (_upperDistance - _lowerDistance);
|
private _slope = (_upperC1 - _lowerC1) / (_upperDistance - _lowerDistance);
|
||||||
_c1 = _lowerC1 + ((GVAR(targetRange) select GVAR(currentTarget)) - _lowerDistance) * _slope;
|
_c1 = _lowerC1 + ((GVAR(targetRange) select GVAR(currentTarget)) - _lowerDistance) * _slope;
|
||||||
|
@ -33,19 +33,19 @@ private _lookupTableSize = count _lookupTable;
|
|||||||
if (_lookupTableSize < 2) exitWith {};
|
if (_lookupTableSize < 2) exitWith {};
|
||||||
_lookupTable sort true;
|
_lookupTable sort true;
|
||||||
|
|
||||||
private ["_lowerIndex", "_upperIndex"];
|
private _lowerIndex = -1;
|
||||||
|
private _upperIndex = -1;
|
||||||
for "_index" from 1 to (_lookupTableSize - 1) do {
|
for "_index" from 1 to (_lookupTableSize - 1) do {
|
||||||
_upperIndex = _index;
|
_upperIndex = _index;
|
||||||
_lowerIndex = _upperIndex - 1;
|
_lowerIndex = _upperIndex - 1;
|
||||||
if (((_lookupTable select _index) select 0) >= GVAR(temperature)) exitWith {};
|
if (((_lookupTable select _index) select 0) >= GVAR(temperature)) exitWith {};
|
||||||
};
|
};
|
||||||
|
|
||||||
private ["_lowerTemperature", "_upperTemperature", "_lowerMuzzleVelocity", "_upperMuzzleVelocity", "_muzzleVelocity"];
|
private _lowerTemperature = (_lookupTable select _lowerIndex) select 0;
|
||||||
_lowerTemperature = (_lookupTable select _lowerIndex) select 0;
|
private _upperTemperature = (_lookupTable select _upperIndex) select 0;
|
||||||
_upperTemperature = (_lookupTable select _upperIndex) select 0;
|
private _lowerMuzzleVelocity = (_lookupTable select _lowerIndex) select 1;
|
||||||
_lowerMuzzleVelocity = (_lookupTable select _lowerIndex) select 1;
|
private _upperMuzzleVelocity = (_lookupTable select _upperIndex) select 1;
|
||||||
_upperMuzzleVelocity = (_lookupTable select _upperIndex) select 1;
|
private _muzzleVelocity = _lowerMuzzleVelocity;
|
||||||
_muzzleVelocity = _lowerMuzzleVelocity;
|
|
||||||
if (_lowerTemperature != _upperTemperature) then {
|
if (_lowerTemperature != _upperTemperature) then {
|
||||||
private _slope = (_upperMuzzleVelocity - _lowerMuzzleVelocity) / (_upperTemperature - _lowerTemperature);
|
private _slope = (_upperMuzzleVelocity - _lowerMuzzleVelocity) / (_upperTemperature - _lowerTemperature);
|
||||||
_muzzleVelocity = _lowerMuzzleVelocity + (GVAR(temperature) - _lowerTemperature) * _slope;
|
_muzzleVelocity = _lowerMuzzleVelocity + (GVAR(temperature) - _lowerTemperature) * _slope;
|
||||||
|
@ -19,7 +19,7 @@ GVAR(atmosphereModeTBH) = true;
|
|||||||
GVAR(altitude) = 0;
|
GVAR(altitude) = 0;
|
||||||
GVAR(temperature) = 15;
|
GVAR(temperature) = 15;
|
||||||
GVAR(barometricPressure) = 1013.25;
|
GVAR(barometricPressure) = 1013.25;
|
||||||
GVAR(relativeHumidity) = 0.5;
|
GVAR(relativeHumidity) = 0.0;
|
||||||
|
|
||||||
[] call FUNC(update_atmo_selection);
|
[] call FUNC(update_atmo_selection);
|
||||||
[] call FUNC(update_atmosphere);
|
[] call FUNC(update_atmosphere);
|
||||||
|
@ -23,7 +23,7 @@ GVAR(atmosphereModeTBH) = profileNamespace getVariable ["ACE_ATragMX_atmosphereM
|
|||||||
GVAR(altitude) = -1000 max (profileNamespace getVariable ["ACE_ATragMX_altitude", 0]) min 20000;
|
GVAR(altitude) = -1000 max (profileNamespace getVariable ["ACE_ATragMX_altitude", 0]) min 20000;
|
||||||
GVAR(temperature) = -50 max (profileNamespace getVariable ["ACE_ATragMX_temperature", 15]) min 160;
|
GVAR(temperature) = -50 max (profileNamespace getVariable ["ACE_ATragMX_temperature", 15]) min 160;
|
||||||
GVAR(barometricPressure) = 340 max (profileNamespace getVariable ["ACE_ATragMX_barometricPressure", 1013.25]) min 1350;
|
GVAR(barometricPressure) = 340 max (profileNamespace getVariable ["ACE_ATragMX_barometricPressure", 1013.25]) min 1350;
|
||||||
GVAR(relativeHumidity) = 0 max (profileNamespace getVariable ["ACE_ATragMX_relativeHumidity", 0.5]) min 1;
|
GVAR(relativeHumidity) = 0 max (profileNamespace getVariable ["ACE_ATragMX_relativeHumidity", 0.0]) min 1;
|
||||||
|
|
||||||
GVAR(showWind2) = profileNamespace getVariable ["ACE_ATragMX_showWind2", false];
|
GVAR(showWind2) = profileNamespace getVariable ["ACE_ATragMX_showWind2", false];
|
||||||
GVAR(showCoriolis) = profileNamespace getVariable ["ACE_ATragMX_showCoriolis", true];
|
GVAR(showCoriolis) = profileNamespace getVariable ["ACE_ATragMX_showCoriolis", true];
|
||||||
|
@ -15,8 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_index"];
|
private _index = 0 max (lbCurSel 6000);
|
||||||
_index = 0 max (lbCurSel 6000);
|
|
||||||
|
|
||||||
GVAR(gunList) set [_index, +GVAR(workingMemory)];
|
GVAR(gunList) set [_index, +GVAR(workingMemory)];
|
||||||
|
|
||||||
|
@ -21,8 +21,7 @@ if (ctrlVisible 8000) then {
|
|||||||
|
|
||||||
if (_this == 1) then {
|
if (_this == 1) then {
|
||||||
[] call FUNC(calculate_target_speed_assist);
|
[] call FUNC(calculate_target_speed_assist);
|
||||||
private ["_targetSpeed"];
|
private _targetSpeed = parseNumber(ctrlText 8007);
|
||||||
_targetSpeed = parseNumber(ctrlText 8007);
|
|
||||||
if (_targetSpeed != 0) then {
|
if (_targetSpeed != 0) then {
|
||||||
ctrlSetText [330, Str(_targetSpeed)];
|
ctrlSetText [330, Str(_targetSpeed)];
|
||||||
ctrlSetText [140050, Str(_targetSpeed)];
|
ctrlSetText [140050, Str(_targetSpeed)];
|
||||||
|
@ -15,9 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_inclinationAngleCosine", "_inclinationAngleDegree"];
|
private _inclinationAngleCosine = 0.5 max parseNumber(ctrlText 140041) min 1;
|
||||||
_inclinationAngleCosine = 0.5 max parseNumber(ctrlText 140041) min 1;
|
private _inclinationAngleDegree = -60 max parseNumber(ctrlText 140040) min 60;
|
||||||
_inclinationAngleDegree = -60 max parseNumber(ctrlText 140040) min 60;
|
|
||||||
|
|
||||||
if (_this == 0) then {
|
if (_this == 0) then {
|
||||||
ctrlSetText [140040, Str(round(acos(_inclinationAngleCosine)))];
|
ctrlSetText [140040, Str(round(acos(_inclinationAngleCosine)))];
|
||||||
|
@ -15,8 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_range", "_elevation", "_windage1", "_windage2", "_clickSize", "_clickNumber", "_clickInterval", "_lead", "_TOF", "_velocity", "_kineticEnergy", "_rangeOutput", "_elevationOutput", "_windageOutput", "_lastColumnOutput", "_speedOfSound"];
|
private _lastColumnOutput = "";
|
||||||
_lastColumnOutput = "";
|
|
||||||
|
|
||||||
if (GVAR(showWind2) && GVAR(rangeCardCurrentColumn) == 0) then {
|
if (GVAR(showWind2) && GVAR(rangeCardCurrentColumn) == 0) then {
|
||||||
ctrlSetText [5006, "Wind2"];
|
ctrlSetText [5006, "Wind2"];
|
||||||
@ -32,23 +31,23 @@ if (GVAR(currentUnit) == 1) then {
|
|||||||
|
|
||||||
lnbClear 5007;
|
lnbClear 5007;
|
||||||
|
|
||||||
_speedOfSound = GVAR(temperature) call EFUNC(weather,calculateSpeedOfSound);
|
private _speedOfSound = GVAR(temperature) call EFUNC(weather,calculateSpeedOfSound);
|
||||||
|
|
||||||
{
|
{
|
||||||
_range = _x select 0;
|
private _range = _x select 0;
|
||||||
_elevation = _x select 1;
|
private _elevation = _x select 1;
|
||||||
_windage1 = (_x select 2) select 0;
|
private _windage1 = (_x select 2) select 0;
|
||||||
_windage2 = (_x select 2) select 1;
|
private _windage2 = (_x select 2) select 1;
|
||||||
_lead = _x select 3;
|
private _lead = _x select 3;
|
||||||
_TOF = _x select 4;
|
private _TOF = _x select 4;
|
||||||
_velocity = _x select 5;
|
private _velocity = _x select 5;
|
||||||
_kineticEnergy = _x select 6;
|
private _kineticEnergy = _x select 6;
|
||||||
|
|
||||||
switch (GVAR(currentScopeUnit)) do {
|
switch (GVAR(currentScopeUnit)) do {
|
||||||
case 0: {
|
case 0: {
|
||||||
_elevation = _elevation / 3.38;
|
_elevation = MRAD_TO_MOA(_elevation);
|
||||||
_windage1 = _windage1 / 3.38;
|
_windage1 = MRAD_TO_MOA(_windage1);
|
||||||
_windage2 = _windage2 / 3.38;
|
_windage2 = MRAD_TO_MOA(_windage2);
|
||||||
};
|
};
|
||||||
case 2: {
|
case 2: {
|
||||||
_elevation = _elevation * 1.047;
|
_elevation = _elevation * 1.047;
|
||||||
@ -56,13 +55,9 @@ _speedOfSound = GVAR(temperature) call EFUNC(weather,calculateSpeedOfSound);
|
|||||||
_windage2 = _windage2 * 1.047;
|
_windage2 = _windage2 * 1.047;
|
||||||
};
|
};
|
||||||
case 3: {
|
case 3: {
|
||||||
switch (GVAR(workingMemory) select 7) do {
|
private _clickSize = [1, 1 / 1.047, MOA_TO_MRAD(1)] select (GVAR(workingMemory) select 7);
|
||||||
case 0: { _clickSize = 1; };
|
private _clickNumber = GVAR(workingMemory) select 8;
|
||||||
case 1: { _clickSize = 1 / 1.047; };
|
private _clickInterval = _clickSize / _clickNumber;
|
||||||
case 2: { _clickSize = 3.38; };
|
|
||||||
};
|
|
||||||
_clickNumber = GVAR(workingMemory) select 8;
|
|
||||||
_clickInterval = _clickSize / _clickNumber;
|
|
||||||
|
|
||||||
_elevation = Round(_elevation / _clickInterval);
|
_elevation = Round(_elevation / _clickInterval);
|
||||||
_windage1 = Round(_windage1 / _clickInterval);
|
_windage1 = Round(_windage1 / _clickInterval);
|
||||||
@ -70,10 +65,10 @@ _speedOfSound = GVAR(temperature) call EFUNC(weather,calculateSpeedOfSound);
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
_elevationOutput = Str(Round(_elevation * 100) / 100);
|
private _elevationOutput = Str(Round(_elevation * 100) / 100);
|
||||||
_windageOutput = Str(Round(_windage1 * 100) / 100);
|
private _windageOutput = Str(Round(_windage1 * 100) / 100);
|
||||||
|
|
||||||
_rangeOutput = Str(_range);
|
private _rangeOutput = Str(_range);
|
||||||
if (_velocity < _speedOfSound) then {
|
if (_velocity < _speedOfSound) then {
|
||||||
_rangeOutput = _rangeOutput + "*";
|
_rangeOutput = _rangeOutput + "*";
|
||||||
};
|
};
|
||||||
|
@ -15,15 +15,14 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_elevationAbs", "_elevationRel", "_elevationCur", "_windageAbs", "_windageRel", "_windageCur", "_wind2", "_lead", "_clickSize", "_clickNumber", "_clickInterval"];
|
private _elevationAbs = GVAR(elevationOutput) select GVAR(currentTarget);
|
||||||
_elevationAbs = GVAR(elevationOutput) select GVAR(currentTarget);
|
private _elevationRel = 0;
|
||||||
_elevationRel = 0;
|
private _elevationCur = 0;
|
||||||
_elevationCur = 0;
|
private _windageAbs = GVAR(windage1Output) select GVAR(currentTarget);
|
||||||
_windageAbs = GVAR(windage1Output) select GVAR(currentTarget);
|
private _windageRel = 0;
|
||||||
_windageRel = 0;
|
private _windageCur = 0;
|
||||||
_windageCur = 0;
|
|
||||||
|
|
||||||
_wind2 = GVAR(windage2Output) select GVAR(currentTarget);
|
private _wind2 = GVAR(windage2Output) select GVAR(currentTarget);
|
||||||
|
|
||||||
if (GVAR(showCoriolis)) then {
|
if (GVAR(showCoriolis)) then {
|
||||||
_elevationRel = GVAR(verticalCoriolisOutput) select GVAR(currentTarget);
|
_elevationRel = GVAR(verticalCoriolisOutput) select GVAR(currentTarget);
|
||||||
@ -38,20 +37,20 @@ if (GVAR(showCoriolis)) then {
|
|||||||
_windageRel = _windageAbs - _windageCur;
|
_windageRel = _windageAbs - _windageCur;
|
||||||
};
|
};
|
||||||
|
|
||||||
_lead = GVAR(leadOutput) select GVAR(currentTarget);
|
private _lead = GVAR(leadOutput) select GVAR(currentTarget);
|
||||||
|
|
||||||
switch (GVAR(currentScopeUnit)) do {
|
switch (GVAR(currentScopeUnit)) do {
|
||||||
case 0: {
|
case 0: {
|
||||||
_elevationAbs = _elevationAbs / 3.38;
|
_elevationAbs = MRAD_TO_MOA(_elevationAbs);
|
||||||
_windageAbs = _windageAbs / 3.38;
|
_windageAbs = MRAD_TO_MOA(_windageAbs);
|
||||||
|
|
||||||
_wind2 = _wind2 / 3.38;
|
_wind2 = MRAD_TO_MOA(_wind2);
|
||||||
|
|
||||||
_elevationRel = _elevationRel / 3.38;
|
_elevationRel = MRAD_TO_MOA(_elevationRel);
|
||||||
_windageRel = _windageRel / 3.38;
|
_windageRel = MRAD_TO_MOA(_windageRel);
|
||||||
|
|
||||||
_elevationCur = _elevationCur / 3.38;
|
_elevationCur = MRAD_TO_MOA(_elevationCur);
|
||||||
_windageCur = _windageCur / 3.38;
|
_windageCur = MRAD_TO_MOA(_windageCur);
|
||||||
};
|
};
|
||||||
case 2: {
|
case 2: {
|
||||||
_elevationAbs = _elevationAbs * 1.047;
|
_elevationAbs = _elevationAbs * 1.047;
|
||||||
@ -66,13 +65,9 @@ switch (GVAR(currentScopeUnit)) do {
|
|||||||
_windageCur = _windageCur * 1.047;
|
_windageCur = _windageCur * 1.047;
|
||||||
};
|
};
|
||||||
case 3: {
|
case 3: {
|
||||||
switch (GVAR(workingMemory) select 7) do {
|
private _clickSize = [1, 1 / 1.047, MOA_TO_MRAD(1)] select (GVAR(workingMemory) select 7);
|
||||||
case 0: { _clickSize = 1; };
|
private _clickNumber = GVAR(workingMemory) select 8;
|
||||||
case 1: { _clickSize = 1 / 1.047; };
|
private _clickInterval = _clickSize / _clickNumber;
|
||||||
case 2: { _clickSize = 3.38; };
|
|
||||||
};
|
|
||||||
_clickNumber = GVAR(workingMemory) select 8;
|
|
||||||
_clickInterval = _clickSize / _clickNumber;
|
|
||||||
|
|
||||||
_elevationAbs = Round(_elevationAbs / _clickInterval);
|
_elevationAbs = Round(_elevationAbs / _clickInterval);
|
||||||
_windageAbs = Round(_windageAbs / _clickInterval);
|
_windageAbs = Round(_windageAbs / _clickInterval);
|
||||||
|
@ -42,9 +42,9 @@ private _dropData = +GVAR(truingDropDropData);
|
|||||||
|
|
||||||
switch (_dropUnit) do {
|
switch (_dropUnit) do {
|
||||||
case 0: {
|
case 0: {
|
||||||
_dropData set [0, (_dropData select 0) / 3.38];
|
_dropData set [0, MRAD_TO_MOA(_dropData select 0)];
|
||||||
_dropData set [1, (_dropData select 1) / 3.38];
|
_dropData set [1, MRAD_TO_MOA(_dropData select 1)];
|
||||||
_dropData set [2, (_dropData select 2) / 3.38];
|
_dropData set [2, MRAD_TO_MOA(_dropData select 2)];
|
||||||
};
|
};
|
||||||
case 2: {
|
case 2: {
|
||||||
_dropData set [0, (_dropData select 0) * 1.047];
|
_dropData set [0, (_dropData select 0) * 1.047];
|
||||||
|
@ -17,23 +17,19 @@
|
|||||||
|
|
||||||
[] call FUNC(parse_input);
|
[] call FUNC(parse_input);
|
||||||
|
|
||||||
private ["_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel"];
|
private _bulletMass = GVAR(workingMemory) select 12;
|
||||||
_bulletMass = GVAR(workingMemory) select 12;
|
private _boreHeight = GVAR(workingMemory) select 5;
|
||||||
_boreHeight = GVAR(workingMemory) select 5;
|
private _airFriction = GVAR(workingMemory) select 4;
|
||||||
_airFriction = GVAR(workingMemory) select 4;
|
private _muzzleVelocity = GVAR(workingMemory) select 1;
|
||||||
_muzzleVelocity = GVAR(workingMemory) select 1;
|
private _bc = GVAR(workingMemory) select 15;
|
||||||
_bc = GVAR(workingMemory) select 15;
|
private _dragModel = GVAR(workingMemory) select 16;
|
||||||
_dragModel = GVAR(workingMemory) select 16;
|
private _atmosphereModel = GVAR(workingMemory) select 17;
|
||||||
_atmosphereModel = GVAR(workingMemory) select 17;
|
private _zeroRange = GVAR(workingMemory) select 2;
|
||||||
|
private _altitude = GVAR(altitude);
|
||||||
|
private _temperature = GVAR(temperature);
|
||||||
|
private _barometricPressure = GVAR(barometricPressure);
|
||||||
|
private _relativeHumidity = GVAR(relativeHumidity);
|
||||||
|
|
||||||
private ["_zeroRange"];
|
|
||||||
_zeroRange = GVAR(workingMemory) select 2;
|
|
||||||
|
|
||||||
private ["_altitude", "_temperature", "_barometricPressure", "_relativeHumidity"];
|
|
||||||
_altitude = GVAR(altitude);
|
|
||||||
_temperature = GVAR(temperature);
|
|
||||||
_barometricPressure = GVAR(barometricPressure);
|
|
||||||
_relativeHumidity = GVAR(relativeHumidity);
|
|
||||||
if (!GVAR(atmosphereModeTBH)) then {
|
if (!GVAR(atmosphereModeTBH)) then {
|
||||||
_barometricPressure = 1013.25 * (1 - (0.0065 * _altitude) / (273.15 + _temperature + 0.0065 * _altitude)) ^ 5.255754495;
|
_barometricPressure = 1013.25 * (1 - (0.0065 * _altitude) / (273.15 + _temperature + 0.0065 * _altitude)) ^ 5.255754495;
|
||||||
_relativeHumidity = 0.5;
|
_relativeHumidity = 0.5;
|
||||||
|
@ -15,11 +15,10 @@
|
|||||||
|
|
||||||
|
|
||||||
//Add deviceKey entry:
|
//Add deviceKey entry:
|
||||||
private ["_conditonCode", "_toggleCode", "_closeCode"];
|
private _conditonCode = {
|
||||||
_conditonCode = {
|
|
||||||
[] call FUNC(can_show);
|
[] call FUNC(can_show);
|
||||||
};
|
};
|
||||||
_toggleCode = {
|
private _toggleCode = {
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {};
|
if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {};
|
||||||
if (GVAR(active)) exitWith {
|
if (GVAR(active)) exitWith {
|
||||||
@ -28,7 +27,7 @@ _toggleCode = {
|
|||||||
// Statement
|
// Statement
|
||||||
[] call FUNC(create_dialog);
|
[] call FUNC(create_dialog);
|
||||||
};
|
};
|
||||||
_closeCode = {
|
private _closeCode = {
|
||||||
if (GVAR(active)) exitWith {
|
if (GVAR(active)) exitWith {
|
||||||
closeDialog 0;
|
closeDialog 0;
|
||||||
};
|
};
|
||||||
|
@ -16,4 +16,11 @@
|
|||||||
|
|
||||||
#include "\z\ace\addons\main\script_macros.hpp"
|
#include "\z\ace\addons\main\script_macros.hpp"
|
||||||
|
|
||||||
#define ATRAGMX_PROFILE_NAMESPACE_VERSION 2.0
|
#define MOA_TO_MRAD(d) (d * 3.43774677) // Conversion factor: 54 / (5 * PI)
|
||||||
|
#define MRAD_TO_MOA(d) (d * 0.29088821) // Conversion factor: (5 * PI) / 54
|
||||||
|
#define DEG_TO_MOA(d) (d * 60) // Conversion factor: 60
|
||||||
|
#define MOA_TO_DEG(d) (d / 60) // Conversion factor: 1 / 60
|
||||||
|
#define DEG_TO_MRAD(d) (d * 17.45329252) // Conversion factor: (50 * PI) / 9
|
||||||
|
#define MRAD_TO_DEG(d) (d / 17.45329252) // Conversion factor: 9 / (50 * PI)
|
||||||
|
|
||||||
|
#define ATRAGMX_PROFILE_NAMESPACE_VERSION 2.1
|
||||||
|
@ -21,29 +21,27 @@ params ["_attachToVehicle","_unit","_args", ["_silentScripted", false]];
|
|||||||
_args params [["_itemClassname","", [""]]];
|
_args params [["_itemClassname","", [""]]];
|
||||||
TRACE_4("params",_attachToVehicle,_unit,_itemClassname,_silentScripted);
|
TRACE_4("params",_attachToVehicle,_unit,_itemClassname,_silentScripted);
|
||||||
|
|
||||||
private ["_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID", "_model"];
|
|
||||||
|
|
||||||
//Sanity Check (_unit has item in inventory, not over attach limit)
|
//Sanity Check (_unit has item in inventory, not over attach limit)
|
||||||
if ((_itemClassname == "") || {(!_silentScripted) && {!(_this call FUNC(canAttach))}}) exitWith {ERROR("Tried to attach, but check failed");};
|
if ((_itemClassname == "") || {(!_silentScripted) && {!(_this call FUNC(canAttach))}}) exitWith {ERROR("Tried to attach, but check failed");};
|
||||||
|
|
||||||
_itemVehClass = getText (configFile >> "CfgWeapons" >> _itemClassname >> "ACE_Attachable");
|
private _itemVehClass = getText (configFile >> "CfgWeapons" >> _itemClassname >> "ACE_Attachable");
|
||||||
_onAtachText = getText (configFile >> "CfgWeapons" >> _itemClassname >> "displayName");
|
private _onAttachText = getText (configFile >> "CfgWeapons" >> _itemClassname >> "displayName");
|
||||||
|
|
||||||
if (_itemVehClass == "") then {
|
if (_itemVehClass == "") then {
|
||||||
_itemVehClass = getText (configFile >> "CfgMagazines" >> _itemClassname >> "ACE_Attachable");
|
_itemVehClass = getText (configFile >> "CfgMagazines" >> _itemClassname >> "ACE_Attachable");
|
||||||
_onAtachText = getText (configFile >> "CfgMagazines" >> _itemClassname >> "displayName");
|
_onAttachText = getText (configFile >> "CfgMagazines" >> _itemClassname >> "displayName");
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_itemVehClass == "") exitWith {ERROR("no ACE_Attachable for Item");};
|
if (_itemVehClass == "") exitWith {ERROR("no ACE_Attachable for Item");};
|
||||||
|
|
||||||
_onAtachText = format [localize LSTRING(Item_Attached), _onAtachText];
|
private _onAttachText = format [localize LSTRING(Item_Attached), _onAttachText];
|
||||||
|
|
||||||
if (_unit == _attachToVehicle) then { //Self Attachment
|
if (_unit == _attachToVehicle) then { //Self Attachment
|
||||||
_attachedItem = _itemVehClass createVehicle [0,0,0];
|
private _attachedItem = _itemVehClass createVehicle [0,0,0];
|
||||||
_attachedItem attachTo [_unit, [0.05, -0.09, 0.1], "leftshoulder"];
|
_attachedItem attachTo [_unit, [0.05, -0.09, 0.1], "leftshoulder"];
|
||||||
if (!_silentScripted) then {
|
if (!_silentScripted) then {
|
||||||
_unit removeItem _itemClassname; // Remove item
|
_unit removeItem _itemClassname; // Remove item
|
||||||
[_onAtachText] call EFUNC(common,displayTextStructured);
|
[_onAttachText] call EFUNC(common,displayTextStructured);
|
||||||
};
|
};
|
||||||
_unit setVariable [QGVAR(attached), [[_attachedItem, _itemClassname]], true];
|
_unit setVariable [QGVAR(attached), [[_attachedItem, _itemClassname]], true];
|
||||||
} else {
|
} else {
|
||||||
@ -54,10 +52,10 @@ if (_unit == _attachToVehicle) then { //Self Attachment
|
|||||||
[{[localize LSTRING(PlaceAction), ""] call EFUNC(interaction,showMouseHint)}, []] call CBA_fnc_execNextFrame;
|
[{[localize LSTRING(PlaceAction), ""] call EFUNC(interaction,showMouseHint)}, []] call CBA_fnc_execNextFrame;
|
||||||
_unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = PLACE_APPROVE;}] call EFUNC(common,AddActionEventHandler)];
|
_unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = PLACE_APPROVE;}] call EFUNC(common,AddActionEventHandler)];
|
||||||
|
|
||||||
_actionID = _unit addAction [format ["<t color='#FF0000'>%1</t>", localize LSTRING(CancelAction)], {GVAR(placeAction) = PLACE_CANCEL}];
|
private _actionID = _unit addAction [format ["<t color='#FF0000'>%1</t>", localize LSTRING(CancelAction)], {GVAR(placeAction) = PLACE_CANCEL}];
|
||||||
|
|
||||||
//Display to show virtual object:
|
//Display to show virtual object:
|
||||||
_model = getText (configFile >> "CfgAmmo" >> _itemVehClass >> "model");
|
private _model = getText (configFile >> "CfgAmmo" >> _itemVehClass >> "model");
|
||||||
if (_model == "") then {
|
if (_model == "") then {
|
||||||
_model = getText (configFile >> "CfgVehicles" >> _itemVehClass >> "model");
|
_model = getText (configFile >> "CfgVehicles" >> _itemVehClass >> "model");
|
||||||
};
|
};
|
||||||
@ -67,16 +65,15 @@ if (_unit == _attachToVehicle) then { //Self Attachment
|
|||||||
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetModel _model;
|
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetModel _model;
|
||||||
|
|
||||||
[{
|
[{
|
||||||
private ["_angle", "_dir", "_screenPos", "_realDistance", "_up", "_virtualPos", "_virtualPosASL", "_lineInterection"];
|
|
||||||
params ["_args","_idPFH"];
|
params ["_args","_idPFH"];
|
||||||
_args params ["_unit","_attachToVehicle","_itemClassname","_itemVehClass","_onAtachText","_actionID"];
|
_args params ["_unit","_attachToVehicle","_itemClassname","_itemVehClass","_onAttachText","_actionID"];
|
||||||
|
|
||||||
_virtualPosASL = (eyePos _unit) vectorAdd (positionCameraToWorld [0,0,0.6]) vectorDiff (positionCameraToWorld [0,0,0]);
|
private _virtualPosASL = (eyePos _unit) vectorAdd (positionCameraToWorld [0,0,0.6]) vectorDiff (positionCameraToWorld [0,0,0]);
|
||||||
if (cameraView == "EXTERNAL") then {
|
if (cameraView == "EXTERNAL") then {
|
||||||
_virtualPosASL = _virtualPosASL vectorAdd ((positionCameraToWorld [0.3,0,0]) vectorDiff (positionCameraToWorld [0,0,0]));
|
_virtualPosASL = _virtualPosASL vectorAdd ((positionCameraToWorld [0.3,0,0]) vectorDiff (positionCameraToWorld [0,0,0]));
|
||||||
};
|
};
|
||||||
_virtualPos = _virtualPosASL call EFUNC(common,ASLToPosition);
|
private _virtualPos = _virtualPosASL call EFUNC(common,ASLToPosition);
|
||||||
_lineInterection = lineIntersects [eyePos ACE_player, _virtualPosASL, ACE_player];
|
private _lineInterection = lineIntersects [eyePos ACE_player, _virtualPosASL, ACE_player];
|
||||||
|
|
||||||
//Don't allow placing in a bad position:
|
//Don't allow placing in a bad position:
|
||||||
if (_lineInterection && {GVAR(placeAction) == PLACE_APPROVE}) then {GVAR(placeAction) = PLACE_WAITING;};
|
if (_lineInterection && {GVAR(placeAction) == PLACE_APPROVE}) then {GVAR(placeAction) = PLACE_WAITING;};
|
||||||
@ -95,7 +92,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment
|
|||||||
(QGVAR(virtualAmmo) call BIS_fnc_rscLayer) cutText ["", "PLAIN"];
|
(QGVAR(virtualAmmo) call BIS_fnc_rscLayer) cutText ["", "PLAIN"];
|
||||||
|
|
||||||
if (GVAR(placeAction) == PLACE_APPROVE) then {
|
if (GVAR(placeAction) == PLACE_APPROVE) then {
|
||||||
[_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _virtualPos] call FUNC(placeApprove);
|
[_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAttachText, _virtualPos] call FUNC(placeApprove);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
//Show the virtual object:
|
//Show the virtual object:
|
||||||
@ -103,18 +100,18 @@ if (_unit == _attachToVehicle) then { //Self Attachment
|
|||||||
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow false;
|
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow false;
|
||||||
} else {
|
} else {
|
||||||
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow true;
|
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow true;
|
||||||
_screenPos = worldToScreen _virtualPos;
|
private _screenPos = worldToScreen _virtualPos;
|
||||||
if (_screenPos isEqualTo []) exitWith {
|
if (_screenPos isEqualTo []) exitWith {
|
||||||
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow false;
|
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow false;
|
||||||
};
|
};
|
||||||
_realDistance = (_virtualPos distance (positionCameraToWorld [0,0,0])) / ((call CBA_fnc_getFov) select 1);
|
private _realDistance = (_virtualPos distance (positionCameraToWorld [0,0,0])) / ((call CBA_fnc_getFov) select 1);
|
||||||
_screenPos = [(_screenPos select 0), _realDistance, (_screenPos select 1)];
|
_screenPos = [(_screenPos select 0), _realDistance, (_screenPos select 1)];
|
||||||
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetPosition _screenPos;
|
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetPosition _screenPos;
|
||||||
_dir = (positionCameraToWorld [0,0,1]) vectorFromTo (positionCameraToWorld [0,0,0]);
|
private _dir = (positionCameraToWorld [0,0,1]) vectorFromTo (positionCameraToWorld [0,0,0]);
|
||||||
_angle = asin (_dir select 2);
|
private _angle = asin (_dir select 2);
|
||||||
_up = [0, cos _angle, sin _angle];
|
private _up = [0, cos _angle, sin _angle];
|
||||||
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetModelDirAndUp [[1,0,0], _up];
|
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetModelDirAndUp [[1,0,0], _up];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}, 0, [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _actionID]] call CBA_fnc_addPerFrameHandler;
|
}, 0, [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAttachText, _actionID]] call CBA_fnc_addPerFrameHandler;
|
||||||
};
|
};
|
||||||
|
@ -21,10 +21,8 @@ params ["_attachToVehicle","_player","_args"];
|
|||||||
_args params [["_itemClassname","", [""]]];
|
_args params [["_itemClassname","", [""]]];
|
||||||
TRACE_3("params",_attachToVehicle,_player,_itemClassname);
|
TRACE_3("params",_attachToVehicle,_player,_itemClassname);
|
||||||
|
|
||||||
private ["_attachLimit", "_attachedObjects"];
|
private _attachLimit = [6, 1] select (_player == _attachToVehicle);
|
||||||
|
private _attachedObjects = _attachToVehicle getVariable [QGVAR(attached), []];
|
||||||
_attachLimit = [6, 1] select (_player == _attachToVehicle);
|
|
||||||
_attachedObjects = _attachToVehicle getVariable [QGVAR(attached), []];
|
|
||||||
|
|
||||||
((_player == _attachToVehicle) || {canStand _player}) &&
|
((_player == _attachToVehicle) || {canStand _player}) &&
|
||||||
{(_attachToVehicle distance _player) < 10} &&
|
{(_attachToVehicle distance _player) < 10} &&
|
||||||
|
@ -24,9 +24,7 @@ if ((vehicle _unit) != _unit) exitWith {false};
|
|||||||
private _attachedList = _attachToVehicle getVariable [QGVAR(attached), []];
|
private _attachedList = _attachToVehicle getVariable [QGVAR(attached), []];
|
||||||
if ((count _attachedList) == 0) exitWith {false};
|
if ((count _attachedList) == 0) exitWith {false};
|
||||||
|
|
||||||
private ["_inRange"];
|
private _inRange = false;
|
||||||
|
|
||||||
_inRange = false;
|
|
||||||
{
|
{
|
||||||
_x params ["_xObject"];
|
_x params ["_xObject"];
|
||||||
if (isNull _xObject) exitWith {
|
if (isNull _xObject) exitWith {
|
||||||
|
@ -19,16 +19,14 @@
|
|||||||
params ["_attachToVehicle","_unit"],
|
params ["_attachToVehicle","_unit"],
|
||||||
TRACE_2("params",_attachToVehicle,_unit);
|
TRACE_2("params",_attachToVehicle,_unit);
|
||||||
|
|
||||||
private ["_attachedList", "_itemDisplayName", "_attachedObject", "_attachedIndex", "_itemName", "_minDistance", "_isChemlight"];
|
private _attachedList = _attachToVehicle getVariable [QGVAR(attached), []];
|
||||||
|
|
||||||
_attachedList = _attachToVehicle getVariable [QGVAR(attached), []];
|
private _attachedObject = objNull;
|
||||||
|
private _attachedIndex = -1;
|
||||||
_attachedObject = objNull;
|
private _itemName = "";
|
||||||
_attachedIndex = -1;
|
|
||||||
_itemName = "";
|
|
||||||
|
|
||||||
//Find closest attached object
|
//Find closest attached object
|
||||||
_minDistance = 1000;
|
private _minDistance = 1000;
|
||||||
|
|
||||||
{
|
{
|
||||||
_x params ["_xObject", "_xItemName"];
|
_x params ["_xObject", "_xItemName"];
|
||||||
@ -45,7 +43,7 @@ _minDistance = 1000;
|
|||||||
if (isNull _attachedObject || {_itemName == ""}) exitWith {ERROR("Could not find attached object")};
|
if (isNull _attachedObject || {_itemName == ""}) exitWith {ERROR("Could not find attached object")};
|
||||||
|
|
||||||
// Check if item is a chemlight
|
// Check if item is a chemlight
|
||||||
_isChemlight = _attachedObject isKindOf "Chemlight_base";
|
private _isChemlight = _attachedObject isKindOf "Chemlight_base";
|
||||||
|
|
||||||
// Exit if can't add the item
|
// Exit if can't add the item
|
||||||
if (!(_unit canAdd _itemName) && {!_isChemlight}) exitWith {
|
if (!(_unit canAdd _itemName) && {!_isChemlight}) exitWith {
|
||||||
@ -80,7 +78,7 @@ _attachedList deleteAt _attachedIndex;
|
|||||||
_attachToVehicle setVariable [QGVAR(attached), _attachedList, true];
|
_attachToVehicle setVariable [QGVAR(attached), _attachedList, true];
|
||||||
|
|
||||||
// Display message
|
// Display message
|
||||||
_itemDisplayName = getText (configFile >> "CfgWeapons" >> _itemName >> "displayName");
|
private _itemDisplayName = getText (configFile >> "CfgWeapons" >> _itemName >> "displayName");
|
||||||
if (_itemDisplayName == "") then {
|
if (_itemDisplayName == "") then {
|
||||||
_itemDisplayName = getText (configFile >> "CfgMagazines" >> _itemName >> "displayName");
|
_itemDisplayName = getText (configFile >> "CfgMagazines" >> _itemName >> "displayName");
|
||||||
};
|
};
|
||||||
|
@ -17,21 +17,20 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_listed", "_actions", "_item", "_displayName", "_picture", "_action"];
|
|
||||||
params ["_target","_player"];
|
params ["_target","_player"];
|
||||||
TRACE_2("params",_target,_player);
|
TRACE_2("params",_target,_player);
|
||||||
|
|
||||||
_listed = [];
|
private _listed = [];
|
||||||
_actions = [];
|
private _actions = [];
|
||||||
|
|
||||||
{
|
{
|
||||||
if !(_x in _listed) then {
|
if !(_x in _listed) then {
|
||||||
_listed pushBack _x;
|
_listed pushBack _x;
|
||||||
_item = ConfigFile >> "CfgMagazines" >> _x;
|
private _item = ConfigFile >> "CfgMagazines" >> _x;
|
||||||
if (getText (_item >> "ACE_Attachable") != "") then {
|
if (getText (_item >> "ACE_Attachable") != "") then {
|
||||||
_displayName = getText(_item >> "displayName");
|
private _displayName = getText(_item >> "displayName");
|
||||||
_picture = getText(_item >> "picture");
|
private _picture = getText(_item >> "picture");
|
||||||
_action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call CBA_fnc_execNextFrame}, {true}, {}, [_x]] call EFUNC(interact_menu,createAction);
|
private _action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call CBA_fnc_execNextFrame}, {true}, {}, [_x]] call EFUNC(interact_menu,createAction);
|
||||||
_actions pushBack [_action, [], _target];
|
_actions pushBack [_action, [], _target];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -40,11 +39,11 @@ _actions = [];
|
|||||||
{
|
{
|
||||||
if !(_x in _listed) then {
|
if !(_x in _listed) then {
|
||||||
_listed pushBack _x;
|
_listed pushBack _x;
|
||||||
_item = ConfigFile >> "CfgWeapons" >> _x;
|
private _item = ConfigFile >> "CfgWeapons" >> _x;
|
||||||
if (getText (_item >> "ACE_Attachable") != "") then {
|
if (getText (_item >> "ACE_Attachable") != "") then {
|
||||||
_displayName = getText(_item >> "displayName");
|
private _displayName = getText(_item >> "displayName");
|
||||||
_picture = getText(_item >> "picture");
|
private _picture = getText(_item >> "picture");
|
||||||
_action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call CBA_fnc_execNextFrame}, {true}, {}, [_x]] call EFUNC(interact_menu,createAction);
|
private _action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call CBA_fnc_execNextFrame}, {true}, {}, [_x]] call EFUNC(interact_menu,createAction);
|
||||||
_actions pushBack [_action, [], _target];
|
_actions pushBack [_action, [], _target];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -25,34 +25,32 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_closeInMax", "_closeInMin", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_attachList"];
|
params ["_unit", "_attachToVehicle", "_itemClassname", "_itemVehClass", "_onAttachText", "_startingPosition"];
|
||||||
|
TRACE_6("params",_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAttachText,_startingPosition);
|
||||||
|
|
||||||
params ["_unit", "_attachToVehicle", "_itemClassname", "_itemVehClass", "_onAtachText", "_startingPosition"];
|
private _startingOffset = _attachToVehicle worldToModel _startingPosition;
|
||||||
TRACE_6("params",_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_startingPosition);
|
|
||||||
|
|
||||||
_startingOffset = _attachToVehicle worldToModel _startingPosition;
|
private _startDistanceFromCenter = vectorMagnitude _startingOffset;
|
||||||
|
private _closeInUnitVector = vectorNormalized (_startingOffset vectorFromTo [0,0,0]);
|
||||||
|
|
||||||
_startDistanceFromCenter = vectorMagnitude _startingOffset;
|
private _closeInMax = _startDistanceFromCenter;
|
||||||
_closeInUnitVector = vectorNormalized (_startingOffset vectorFromTo [0,0,0]);
|
private _closeInMin = 0;
|
||||||
|
|
||||||
_closeInMax = _startDistanceFromCenter;
|
|
||||||
_closeInMin = 0;
|
|
||||||
|
|
||||||
while {(_closeInMax - _closeInMin) > 0.01} do {
|
while {(_closeInMax - _closeInMin) > 0.01} do {
|
||||||
_closeInDistance = (_closeInMax + _closeInMin) / 2;
|
private _closeInDistance = (_closeInMax + _closeInMin) / 2;
|
||||||
// systemChat format ["Trying %1 from %2 start %3", _closeInDistance, [_closeInMax, _closeInMin], _startDistanceFromCenter];
|
// systemChat format ["Trying %1 from %2 start %3", _closeInDistance, [_closeInMax, _closeInMin], _startDistanceFromCenter];
|
||||||
_endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance);
|
private _endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance);
|
||||||
_endPosTestOffset set [2, (_startingOffset select 2)];
|
_endPosTestOffset set [2, (_startingOffset select 2)];
|
||||||
_endPosTest = _attachToVehicle modelToWorldVisual _endPosTestOffset;
|
private _endPosTest = _attachToVehicle modelToWorldVisual _endPosTestOffset;
|
||||||
|
|
||||||
_doesIntersect = false;
|
private _doesIntersect = false;
|
||||||
{
|
{
|
||||||
if (_doesIntersect) exitWith {};
|
if (_doesIntersect) exitWith {};
|
||||||
_startingPosShifted = _startingPosition vectorAdd _x;
|
private _startingPosShifted = _startingPosition vectorAdd _x;
|
||||||
_startASL = if (surfaceIsWater _startingPosShifted) then {_startingPosShifted} else {ATLtoASL _startingPosShifted};
|
private _startASL = if (surfaceIsWater _startingPosShifted) then {_startingPosShifted} else {ATLtoASL _startingPosShifted};
|
||||||
{
|
{
|
||||||
_endPosShifted = _endPosTest vectorAdd _x;
|
private _endPosShifted = _endPosTest vectorAdd _x;
|
||||||
_endASL = if (surfaceIsWater _startingPosShifted) then {_endPosShifted} else {ATLtoASL _endPosShifted};
|
private _endASL = if (surfaceIsWater _startingPosShifted) then {_endPosShifted} else {ATLtoASL _endPosShifted};
|
||||||
|
|
||||||
#ifdef DRAW_ATTACH_SCAN
|
#ifdef DRAW_ATTACH_SCAN
|
||||||
[{
|
[{
|
||||||
@ -78,7 +76,7 @@ while {(_closeInMax - _closeInMin) > 0.01} do {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
_closeInDistance = (_closeInMax + _closeInMin) / 2;
|
private _closeInDistance = (_closeInMax + _closeInMin) / 2;
|
||||||
|
|
||||||
//Checks (too close to center or can't attach)
|
//Checks (too close to center or can't attach)
|
||||||
if (((_startDistanceFromCenter - _closeInDistance) < 0.1) || {!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) exitWith {
|
if (((_startDistanceFromCenter - _closeInDistance) < 0.1) || {!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) exitWith {
|
||||||
@ -90,17 +88,17 @@ if (((_startDistanceFromCenter - _closeInDistance) < 0.1) || {!([_attachToVehicl
|
|||||||
_closeInDistance = (_closeInDistance - 0.0085);
|
_closeInDistance = (_closeInDistance - 0.0085);
|
||||||
|
|
||||||
//Create New 'real' Object
|
//Create New 'real' Object
|
||||||
_endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance);
|
private _endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance);
|
||||||
_endPosTestOffset set [2, (_startingOffset select 2)];
|
_endPosTestOffset set [2, (_startingOffset select 2)];
|
||||||
_attachedObject = _itemVehClass createVehicle (getPos _unit);
|
private _attachedObject = _itemVehClass createVehicle (getPos _unit);
|
||||||
_attachedObject attachTo [_attachToVehicle, _endPosTestOffset];
|
_attachedObject attachTo [_attachToVehicle, _endPosTestOffset];
|
||||||
|
|
||||||
//Remove Item from inventory
|
//Remove Item from inventory
|
||||||
_unit removeItem _itemClassname;
|
_unit removeItem _itemClassname;
|
||||||
|
|
||||||
//Add Object to attached array
|
//Add Object to attached array
|
||||||
_attachList = _attachToVehicle getVariable [QGVAR(attached), []];
|
private _attachList = _attachToVehicle getVariable [QGVAR(attached), []];
|
||||||
_attachList pushBack [_attachedObject, _itemClassname];
|
_attachList pushBack [_attachedObject, _itemClassname];
|
||||||
_attachToVehicle setVariable [QGVAR(attached), _attachList, true];
|
_attachToVehicle setVariable [QGVAR(attached), _attachList, true];
|
||||||
|
|
||||||
[_onAtachText] call EFUNC(common,displayTextStructured);
|
[_onAttachText] call EFUNC(common,displayTextStructured);
|
||||||
|
@ -7,7 +7,7 @@ class CfgAmmo {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class B_556x45_Ball : BulletBase {
|
class B_556x45_Ball : BulletBase {
|
||||||
airFriction=-0.00126466;
|
airFriction=-0.00130094;
|
||||||
tracerScale = 1;
|
tracerScale = 1;
|
||||||
tracerStartTime=0.073; // M856 tracer burns out to 800m
|
tracerStartTime=0.073; // M856 tracer burns out to 800m
|
||||||
tracerEndTime=1.57123; // Time in seconds calculated with ballistics calculator
|
tracerEndTime=1.57123; // Time in seconds calculated with ballistics calculator
|
||||||
@ -23,7 +23,7 @@ class CfgAmmo {
|
|||||||
ACE_barrelLengths[]={210.82, 238.76, 269.24, 299.72, 330.2, 360.68, 391.16, 419.1, 449.58, 480.06, 508.0, 609.6};
|
ACE_barrelLengths[]={210.82, 238.76, 269.24, 299.72, 330.2, 360.68, 391.16, 419.1, 449.58, 480.06, 508.0, 609.6};
|
||||||
};
|
};
|
||||||
class ACE_556x45_Ball_Mk262 : B_556x45_Ball {
|
class ACE_556x45_Ball_Mk262 : B_556x45_Ball {
|
||||||
airFriction=-0.00109563;
|
airFriction=-0.00111805;
|
||||||
ACE_caliber=5.69;
|
ACE_caliber=5.69;
|
||||||
ACE_bulletLength=23.012;
|
ACE_bulletLength=23.012;
|
||||||
ACE_bulletMass=4.9896;
|
ACE_bulletMass=4.9896;
|
||||||
@ -36,7 +36,7 @@ class CfgAmmo {
|
|||||||
ACE_barrelLengths[]={190.5, 368.3, 457.2, 508.0};
|
ACE_barrelLengths[]={190.5, 368.3, 457.2, 508.0};
|
||||||
};
|
};
|
||||||
class ACE_556x45_Ball_Mk318 : B_556x45_Ball {
|
class ACE_556x45_Ball_Mk318 : B_556x45_Ball {
|
||||||
airFriction=-0.00123318;
|
airFriction=-0.0012588;
|
||||||
ACE_caliber=5.69;
|
ACE_caliber=5.69;
|
||||||
ACE_bulletLength=23.012;
|
ACE_bulletLength=23.012;
|
||||||
ACE_bulletMass=4.0176;
|
ACE_bulletMass=4.0176;
|
||||||
@ -49,7 +49,7 @@ class CfgAmmo {
|
|||||||
ACE_barrelLengths[]={254.0, 393.7, 508.0};
|
ACE_barrelLengths[]={254.0, 393.7, 508.0};
|
||||||
};
|
};
|
||||||
class ACE_556x45_Ball_M995_AP : B_556x45_Ball {
|
class ACE_556x45_Ball_M995_AP : B_556x45_Ball {
|
||||||
airFriction=-0.00123272;
|
airFriction=-0.00126182;
|
||||||
caliber=1.6;
|
caliber=1.6;
|
||||||
ACE_caliber=5.69;
|
ACE_caliber=5.69;
|
||||||
ACE_bulletLength=23.012;
|
ACE_bulletLength=23.012;
|
||||||
@ -67,7 +67,7 @@ class CfgAmmo {
|
|||||||
nvgOnly = 1;
|
nvgOnly = 1;
|
||||||
};
|
};
|
||||||
class B_545x39_Ball_F : BulletBase {
|
class B_545x39_Ball_F : BulletBase {
|
||||||
airFriction=-0.00116278;
|
airFriction=-0.00119458;
|
||||||
ACE_caliber=5.588;
|
ACE_caliber=5.588;
|
||||||
ACE_bulletLength=21.59;
|
ACE_bulletLength=21.59;
|
||||||
ACE_bulletMass=3.42792;
|
ACE_bulletMass=3.42792;
|
||||||
@ -83,7 +83,7 @@ class CfgAmmo {
|
|||||||
tracerScale = 0.5;
|
tracerScale = 0.5;
|
||||||
};
|
};
|
||||||
class B_580x42_Ball_F: BulletBase {
|
class B_580x42_Ball_F: BulletBase {
|
||||||
airFriction=-0.00117956;
|
airFriction=-0.00121087;
|
||||||
ACE_caliber=5.9944;
|
ACE_caliber=5.9944;
|
||||||
ACE_bulletLength=24.2;
|
ACE_bulletLength=24.2;
|
||||||
ACE_bulletMass=4.15;
|
ACE_bulletMass=4.15;
|
||||||
@ -96,7 +96,7 @@ class CfgAmmo {
|
|||||||
ACE_barrelLengths[]={369.0, 463.0, 600.0};
|
ACE_barrelLengths[]={369.0, 463.0, 600.0};
|
||||||
};
|
};
|
||||||
class B_65x39_Caseless : BulletBase {
|
class B_65x39_Caseless : BulletBase {
|
||||||
airFriction=-0.00075308;
|
airFriction=-0.00077363;
|
||||||
tracerScale = 1.1; //1.0;
|
tracerScale = 1.1; //1.0;
|
||||||
ACE_caliber=6.706;
|
ACE_caliber=6.706;
|
||||||
ACE_bulletLength=32.893;
|
ACE_bulletLength=32.893;
|
||||||
@ -118,7 +118,7 @@ class CfgAmmo {
|
|||||||
nvgOnly = 1;
|
nvgOnly = 1;
|
||||||
};
|
};
|
||||||
class ACE_65x47_Ball_Scenar: B_65x39_Caseless {
|
class ACE_65x47_Ball_Scenar: B_65x39_Caseless {
|
||||||
airFriction=-0.00067037;
|
airFriction=-0.00069003;
|
||||||
caliber=0.9;
|
caliber=0.9;
|
||||||
ACE_caliber=6.706;
|
ACE_caliber=6.706;
|
||||||
ACE_bulletLength=34.646;
|
ACE_bulletLength=34.646;
|
||||||
@ -132,7 +132,7 @@ class CfgAmmo {
|
|||||||
ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4};
|
ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4};
|
||||||
};
|
};
|
||||||
class ACE_65_Creedmor_Ball: B_65x39_Caseless {
|
class ACE_65_Creedmor_Ball: B_65x39_Caseless {
|
||||||
airFriction=-0.00060887;
|
airFriction=-0.00062437;
|
||||||
caliber=1.1;
|
caliber=1.1;
|
||||||
ACE_caliber=6.706;
|
ACE_caliber=6.706;
|
||||||
ACE_bulletLength=36.22;
|
ACE_bulletLength=36.22;
|
||||||
@ -150,7 +150,7 @@ class CfgAmmo {
|
|||||||
tracerScale = 1.1; //1.0;
|
tracerScale = 1.1; //1.0;
|
||||||
};
|
};
|
||||||
class B_762x51_Ball : BulletBase {
|
class B_762x51_Ball : BulletBase {
|
||||||
airFriction=-0.00100957;
|
airFriction=-0.00103711;
|
||||||
tracerScale = 1.2; //0.6;
|
tracerScale = 1.2; //0.6;
|
||||||
tracerStartTime=0.073; // Based on the British L5A1 which burns out to 1000m
|
tracerStartTime=0.073; // Based on the British L5A1 which burns out to 1000m
|
||||||
tracerEndTime=2.15957; // Time in seconds calculated with ballistics calculator
|
tracerEndTime=2.15957; // Time in seconds calculated with ballistics calculator
|
||||||
@ -170,7 +170,7 @@ class CfgAmmo {
|
|||||||
nvgOnly = 1;
|
nvgOnly = 1;
|
||||||
};
|
};
|
||||||
class ACE_762x51_Ball_M118LR : B_762x51_Ball {
|
class ACE_762x51_Ball_M118LR : B_762x51_Ball {
|
||||||
airFriction=-0.00082828;
|
airFriction=-0.00085157;
|
||||||
caliber=1.8;
|
caliber=1.8;
|
||||||
hit=16;
|
hit=16;
|
||||||
typicalSpeed=790;
|
typicalSpeed=790;
|
||||||
@ -186,7 +186,7 @@ class CfgAmmo {
|
|||||||
ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4};
|
ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4};
|
||||||
};
|
};
|
||||||
class ACE_762x51_Ball_Mk316_Mod_0 : B_762x51_Ball {
|
class ACE_762x51_Ball_Mk316_Mod_0 : B_762x51_Ball {
|
||||||
airFriction=-0.00082029;
|
airFriction=-0.00084311;
|
||||||
caliber=1.8;
|
caliber=1.8;
|
||||||
hit=16;
|
hit=16;
|
||||||
typicalSpeed=790;
|
typicalSpeed=790;
|
||||||
@ -202,7 +202,7 @@ class CfgAmmo {
|
|||||||
ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4};
|
ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4};
|
||||||
};
|
};
|
||||||
class ACE_762x51_Ball_Mk319_Mod_0 : B_762x51_Ball {
|
class ACE_762x51_Ball_Mk319_Mod_0 : B_762x51_Ball {
|
||||||
airFriction=-0.00102338;
|
airFriction=-0.00104515;
|
||||||
caliber=1.5;
|
caliber=1.5;
|
||||||
hit=14;
|
hit=14;
|
||||||
typicalSpeed=900;
|
typicalSpeed=900;
|
||||||
@ -218,7 +218,7 @@ class CfgAmmo {
|
|||||||
ACE_barrelLengths[]={330.2, 406.4, 508.0};
|
ACE_barrelLengths[]={330.2, 406.4, 508.0};
|
||||||
};
|
};
|
||||||
class ACE_762x51_Ball_M993_AP : B_762x51_Ball {
|
class ACE_762x51_Ball_M993_AP : B_762x51_Ball {
|
||||||
airFriction=-0.00107148;
|
airFriction=-0.0010939;
|
||||||
caliber=2.2;
|
caliber=2.2;
|
||||||
hit=11;
|
hit=11;
|
||||||
typicalSpeed=910;
|
typicalSpeed=910;
|
||||||
@ -234,7 +234,7 @@ class CfgAmmo {
|
|||||||
ACE_barrelLengths[]={330.2, 406.4, 508.0};
|
ACE_barrelLengths[]={330.2, 406.4, 508.0};
|
||||||
};
|
};
|
||||||
class ACE_762x51_Ball_Subsonic : B_762x51_Ball {
|
class ACE_762x51_Ball_Subsonic : B_762x51_Ball {
|
||||||
airFriction=-0.00049899;
|
airFriction=-0.00060194;
|
||||||
caliber=1;
|
caliber=1;
|
||||||
hit=6;
|
hit=6;
|
||||||
typicalSpeed=320;
|
typicalSpeed=320;
|
||||||
@ -250,7 +250,7 @@ class CfgAmmo {
|
|||||||
ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4};
|
ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4};
|
||||||
};
|
};
|
||||||
class ACE_762x67_Ball_Mk248_Mod_0 : B_762x51_Ball {
|
class ACE_762x67_Ball_Mk248_Mod_0 : B_762x51_Ball {
|
||||||
airFriction=-0.00070530;
|
airFriction=-0.00072468;
|
||||||
caliber=1.8;
|
caliber=1.8;
|
||||||
hit=17;
|
hit=17;
|
||||||
typicalSpeed=900;
|
typicalSpeed=900;
|
||||||
@ -266,7 +266,7 @@ class CfgAmmo {
|
|||||||
ACE_barrelLengths[]={508.0, 609.6, 660.4};
|
ACE_barrelLengths[]={508.0, 609.6, 660.4};
|
||||||
};
|
};
|
||||||
class ACE_762x67_Ball_Mk248_Mod_1 : B_762x51_Ball {
|
class ACE_762x67_Ball_Mk248_Mod_1 : B_762x51_Ball {
|
||||||
airFriction=-0.00061188;
|
airFriction=-0.00063027;
|
||||||
caliber=1.9;
|
caliber=1.9;
|
||||||
hit=18;
|
hit=18;
|
||||||
typicalSpeed=867;
|
typicalSpeed=867;
|
||||||
@ -282,7 +282,7 @@ class CfgAmmo {
|
|||||||
ACE_barrelLengths[]={508.0, 609.6, 660.4};
|
ACE_barrelLengths[]={508.0, 609.6, 660.4};
|
||||||
};
|
};
|
||||||
class ACE_762x67_Ball_Berger_Hybrid_OTM : B_762x51_Ball {
|
class ACE_762x67_Ball_Berger_Hybrid_OTM : B_762x51_Ball {
|
||||||
airFriction=-0.00053733;
|
airFriction=-0.00055262;
|
||||||
caliber=2.0;
|
caliber=2.0;
|
||||||
hit=19;
|
hit=19;
|
||||||
typicalSpeed=853;
|
typicalSpeed=853;
|
||||||
@ -298,7 +298,7 @@ class CfgAmmo {
|
|||||||
ACE_barrelLengths[]={508.0, 609.6, 660.4};
|
ACE_barrelLengths[]={508.0, 609.6, 660.4};
|
||||||
};
|
};
|
||||||
class B_762x54_Ball: B_762x51_Ball {
|
class B_762x54_Ball: B_762x51_Ball {
|
||||||
airFriction=-0.00100023;
|
airFriction=-0.00102329;
|
||||||
ACE_caliber=7.925;
|
ACE_caliber=7.925;
|
||||||
ACE_bulletLength=28.956;
|
ACE_bulletLength=28.956;
|
||||||
ACE_bulletMass=9.8496;
|
ACE_bulletMass=9.8496;
|
||||||
@ -312,7 +312,7 @@ class CfgAmmo {
|
|||||||
};
|
};
|
||||||
class B_762x54_Tracer_Green;
|
class B_762x54_Tracer_Green;
|
||||||
class ACE_762x54_Ball_7T2 : B_762x54_Tracer_Green {
|
class ACE_762x54_Ball_7T2 : B_762x54_Tracer_Green {
|
||||||
airFriction=-0.00103989;
|
airFriction=-0.00106104;
|
||||||
typicalSpeed=800;
|
typicalSpeed=800;
|
||||||
tracerStartTime=0.073; // Based on the 7T2 which burns three seconds
|
tracerStartTime=0.073; // Based on the 7T2 which burns three seconds
|
||||||
tracerEndTime=3;
|
tracerEndTime=3;
|
||||||
@ -328,7 +328,7 @@ class CfgAmmo {
|
|||||||
ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4};
|
ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4};
|
||||||
};
|
};
|
||||||
class B_762x39_Ball_F : BulletBase {
|
class B_762x39_Ball_F : BulletBase {
|
||||||
airFriction=-0.00151621;
|
airFriction=-0.00154815;
|
||||||
ACE_caliber=7.823;
|
ACE_caliber=7.823;
|
||||||
ACE_bulletLength=28.956;
|
ACE_bulletLength=28.956;
|
||||||
ACE_bulletMass=7.9704;
|
ACE_bulletMass=7.9704;
|
||||||
@ -341,7 +341,7 @@ class CfgAmmo {
|
|||||||
ACE_barrelLengths[]={254.0, 414.02, 508.0};
|
ACE_barrelLengths[]={254.0, 414.02, 508.0};
|
||||||
};
|
};
|
||||||
class B_9x21_Ball : BulletBase {
|
class B_9x21_Ball : BulletBase {
|
||||||
airFriction=-0.00208292;
|
airFriction=-0.00211064;
|
||||||
tracerScale = 0.5;
|
tracerScale = 0.5;
|
||||||
ACE_caliber=9.042;
|
ACE_caliber=9.042;
|
||||||
ACE_bulletLength=15.494;
|
ACE_bulletLength=15.494;
|
||||||
@ -358,7 +358,7 @@ class CfgAmmo {
|
|||||||
tracerScale = 0.5;
|
tracerScale = 0.5;
|
||||||
};
|
};
|
||||||
class ACE_9x19_Ball : B_9x21_Ball {
|
class ACE_9x19_Ball : B_9x21_Ball {
|
||||||
airFriction=-0.0019835;
|
airFriction=-0.00201185;
|
||||||
ACE_caliber=9.017;
|
ACE_caliber=9.017;
|
||||||
ACE_bulletLength=15.494;
|
ACE_bulletLength=15.494;
|
||||||
ACE_bulletMass=8.0352;
|
ACE_bulletMass=8.0352;
|
||||||
@ -371,7 +371,7 @@ class CfgAmmo {
|
|||||||
ACE_barrelLengths[]={101.6, 127.0, 228.6};
|
ACE_barrelLengths[]={101.6, 127.0, 228.6};
|
||||||
};
|
};
|
||||||
class B_93x64_Ball : BulletBase {
|
class B_93x64_Ball : BulletBase {
|
||||||
airFriction=-0.00108571;
|
airFriction=-0.00110727;
|
||||||
ACE_caliber=9.296;
|
ACE_caliber=9.296;
|
||||||
ACE_bulletLength=34.29;
|
ACE_bulletLength=34.29;
|
||||||
ACE_bulletMass=14.904;
|
ACE_bulletMass=14.904;
|
||||||
@ -385,7 +385,7 @@ class CfgAmmo {
|
|||||||
};
|
};
|
||||||
class B_408_Ball : BulletBase {
|
class B_408_Ball : BulletBase {
|
||||||
timeToLive=10;
|
timeToLive=10;
|
||||||
airFriction=-0.00044958;
|
airFriction=-0.00046249;
|
||||||
tracerScale = 1.3;
|
tracerScale = 1.3;
|
||||||
ACE_caliber=10.363;
|
ACE_caliber=10.363;
|
||||||
ACE_bulletLength=55.1942;
|
ACE_bulletLength=55.1942;
|
||||||
@ -401,7 +401,7 @@ class CfgAmmo {
|
|||||||
};
|
};
|
||||||
class ACE_408_Ball : BulletBase {
|
class ACE_408_Ball : BulletBase {
|
||||||
timeToLive=10;
|
timeToLive=10;
|
||||||
airFriction=-0.00063655;
|
airFriction=-0.00065414;
|
||||||
typicalSpeed=1067;
|
typicalSpeed=1067;
|
||||||
tracerScale = 1.3;
|
tracerScale = 1.3;
|
||||||
ACE_caliber=10.363;
|
ACE_caliber=10.363;
|
||||||
@ -418,7 +418,7 @@ class CfgAmmo {
|
|||||||
};
|
};
|
||||||
class B_338_Ball : BulletBase {
|
class B_338_Ball : BulletBase {
|
||||||
timeToLive=10;
|
timeToLive=10;
|
||||||
airFriction=-0.00059133;
|
airFriction=-0.00060841;
|
||||||
ACE_caliber=8.585;
|
ACE_caliber=8.585;
|
||||||
ACE_bulletLength=39.573;
|
ACE_bulletLength=39.573;
|
||||||
ACE_bulletMass=16.2;
|
ACE_bulletMass=16.2;
|
||||||
@ -431,7 +431,7 @@ class CfgAmmo {
|
|||||||
ACE_barrelLengths[]={508.0, 660.4, 711.2};
|
ACE_barrelLengths[]={508.0, 660.4, 711.2};
|
||||||
};
|
};
|
||||||
class B_338_NM_Ball : BulletBase {
|
class B_338_NM_Ball : BulletBase {
|
||||||
airFriction=-0.00052201;
|
airFriction=-0.00053639;
|
||||||
ACE_caliber=8.585;
|
ACE_caliber=8.585;
|
||||||
ACE_bulletLength=43.18;
|
ACE_bulletLength=43.18;
|
||||||
ACE_bulletMass=19.44;
|
ACE_bulletMass=19.44;
|
||||||
@ -445,7 +445,7 @@ class CfgAmmo {
|
|||||||
};
|
};
|
||||||
class ACE_338_Ball : B_338_Ball {
|
class ACE_338_Ball : B_338_Ball {
|
||||||
timeToLive=10;
|
timeToLive=10;
|
||||||
airFriction=-0.00052190;
|
airFriction=-0.00055706;
|
||||||
typicalSpeed=826;
|
typicalSpeed=826;
|
||||||
ACE_caliber=8.585;
|
ACE_caliber=8.585;
|
||||||
ACE_bulletLength=43.18;
|
ACE_bulletLength=43.18;
|
||||||
@ -460,7 +460,7 @@ class CfgAmmo {
|
|||||||
};
|
};
|
||||||
class ACE_338_Ball_API526 : B_338_Ball {
|
class ACE_338_Ball_API526 : B_338_Ball {
|
||||||
timeToLive=10;
|
timeToLive=10;
|
||||||
airFriction=-0.00069611;
|
airFriction=-0.0006922;
|
||||||
caliber=2.8;
|
caliber=2.8;
|
||||||
typicalSpeed=895;
|
typicalSpeed=895;
|
||||||
ACE_caliber=8.585;
|
ACE_caliber=8.585;
|
||||||
@ -478,7 +478,7 @@ class CfgAmmo {
|
|||||||
tracerScale = 1.3; //1.2;
|
tracerScale = 1.3; //1.2;
|
||||||
};
|
};
|
||||||
class B_127x54_Ball : BulletBase {
|
class B_127x54_Ball : BulletBase {
|
||||||
airFriction=-0.00019268;
|
airFriction=-0.00019568;
|
||||||
tracerScale = 1.3;//
|
tracerScale = 1.3;//
|
||||||
ACE_caliber=12.954;
|
ACE_caliber=12.954;
|
||||||
ACE_bulletLength=64.516;
|
ACE_bulletLength=64.516;
|
||||||
@ -493,7 +493,7 @@ class CfgAmmo {
|
|||||||
};
|
};
|
||||||
class B_127x99_Ball : BulletBase {
|
class B_127x99_Ball : BulletBase {
|
||||||
timeToLive=10;
|
timeToLive=10;
|
||||||
airFriction=-0.00057503;
|
airFriction=-0.00058679;
|
||||||
tracerScale = 1.3; //1.2;
|
tracerScale = 1.3; //1.2;
|
||||||
ACE_caliber=12.954;
|
ACE_caliber=12.954;
|
||||||
ACE_bulletLength=58.674;
|
ACE_bulletLength=58.674;
|
||||||
@ -508,7 +508,7 @@ class CfgAmmo {
|
|||||||
};
|
};
|
||||||
class ACE_127x99_API : B_127x99_Ball {
|
class ACE_127x99_API : B_127x99_Ball {
|
||||||
timeToLive=10;
|
timeToLive=10;
|
||||||
airFriction=-0.00057503;
|
airFriction=-0.00058679;
|
||||||
tracerScale = 1.3;//
|
tracerScale = 1.3;//
|
||||||
hit=25;
|
hit=25;
|
||||||
caliber=4.0;
|
caliber=4.0;
|
||||||
@ -525,7 +525,7 @@ class CfgAmmo {
|
|||||||
};
|
};
|
||||||
class ACE_127x99_Ball_AMAX : B_127x99_Ball {
|
class ACE_127x99_Ball_AMAX : B_127x99_Ball {
|
||||||
timeToLive=10;
|
timeToLive=10;
|
||||||
airFriction=-0.00036645;
|
airFriction=-0.00037397;
|
||||||
caliber=3.0;
|
caliber=3.0;
|
||||||
ACE_caliber=12.954;
|
ACE_caliber=12.954;
|
||||||
ACE_bulletLength=64.516;
|
ACE_bulletLength=64.516;
|
||||||
@ -540,7 +540,7 @@ class CfgAmmo {
|
|||||||
};
|
};
|
||||||
class B_127x108_Ball : BulletBase {
|
class B_127x108_Ball : BulletBase {
|
||||||
timeToLive=10;
|
timeToLive=10;
|
||||||
airFriction=-0.00063800;
|
airFriction=-0.00065098;
|
||||||
tracerScale = 1.3; //1.5;
|
tracerScale = 1.3; //1.5;
|
||||||
ACE_caliber=12.979;
|
ACE_caliber=12.979;
|
||||||
ACE_bulletLength=64.008;
|
ACE_bulletLength=64.008;
|
||||||
@ -553,8 +553,12 @@ class CfgAmmo {
|
|||||||
ACE_muzzleVelocities[]={820};
|
ACE_muzzleVelocities[]={820};
|
||||||
ACE_barrelLengths[]={728.98};
|
ACE_barrelLengths[]={728.98};
|
||||||
};
|
};
|
||||||
|
class B_127x108_APDS: B_127x108_Ball {
|
||||||
|
typicalSpeed = 820;
|
||||||
|
airFriction = -0.00065098;
|
||||||
|
};
|
||||||
class B_45ACP_Ball : BulletBase {
|
class B_45ACP_Ball : BulletBase {
|
||||||
airFriction=-0.00081221;
|
airFriction=-0.00082143;
|
||||||
tracerScale = 0.6;
|
tracerScale = 0.6;
|
||||||
ACE_caliber=11.481;
|
ACE_caliber=11.481;
|
||||||
ACE_bulletLength=17.272;
|
ACE_bulletLength=17.272;
|
||||||
@ -568,7 +572,7 @@ class CfgAmmo {
|
|||||||
ACE_barrelLengths[]={101.6, 127.0, 228.6};
|
ACE_barrelLengths[]={101.6, 127.0, 228.6};
|
||||||
};
|
};
|
||||||
class B_50BW_Ball_F : BulletBase {
|
class B_50BW_Ball_F : BulletBase {
|
||||||
airFriction=-0.00202645;
|
airFriction=-0.00205896;
|
||||||
ACE_caliber=12.7;
|
ACE_caliber=12.7;
|
||||||
ACE_bulletLength=24.13;
|
ACE_bulletLength=24.13;
|
||||||
ACE_bulletMass=21.7076;
|
ACE_bulletMass=21.7076;
|
||||||
|
@ -300,6 +300,9 @@ class CfgMagazines {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class 5Rnd_127x108_Mag;
|
class 5Rnd_127x108_Mag;
|
||||||
|
class 5Rnd_127x108_APDS_Mag: 5Rnd_127x108_Mag {
|
||||||
|
initSpeed = 820;
|
||||||
|
};
|
||||||
class ACE_5Rnd_127x99_Mag: 5Rnd_127x108_Mag {
|
class ACE_5Rnd_127x99_Mag: 5Rnd_127x108_Mag {
|
||||||
author = ECSTRING(common,ACETeam);
|
author = ECSTRING(common,ACETeam);
|
||||||
ammo = "B_127x99_Ball";
|
ammo = "B_127x99_Ball";
|
||||||
|
@ -258,7 +258,7 @@
|
|||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Captives_ModuleHandcuffed_Description">
|
<Key ID="STR_ACE_Captives_ModuleHandcuffed_Description">
|
||||||
<English>Sync a unit to make them handcuffed.</English>
|
<English>Sync a unit to make them handcuffed.</English>
|
||||||
<German>Synchronisiere eine Einheit um sie in Handschellen zu legen.</German>
|
<German>Synchronisiere eine Einheit, um sie in Handschellen zu legen.</German>
|
||||||
<Polish>Zsynchronizuj z jednostką, aby została skuta.</Polish>
|
<Polish>Zsynchronizuj z jednostką, aby została skuta.</Polish>
|
||||||
<Portuguese>Sincronizar uma unidade para deixá-la algemada.</Portuguese>
|
<Portuguese>Sincronizar uma unidade para deixá-la algemada.</Portuguese>
|
||||||
<Russian>Синхронизируйте с юнитами, чтобы сделать их связанными.</Russian>
|
<Russian>Синхронизируйте с юнитами, чтобы сделать их связанными.</Russian>
|
||||||
@ -324,13 +324,13 @@
|
|||||||
<Polish>Czy gracze mogą skuwać sojuszników?</Polish>
|
<Polish>Czy gracze mogą skuwać sojuszników?</Polish>
|
||||||
<Spanish>Pueden los jugadores esposar unidades en su propio bando</Spanish>
|
<Spanish>Pueden los jugadores esposar unidades en su propio bando</Spanish>
|
||||||
<Czech>Mohou hráči spoutat jednotky na své straně</Czech>
|
<Czech>Mohou hráči spoutat jednotky na své straně</Czech>
|
||||||
<German>Spieler können eigene Einheiten fesseln. </German>
|
<German>Spieler können eigene Einheiten fesseln</German>
|
||||||
<Portuguese>Os jogadores podem algemar unidades do seu lado</Portuguese>
|
<Portuguese>Os jogadores podem algemar unidades do seu lado</Portuguese>
|
||||||
<French>Les joueurs peuvent utiliser les Serflex sur leur propre camp</French>
|
<French>Les joueurs peuvent utiliser les Serflex sur leur propre camp</French>
|
||||||
<Hungarian>A játékosok megkötözhetik-e a saját oldalukon lévő egységeket</Hungarian>
|
<Hungarian>A játékosok megkötözhetik-e a saját oldalukon lévő egységeket</Hungarian>
|
||||||
<Russian>Разрешить игрокам связывать юнитов своей стороны</Russian>
|
<Russian>Разрешить игрокам связывать юнитов своей стороны</Russian>
|
||||||
<Italian>I giocatori possono ammanettare unità alleate</Italian>
|
<Italian>I giocatori possono ammanettare unità alleate</Italian>
|
||||||
<Japanese>プレイヤーが拘束したユニットの陣営を自陣営に変更させ。</Japanese>
|
<Japanese>プレイヤーが拘束したユニットの陣営を自陣営に変更させます。</Japanese>
|
||||||
<Korean>자기편에게 케이블타이를 사용할 수 있게합니다</Korean>
|
<Korean>자기편에게 케이블타이를 사용할 수 있게합니다</Korean>
|
||||||
<Chinese>玩家可以使用束線帶銬住同陣營隊友</Chinese>
|
<Chinese>玩家可以使用束線帶銬住同陣營隊友</Chinese>
|
||||||
<Chinesesimp>玩家可以使用束线带铐住同阵营队友</Chinesesimp>
|
<Chinesesimp>玩家可以使用束线带铐住同阵营队友</Chinesesimp>
|
||||||
@ -429,21 +429,27 @@
|
|||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Captives_KeyComb_Description">
|
<Key ID="STR_ACE_Captives_KeyComb_Description">
|
||||||
<English>Sets the unit under the cursor captive.</English>
|
<English>Sets the unit under the cursor captive.</English>
|
||||||
<German>Nimmt die Einheit vor dem Cursor fest.</German>
|
<German>Nimmt die Einheit unter dem Cursor fest.</German>
|
||||||
<Japanese>カーソル先のユニットを拘束</Japanese>
|
<Japanese>カーソル先のユニットを拘束</Japanese>
|
||||||
<Italian>Imposta l'unità nello stato di prigioniero.</Italian>
|
<Italian>Imposta l'unità nello stato di prigioniero.</Italian>
|
||||||
|
<Chinese>設置在游標下的單位成俘虜狀態。</Chinese>
|
||||||
|
<Chinesesimp>设置在游标下的单位成俘虏状态。</Chinesesimp>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Captives_ModuleSettings_requireSurrenderAi_name">
|
<Key ID="STR_ACE_Captives_ModuleSettings_requireSurrenderAi_name">
|
||||||
<English>Require AI surrendering</English>
|
<English>Require AI surrendering</English>
|
||||||
<German>Benötigt AI Kapitulation</German>
|
<German>Benötigt für KI Kapitulation</German>
|
||||||
<Italian>Necessita arresa AI</Italian>
|
<Italian>Necessita arresa AI</Italian>
|
||||||
<Japanese>AI の投降を必要とする</Japanese>
|
<Japanese>AI の投降を必要とする</Japanese>
|
||||||
|
<Chinese>需要AI先行投降</Chinese>
|
||||||
|
<Chinesesimp>需要AI先行投降</Chinesesimp>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Captives_ModuleSettings_requireSurrenderAi_description">
|
<Key ID="STR_ACE_Captives_ModuleSettings_requireSurrenderAi_description">
|
||||||
<English>Require AI to surrender before they can be arrested</English>
|
<English>Require AI to surrender before they can be arrested</English>
|
||||||
<German>AI muss sich erst ergeben, bevor sie gefangen genommen werden kann</German>
|
<German>KI muss sich erst ergeben, bevor sie gefangen genommen werden kann</German>
|
||||||
<Italian>Necessita che le AI si arrendano prima di essere arrestate</Italian>
|
<Italian>Necessita che le AI si arrendano prima di essere arrestate</Italian>
|
||||||
<Japanese>AI の拘束は AI が投降している場合に限り可能にします。</Japanese>
|
<Japanese>AI の拘束は AI が投降している場合に限り可能にします。</Japanese>
|
||||||
|
<Chinese>在逮捕AI之前該AI必須先進入投降狀態。</Chinese>
|
||||||
|
<Chinesesimp>在逮捕AI之前该AI必须先进入投降状态。</Chinesesimp>
|
||||||
</Key>
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -230,7 +230,7 @@
|
|||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Cargo_makeLoadable_displayName">
|
<Key ID="STR_ACE_Cargo_makeLoadable_displayName">
|
||||||
<English>Make Object Loadable</English>
|
<English>Make Object Loadable</English>
|
||||||
<German>Füge Objekt zum Frachtsystem hinzu</German>
|
<German>Objekt ein/entladbar machen</German>
|
||||||
<Polish>Ustaw jako ładowalny</Polish>
|
<Polish>Ustaw jako ładowalny</Polish>
|
||||||
<Italian>Rendi oggetto caricabile</Italian>
|
<Italian>Rendi oggetto caricabile</Italian>
|
||||||
<Spanish>Hacer objeto cargable</Spanish>
|
<Spanish>Hacer objeto cargable</Spanish>
|
||||||
@ -245,7 +245,7 @@
|
|||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Cargo_makeLoadable_description">
|
<Key ID="STR_ACE_Cargo_makeLoadable_description">
|
||||||
<English>Sets the synced object as loadable by the cargo system.</English>
|
<English>Sets the synced object as loadable by the cargo system.</English>
|
||||||
<German>Das synchronisierte Objekt wird dem Frachtsystem hinzugefügt und ist be- und entladbar.</German>
|
<German>Das synchronisierte Objekt wird dem Frachtsystem hinzugefügt und ist ein- und entladbar.</German>
|
||||||
<Polish>Ustawia zsynchronizowany obiekt jako możliwy do załadowania poprzez system cargo</Polish>
|
<Polish>Ustawia zsynchronizowany obiekt jako możliwy do załadowania poprzez system cargo</Polish>
|
||||||
<Italian>Imposta l'oggetto sincronizzato come caricabile dal sistema cargo</Italian>
|
<Italian>Imposta l'oggetto sincronizzato come caricabile dal sistema cargo</Italian>
|
||||||
<Spanish>Sincronizar un objecto para hacerlo cargable.</Spanish>
|
<Spanish>Sincronizar un objecto para hacerlo cargable.</Spanish>
|
||||||
@ -275,6 +275,7 @@
|
|||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Cargo_space_edenName">
|
<Key ID="STR_ACE_Cargo_space_edenName">
|
||||||
<English>Cargo Space</English>
|
<English>Cargo Space</English>
|
||||||
|
<German>Frachtraum</German>
|
||||||
<Italian>Spazio Cargo</Italian>
|
<Italian>Spazio Cargo</Italian>
|
||||||
<Japanese>カーゴ スペース</Japanese>
|
<Japanese>カーゴ スペース</Japanese>
|
||||||
<Chinese>貨物空間</Chinese>
|
<Chinese>貨物空間</Chinese>
|
||||||
@ -283,6 +284,7 @@
|
|||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Cargo_space_edenDesc">
|
<Key ID="STR_ACE_Cargo_space_edenDesc">
|
||||||
<English>The cargo space available in this vehicle/container</English>
|
<English>The cargo space available in this vehicle/container</English>
|
||||||
|
<German>Verfügbarer Frachtraum in diesem Fahrzeug/Container</German>
|
||||||
<Italian>Lo spazio disponibile in questo veicolo/container</Italian>
|
<Italian>Lo spazio disponibile in questo veicolo/container</Italian>
|
||||||
<Japanese>この車両/コンテナでカーゴ スペースを使えるようにします</Japanese>
|
<Japanese>この車両/コンテナでカーゴ スペースを使えるようにします</Japanese>
|
||||||
<Chinese>設定此載具/集裝箱可裝載多少貨物</Chinese>
|
<Chinese>設定此載具/集裝箱可裝載多少貨物</Chinese>
|
||||||
@ -291,6 +293,7 @@
|
|||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Cargo_size_edenName">
|
<Key ID="STR_ACE_Cargo_size_edenName">
|
||||||
<English>Cargo Size</English>
|
<English>Cargo Size</English>
|
||||||
|
<German>Frachtgröße</German>
|
||||||
<Italian>Dimensioni Cargo</Italian>
|
<Italian>Dimensioni Cargo</Italian>
|
||||||
<Japanese>カーゴ サイズ</Japanese>
|
<Japanese>カーゴ サイズ</Japanese>
|
||||||
<Chinese>貨物的大小</Chinese>
|
<Chinese>貨物的大小</Chinese>
|
||||||
@ -299,6 +302,7 @@
|
|||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Cargo_size_edenDesc">
|
<Key ID="STR_ACE_Cargo_size_edenDesc">
|
||||||
<English>The cargo space required to hold this object (-1 for unloadable)</English>
|
<English>The cargo space required to hold this object (-1 for unloadable)</English>
|
||||||
|
<German>Frachtraumgröße, welche zum Einladen dieses Objektes benötigt wird (-1 nicht einladbar)</German>
|
||||||
<Italian>Lo spazio del cargo necessita di mantenere questo oggetto (-1 per scaricabile)</Italian>
|
<Italian>Lo spazio del cargo necessita di mantenere questo oggetto (-1 per scaricabile)</Italian>
|
||||||
<Japanese>このオブジェクトを積載するのに必要なカーゴ スペース (-1 で積載不可)</Japanese>
|
<Japanese>このオブジェクトを積載するのに必要なカーゴ スペース (-1 で積載不可)</Japanese>
|
||||||
<Chinese>此貨物會佔掉多少空間(設定-1的話此貨物就不能被裝載)</Chinese>
|
<Chinese>此貨物會佔掉多少空間(設定-1的話此貨物就不能被裝載)</Chinese>
|
||||||
@ -329,6 +333,7 @@
|
|||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Cargo_paradropTimeCoefficent">
|
<Key ID="STR_ACE_Cargo_paradropTimeCoefficent">
|
||||||
<English>Paradrop Time Coffecient</English>
|
<English>Paradrop Time Coffecient</English>
|
||||||
|
<German>Türlast Zeitfaktor</German>
|
||||||
<Japanese>空中投下までの時間係数</Japanese>
|
<Japanese>空中投下までの時間係数</Japanese>
|
||||||
<Italian>Coefficente Tempo Lancio Paracadute</Italian>
|
<Italian>Coefficente Tempo Lancio Paracadute</Italian>
|
||||||
<French>Coefficient Temps de largage de cargaison</French>
|
<French>Coefficient Temps de largage de cargaison</French>
|
||||||
@ -338,6 +343,7 @@
|
|||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Cargo_paradropTimeCoefficent_description">
|
<Key ID="STR_ACE_Cargo_paradropTimeCoefficent_description">
|
||||||
<English>Modifier for how long it takes to paradrop a cargo item.</English>
|
<English>Modifier for how long it takes to paradrop a cargo item.</English>
|
||||||
|
<German>Beeinflusst die zusätzliche Zeit für Türlastabwürfe.</German>
|
||||||
<Japanese>カーゴ アイテムを空中投下するまでの時間を変更します。</Japanese>
|
<Japanese>カーゴ アイテムを空中投下するまでの時間を変更します。</Japanese>
|
||||||
<Italian>Modificato per quanto tempo ci impiega a paracadutare un oggetto cargo.</Italian>
|
<Italian>Modificato per quanto tempo ci impiega a paracadutare un oggetto cargo.</Italian>
|
||||||
<French>Modifier le temps qu'il faut pour larguer la cargaison.</French>
|
<French>Modifier le temps qu'il faut pour larguer la cargaison.</French>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project name="ACE">
|
<Project name="ACE">
|
||||||
<Package name="Chemlights">
|
<Package name="Chemlights">
|
||||||
<Key ID="STR_ACE_Chemlights_Action_Chemlights">
|
<Key ID="STR_ACE_Chemlights_Action_Chemlights">
|
||||||
@ -333,8 +333,8 @@
|
|||||||
<Korean>초록빛 조명</Korean>
|
<Korean>초록빛 조명</Korean>
|
||||||
<French>Lampe d'orientation verte.</French>
|
<French>Lampe d'orientation verte.</French>
|
||||||
<Italian>Luce da lettura Verde.</Italian>
|
<Italian>Luce da lettura Verde.</Italian>
|
||||||
<Chinese>綠色閱讀燈.</Chinese>
|
<Chinese>綠色閱讀燈。</Chinese>
|
||||||
<Chinesesimp>绿色阅读灯.</Chinesesimp>
|
<Chinesesimp>绿色阅读灯。</Chinesesimp>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Chemlights_Shield_Red_DisplayName">
|
<Key ID="STR_ACE_Chemlights_Shield_Red_DisplayName">
|
||||||
<English>Chemlight Shield (Red)</English>
|
<English>Chemlight Shield (Red)</English>
|
||||||
@ -355,8 +355,8 @@
|
|||||||
<Korean>빨간색 조명</Korean>
|
<Korean>빨간색 조명</Korean>
|
||||||
<French>Lampe d'orientation rouge.</French>
|
<French>Lampe d'orientation rouge.</French>
|
||||||
<Italian>Luce da lettura Rossa.</Italian>
|
<Italian>Luce da lettura Rossa.</Italian>
|
||||||
<Chinese>紅色閱讀燈.</Chinese>
|
<Chinese>紅色閱讀燈。</Chinese>
|
||||||
<Chinesesimp>红色阅读灯.</Chinesesimp>
|
<Chinesesimp>红色阅读灯。</Chinesesimp>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Chemlights_Shield_Blue_DisplayName">
|
<Key ID="STR_ACE_Chemlights_Shield_Blue_DisplayName">
|
||||||
<English>Chemlight Shield (Blue)</English>
|
<English>Chemlight Shield (Blue)</English>
|
||||||
@ -377,8 +377,8 @@
|
|||||||
<Korean>파란색 조명</Korean>
|
<Korean>파란색 조명</Korean>
|
||||||
<French>Lampe d'orientation bleue.</French>
|
<French>Lampe d'orientation bleue.</French>
|
||||||
<Italian>Luce da lettura Blu.</Italian>
|
<Italian>Luce da lettura Blu.</Italian>
|
||||||
<Chinese>藍色閱讀燈.</Chinese>
|
<Chinese>藍色閱讀燈。</Chinese>
|
||||||
<Chinesesimp>蓝色阅读灯.</Chinesesimp>
|
<Chinesesimp>蓝色阅读灯。</Chinesesimp>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Chemlights_Shield_Yellow_DisplayName">
|
<Key ID="STR_ACE_Chemlights_Shield_Yellow_DisplayName">
|
||||||
<English>Chemlight Shield (Yellow)</English>
|
<English>Chemlight Shield (Yellow)</English>
|
||||||
@ -399,8 +399,8 @@
|
|||||||
<Korean>노란색 조명</Korean>
|
<Korean>노란색 조명</Korean>
|
||||||
<French>Lampe d'orientation jaune.</French>
|
<French>Lampe d'orientation jaune.</French>
|
||||||
<Italian>Luce da lettura Gialla.</Italian>
|
<Italian>Luce da lettura Gialla.</Italian>
|
||||||
<Chinese>黃色閱讀燈.</Chinese>
|
<Chinese>黃色閱讀燈。</Chinese>
|
||||||
<Chinesesimp>黄色阅读灯.</Chinesesimp>
|
<Chinesesimp>黄色阅读灯。</Chinesesimp>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Chemlights_Shield_Orange_DisplayName">
|
<Key ID="STR_ACE_Chemlights_Shield_Orange_DisplayName">
|
||||||
<English>Chemlight Shield (Orange)</English>
|
<English>Chemlight Shield (Orange)</English>
|
||||||
@ -421,8 +421,8 @@
|
|||||||
<Korean>주황색 조명</Korean>
|
<Korean>주황색 조명</Korean>
|
||||||
<French>Lampe d'orientation orange.</French>
|
<French>Lampe d'orientation orange.</French>
|
||||||
<Italian>Luce da lettura Arancione.</Italian>
|
<Italian>Luce da lettura Arancione.</Italian>
|
||||||
<Chinese>橘色閱讀燈.</Chinese>
|
<Chinese>橘色閱讀燈。</Chinese>
|
||||||
<Chinesesimp>橘色阅读灯.</Chinesesimp>
|
<Chinesesimp>橘色阅读灯。</Chinesesimp>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Chemlights_Shield_White_DisplayName">
|
<Key ID="STR_ACE_Chemlights_Shield_White_DisplayName">
|
||||||
<English>Chemlight Shield (White)</English>
|
<English>Chemlight Shield (White)</English>
|
||||||
@ -443,8 +443,8 @@
|
|||||||
<Korean>주황색 조명</Korean>
|
<Korean>주황색 조명</Korean>
|
||||||
<French>Lampe d'orientation blanche.</French>
|
<French>Lampe d'orientation blanche.</French>
|
||||||
<Italian>Luce da lettura Bianca.</Italian>
|
<Italian>Luce da lettura Bianca.</Italian>
|
||||||
<Chinese>白色閱讀燈.</Chinese>
|
<Chinese>白色閱讀燈。</Chinese>
|
||||||
<Chinesesimp>白色阅读灯.</Chinesesimp>
|
<Chinesesimp>白色阅读灯。</Chinesesimp>
|
||||||
</Key>
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -23,7 +23,8 @@ params ["_unit", "_classname", ["_container", ""], ["_ammoCount", -1]];
|
|||||||
|
|
||||||
private _type = _classname call FUNC(getItemType);
|
private _type = _classname call FUNC(getItemType);
|
||||||
|
|
||||||
private ["_canAdd", "_addedToUnit"];
|
private _canAdd = false;
|
||||||
|
private _addedToUnit = false;
|
||||||
|
|
||||||
switch (_container) do {
|
switch (_container) do {
|
||||||
case "vest": {
|
case "vest": {
|
||||||
|
@ -1,23 +1,21 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Glowbal
|
* Author: Glowbal
|
||||||
* Check if unit has item
|
* Check if unit has item. Note: case-sensitive.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Unit <OBJECT>
|
* 0: Unit <OBJECT>
|
||||||
* 1: Item Classname <STRING>
|
* 1: Item Classname <STRING>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* has Item <BOOL>
|
* Unit has Item <BOOL>
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [[bob, "item"] call ace_common_fnc_hasItem
|
* [bob, "item"] call ace_common_fnc_hasItem
|
||||||
*
|
*
|
||||||
* Public: yes
|
* Public: Yes
|
||||||
*
|
|
||||||
* Note: Case sensitive
|
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params [["_unit", objNull, [objNull]], ["_item", "", [""]]];
|
params [["_unit", objNull, [objNull]], ["_item", "", [""]]];
|
||||||
|
|
||||||
_item in items _unit // return
|
_item in items _unit
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#define DEBUG_MODE_FULL
|
// #define DEBUG_MODE_FULL
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_soundClass", "_posASL", "_volume", "_distance"];
|
params ["_soundClass", "_posASL", "_volume", "_distance"];
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
// by commy2
|
// by commy2
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_client", "_clientVersion", "_count", "_error", "_files", "_index", "_missingAddon", "_missingAddonServer", "_missingAddons", "_missingAddonsServer", "_oldVersionClient", "_oldVersionServer", "_oldVersionsClient", "_oldVersionsServer", "_serverFiles", "_serverVersion", "_serverVersions", "_string", "_version", "_versions"];
|
private _files = [];
|
||||||
|
|
||||||
_files = [];
|
|
||||||
|
|
||||||
{
|
{
|
||||||
if (_x find "a3_" != 0 && {_x find "ace_" != 0} && {!(toLower _x in (missionNamespace getVariable ["ACE_Version_Whitelist", []]))}) then {
|
if (_x find "a3_" != 0 && {_x find "ace_" != 0} && {!(toLower _x in (missionNamespace getVariable ["ACE_Version_Whitelist", []]))}) then {
|
||||||
@ -11,9 +9,9 @@ _files = [];
|
|||||||
};
|
};
|
||||||
} forEach activatedAddons;
|
} forEach activatedAddons;
|
||||||
|
|
||||||
_versions = [];
|
private _versions = [];
|
||||||
{
|
{
|
||||||
_version = parseNumber getText (configFile >> "CfgPatches" >> _x >> "version");
|
private _version = parseNumber getText (configFile >> "CfgPatches" >> _x >> "version");
|
||||||
_versions set [_forEachIndex, _version];
|
_versions set [_forEachIndex, _version];
|
||||||
} forEach _files;
|
} forEach _files;
|
||||||
|
|
||||||
@ -32,27 +30,27 @@ if (!isServer) then {
|
|||||||
!isNil "ACE_Version_ClientVersions" && {!isNil "ACE_Version_ServerVersions"}
|
!isNil "ACE_Version_ClientVersions" && {!isNil "ACE_Version_ServerVersions"}
|
||||||
};
|
};
|
||||||
|
|
||||||
_client = profileName;
|
private _client = profileName;
|
||||||
|
|
||||||
_files = ACE_Version_ClientVersions select 0;
|
_files = ACE_Version_ClientVersions select 0;
|
||||||
_versions = ACE_Version_ClientVersions select 1;
|
_versions = ACE_Version_ClientVersions select 1;
|
||||||
|
|
||||||
_serverFiles = ACE_Version_ServerVersions select 0;
|
private _serverFiles = ACE_Version_ServerVersions select 0;
|
||||||
_serverVersions = ACE_Version_ServerVersions select 1;
|
private _serverVersions = ACE_Version_ServerVersions select 1;
|
||||||
|
|
||||||
// Compare client and server files and versions
|
// Compare client and server files and versions
|
||||||
_missingAddons = [];
|
private _missingAddons = [];
|
||||||
_oldVersionsClient = [];
|
private _oldVersionsClient = [];
|
||||||
_oldVersionsServer = [];
|
private _oldVersionsServer = [];
|
||||||
{
|
{
|
||||||
_serverVersion = _serverVersions select _forEachIndex;
|
private _serverVersion = _serverVersions select _forEachIndex;
|
||||||
|
|
||||||
_index = _files find _x;
|
private _index = _files find _x;
|
||||||
if (_index == -1) then {
|
if (_index == -1) then {
|
||||||
if (_x != "ace_server") then {_missingAddons pushBack _x;};
|
if (_x != "ace_server") then {_missingAddons pushBack _x;};
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
_clientVersion = _versions select _index;
|
private _clientVersion = _versions select _index;
|
||||||
|
|
||||||
if (_clientVersion < _serverVersion) then {
|
if (_clientVersion < _serverVersion) then {
|
||||||
_oldVersionsClient pushBack [_x, _clientVersion, _serverVersion];
|
_oldVersionsClient pushBack [_x, _clientVersion, _serverVersion];
|
||||||
@ -65,9 +63,9 @@ if (!isServer) then {
|
|||||||
} forEach _serverFiles;
|
} forEach _serverFiles;
|
||||||
|
|
||||||
// find client files which the server doesn't have
|
// find client files which the server doesn't have
|
||||||
_missingAddonsServer = [];
|
private _missingAddonsServer = [];
|
||||||
{
|
{
|
||||||
_index = _serverFiles find _x;
|
private _index = _serverFiles find _x;
|
||||||
if (_index == -1) then {
|
if (_index == -1) then {
|
||||||
_missingAddonsServer pushBack _x;
|
_missingAddonsServer pushBack _x;
|
||||||
}
|
}
|
||||||
@ -75,10 +73,10 @@ if (!isServer) then {
|
|||||||
|
|
||||||
// display and log error messages
|
// display and log error messages
|
||||||
private _fnc_cutComma = {
|
private _fnc_cutComma = {
|
||||||
_string = _this;
|
private _string = _this;
|
||||||
_string = toArray _string;
|
_string = toArray _string;
|
||||||
|
|
||||||
_count = count _string;
|
private _count = count _string;
|
||||||
_string set [_count - 2, toArray "." select 0];
|
_string set [_count - 2, toArray "." select 0];
|
||||||
_string set [_count - 1, -1];
|
_string set [_count - 1, -1];
|
||||||
_string = _string - [-1];
|
_string = _string - [-1];
|
||||||
@ -86,11 +84,11 @@ if (!isServer) then {
|
|||||||
toString _string;
|
toString _string;
|
||||||
};
|
};
|
||||||
|
|
||||||
_missingAddon = false;
|
private _missingAddon = false;
|
||||||
if (count _missingAddons > 0) then {
|
if (count _missingAddons > 0) then {
|
||||||
_missingAddon = true;
|
_missingAddon = true;
|
||||||
|
|
||||||
_error = format ["[ACE] %1: ERROR missing addon(s): ", _client];
|
private _error = format ["[ACE] %1: ERROR missing addon(s): ", _client];
|
||||||
{
|
{
|
||||||
_error = _error + format ["%1, ", _x];
|
_error = _error + format ["%1, ", _x];
|
||||||
|
|
||||||
@ -103,11 +101,11 @@ if (!isServer) then {
|
|||||||
[QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent;
|
[QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent;
|
||||||
};
|
};
|
||||||
|
|
||||||
_missingAddonServer = false;
|
private _missingAddonServer = false;
|
||||||
if (count _missingAddonsServer > 0) then {
|
if (count _missingAddonsServer > 0) then {
|
||||||
_missingAddonServer = true;
|
_missingAddonServer = true;
|
||||||
|
|
||||||
_error = format ["[ACE] %1: ERROR missing server addon(s): ", _client];
|
private _error = format ["[ACE] %1: ERROR missing server addon(s): ", _client];
|
||||||
{
|
{
|
||||||
_error = _error + format ["%1, ", _x];
|
_error = _error + format ["%1, ", _x];
|
||||||
|
|
||||||
@ -120,11 +118,11 @@ if (!isServer) then {
|
|||||||
[QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent;
|
[QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent;
|
||||||
};
|
};
|
||||||
|
|
||||||
_oldVersionClient = false;
|
private _oldVersionClient = false;
|
||||||
if (count _oldVersionsClient > 0) then {
|
if (count _oldVersionsClient > 0) then {
|
||||||
_oldVersionClient = true;
|
_oldVersionClient = true;
|
||||||
|
|
||||||
_error = format ["[ACE] %1: ERROR outdated addon(s): ", _client];
|
private _error = format ["[ACE] %1: ERROR outdated addon(s): ", _client];
|
||||||
{
|
{
|
||||||
_error = _error + format ["%1 (client: %2, server: %3), ", _x select 0, _x select 1, _x select 2];
|
_error = _error + format ["%1 (client: %2, server: %3), ", _x select 0, _x select 1, _x select 2];
|
||||||
|
|
||||||
@ -137,11 +135,11 @@ if (!isServer) then {
|
|||||||
[QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent;
|
[QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent;
|
||||||
};
|
};
|
||||||
|
|
||||||
_oldVersionServer = false;
|
private _oldVersionServer = false;
|
||||||
if (count _oldVersionsServer > 0) then {
|
if (count _oldVersionsServer > 0) then {
|
||||||
_oldVersionServer = true;
|
_oldVersionServer = true;
|
||||||
|
|
||||||
_error = format ["[ACE] %1: ERROR outdated server addon(s): ", _client];
|
private _error = format ["[ACE] %1: ERROR outdated server addon(s): ", _client];
|
||||||
{
|
{
|
||||||
_error = _error + format ["%1 (client: %2, server: %3), ", _x select 0, _x select 1, _x select 2];
|
_error = _error + format ["%1 (client: %2, server: %3), ", _x select 0, _x select 1, _x select 2];
|
||||||
|
|
||||||
|
@ -475,8 +475,8 @@
|
|||||||
<Portuguese>Aceitar pedidos enviados por outros jogadores. Podem ser pedidos para usar/ compartilhar equipamento, realizar certas ações.</Portuguese>
|
<Portuguese>Aceitar pedidos enviados por outros jogadores. Podem ser pedidos para usar/ compartilhar equipamento, realizar certas ações.</Portuguese>
|
||||||
<Japanese>他プレイヤからの要求を許可します。他プレイヤは装備を共有し、使うなど特定の動作を行えます。</Japanese>
|
<Japanese>他プレイヤからの要求を許可します。他プレイヤは装備を共有し、使うなど特定の動作を行えます。</Japanese>
|
||||||
<Korean>다른 플레이어가 보내온 요청을 수락합니다. 이것은 장비 사용 / 공유 요청, 특정 작업 수행 등이 될 수 있습니다.</Korean>
|
<Korean>다른 플레이어가 보내온 요청을 수락합니다. 이것은 장비 사용 / 공유 요청, 특정 작업 수행 등이 될 수 있습니다.</Korean>
|
||||||
<Chinese>接受由其他玩家送出的請求. 包含使用/共享裝備與執行特定動作</Chinese>
|
<Chinese>接受由其他玩家送出的請求。包含使用/共享裝備與執行特定動作。</Chinese>
|
||||||
<Chinesesimp>接受由其他玩家送出的请求. 包含使用/共享装备与执行特定动作</Chinesesimp>
|
<Chinesesimp>接受由其他玩家送出的请求。包含使用/共享装备与执行特定动作。</Chinesesimp>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_ACTION_DECLINE_REQUEST_KEY_TOOLTIP">
|
<Key ID="STR_ACE_ACTION_DECLINE_REQUEST_KEY_TOOLTIP">
|
||||||
<English>Decline Requests send by other players. These can be requests to use / share equipment, perform certain actions.</English>
|
<English>Decline Requests send by other players. These can be requests to use / share equipment, perform certain actions.</English>
|
||||||
@ -491,8 +491,8 @@
|
|||||||
<Portuguese>Rejeita pedidos enviados por outros jogadores. Podem ser pedidos para usar/ compartilhar equipamento, realizar certas ações.</Portuguese>
|
<Portuguese>Rejeita pedidos enviados por outros jogadores. Podem ser pedidos para usar/ compartilhar equipamento, realizar certas ações.</Portuguese>
|
||||||
<Japanese>他プレイヤからの要求を拒否します。他プレイヤは装備を共有し、使うなど特定の動作をできません。</Japanese>
|
<Japanese>他プレイヤからの要求を拒否します。他プレイヤは装備を共有し、使うなど特定の動作をできません。</Japanese>
|
||||||
<Korean>다른 플레이어가 보내온 요청을 거부합니다. 이것은 장비 사용 / 공유 요청, 특정 작업 수행 등이 될 수 있습니다.</Korean>
|
<Korean>다른 플레이어가 보내온 요청을 거부합니다. 이것은 장비 사용 / 공유 요청, 특정 작업 수행 등이 될 수 있습니다.</Korean>
|
||||||
<Chinese>拒絕由其他玩家送出的請求. 包含使用/共享裝備與執行特定動作</Chinese>
|
<Chinese>拒絕由其他玩家送出的請求。包含使用/共享裝備與執行特定動作。</Chinese>
|
||||||
<Chinesesimp>拒绝由其他玩家送出的请求. 包含使用/共享装备与执行特定动作</Chinesesimp>
|
<Chinesesimp>拒绝由其他玩家送出的请求。包含使用/共享装备与执行特定动作。</Chinesesimp>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Common_SettingFeedbackIconsName">
|
<Key ID="STR_ACE_Common_SettingFeedbackIconsName">
|
||||||
<English>Feedback icons</English>
|
<English>Feedback icons</English>
|
||||||
@ -523,8 +523,8 @@
|
|||||||
<Portuguese>Selecione a posição ou disabilite a posição dos ícones de feedback na sua tela. Esses ícones irão aparecer para mostrar feedback extra do status do seu personagem e ações realizadas.</Portuguese>
|
<Portuguese>Selecione a posição ou disabilite a posição dos ícones de feedback na sua tela. Esses ícones irão aparecer para mostrar feedback extra do status do seu personagem e ações realizadas.</Portuguese>
|
||||||
<Japanese>画面上に表示するフィードバック アイコンの位置や無効化を選択できます。このアイコンは自キャラクター状態や動作の状況をフィードバックするために表示されています。</Japanese>
|
<Japanese>画面上に表示するフィードバック アイコンの位置や無効化を選択できます。このアイコンは自キャラクター状態や動作の状況をフィードバックするために表示されています。</Japanese>
|
||||||
<Korean>피드백 아이콘의 위치를 설정하거나 비활성화합니다. 피드백 아이콘은 캐릭터의 상세정보와 행동을 보여줍니다.</Korean>
|
<Korean>피드백 아이콘의 위치를 설정하거나 비활성화합니다. 피드백 아이콘은 캐릭터의 상세정보와 행동을 보여줍니다.</Korean>
|
||||||
<Chinese>選擇位置或取消回饋圖標顯示在螢幕上. 這些圖標將顯示出你角色額外的狀態與行動等資訊.</Chinese>
|
<Chinese>選擇位置或取消回饋圖標顯示在螢幕上。這些圖標將顯示出你角色額外的狀態與行動等資訊。</Chinese>
|
||||||
<Chinesesimp>选择位置或取消回馈图标显示在荧幕上. 这些图标将显示出你角色额外的状态与行动等资讯.</Chinesesimp>
|
<Chinesesimp>选择位置或取消回馈图标显示在荧幕上。这些图标将显示出你角色额外的状态与行动等资讯。</Chinesesimp>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Common_SettingProgressbarLocationName">
|
<Key ID="STR_ACE_Common_SettingProgressbarLocationName">
|
||||||
<English>Progress bar location</English>
|
<English>Progress bar location</English>
|
||||||
@ -619,8 +619,8 @@
|
|||||||
<Portuguese>A cor do texto das hints do ACE. Essa cor é a cor default para todos os texos exibidos pelo sistema de hints do ACE , caso o texto da hint não tem outra cor especificada.</Portuguese>
|
<Portuguese>A cor do texto das hints do ACE. Essa cor é a cor default para todos os texos exibidos pelo sistema de hints do ACE , caso o texto da hint não tem outra cor especificada.</Portuguese>
|
||||||
<Japanese>ACE によるヒントの文章へ、色を設定できます。この色は ACE ヒント システムを介して表示される全文章の色と標準でなっており、特定の色を設定していても、標準色になります。</Japanese>
|
<Japanese>ACE によるヒントの文章へ、色を設定できます。この色は ACE ヒント システムを介して表示される全文章の色と標準でなっており、特定の色を設定していても、標準色になります。</Japanese>
|
||||||
<Korean>ACE 힌트에 쓰이는 글씨 색입니다. 힌트 글씨의 색이 정해지지 않을경우 모든 힌트의 색은 기본으로 설정됩니다.</Korean>
|
<Korean>ACE 힌트에 쓰이는 글씨 색입니다. 힌트 글씨의 색이 정해지지 않을경우 모든 힌트의 색은 기본으로 설정됩니다.</Korean>
|
||||||
<Chinese>設定ACE提示文字的顏色. 若提示字體並無指定其他顏色, 將會自動選用ACE系統的預設顏色</Chinese>
|
<Chinese>設定ACE提示文字的顏色。若提示字體並無指定其他顏色,將會自動選用ACE系統的預設顏色。</Chinese>
|
||||||
<Chinesesimp>设定ACE提示文字的颜色. 若提示字体并无指定其他颜色, 将会自动选用ACE系统的预设颜色</Chinesesimp>
|
<Chinesesimp>设定ACE提示文字的颜色。若提示字体并无指定其他颜色,将会自动选用ACE系统的预设颜色。</Chinesesimp>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Common_bananaDisplayName">
|
<Key ID="STR_ACE_Common_bananaDisplayName">
|
||||||
<English>Banana</English>
|
<English>Banana</English>
|
||||||
@ -651,8 +651,8 @@
|
|||||||
<Portuguese>A banana é uma fruta comestível, botanicamente uma baga, produzida por vários tipos de plantas herbáceas grandes do genero Musa.</Portuguese>
|
<Portuguese>A banana é uma fruta comestível, botanicamente uma baga, produzida por vários tipos de plantas herbáceas grandes do genero Musa.</Portuguese>
|
||||||
<Japanese>甘蕉は食べられる果物でバショウ科バショウ属のうち、果実を食用とする品種群の総称。また、その果実のこと。いくつかの原種から育種された多年草。種によっては熟すまでは毒を持つものもある。</Japanese>
|
<Japanese>甘蕉は食べられる果物でバショウ科バショウ属のうち、果実を食用とする品種群の総称。また、その果実のこと。いくつかの原種から育種された多年草。種によっては熟すまでは毒を持つものもある。</Japanese>
|
||||||
<Korean>바나나는 식용 과일로써 식물학적으로 열매류이며 여러 종류의 개화가능한 초본의 파초과로 부터 생산됩니다.</Korean>
|
<Korean>바나나는 식용 과일로써 식물학적으로 열매류이며 여러 종류의 개화가능한 초본의 파초과로 부터 생산됩니다.</Korean>
|
||||||
<Chinese>香蕉(學名: Musa × paradisiaca), 為芭蕉科芭蕉屬小果野蕉及野蕉的人工栽培雜交種, 為多年生草本植物. 果實長有棱; 果皮黃色, 果肉白色, 味道香甜. 主要生長在熱帶、亞熱帶地區. 原產於亞洲東南部熱帶、亞熱帶地區.</Chinese>
|
<Chinese>香蕉(學名: Musa × paradisiaca),為芭蕉科芭蕉屬小果野蕉及野蕉的人工栽培雜交種,為多年生草本植物。果實長有棱; 果皮黃色,果肉白色,味道香甜。主要生長在熱帶、亞熱帶地區。原產於亞洲東南部熱帶、亞熱帶地區。</Chinese>
|
||||||
<Chinesesimp>香蕉(学名: Musa × paradisiaca), 为芭蕉科芭蕉属小果野蕉及野蕉的人工栽培杂交种, 为多年生草本植物. 果实长有棱; 果皮黄色, 果肉白色, 味道香甜. 主要生长在热带、亚热带地区. 原产于亚洲东南部热带、亚热带地区.</Chinesesimp>
|
<Chinesesimp>香蕉(学名: Musa × paradisiaca),为芭蕉科芭蕉属小果野蕉及野蕉的人工栽培杂交种,为多年生草本植物。果实长有棱; 果皮黄色,果肉白色,味道香甜。主要生长在热带、亚热带地区。原产于亚洲东南部热带、亚热带地区。</Chinesesimp>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Common_CheckPBO_DisplayName">
|
<Key ID="STR_ACE_Common_CheckPBO_DisplayName">
|
||||||
<English>Check PBOs</English>
|
<English>Check PBOs</English>
|
||||||
@ -682,8 +682,8 @@
|
|||||||
<Italian>Controlla l'integrità degli addon con il server ed esegui l'azione selezionata se un addon è mancante</Italian>
|
<Italian>Controlla l'integrità degli addon con il server ed esegui l'azione selezionata se un addon è mancante</Italian>
|
||||||
<Japanese>サーバがアドオンの整合性を検査し、もし不備があれば実行する動作を選択できます。</Japanese>
|
<Japanese>サーバがアドオンの整合性を検査し、もし不備があれば実行する動作を選択できます。</Japanese>
|
||||||
<Korean>서버 에드온의 무결성을 검사하고 사라진 에드온이 있을경우 행동을 선택합니다.</Korean>
|
<Korean>서버 에드온의 무결성을 검사하고 사라진 에드온이 있을경우 행동을 선택합니다.</Korean>
|
||||||
<Chinese>檢查客戶端與伺服器端的模組清單是否一致且完整, 並提供訊息表示遺失的模組.</Chinese>
|
<Chinese>檢查客戶端與伺服器端的模組清單是否一致且完整,並提供訊息表示遺失的模組。</Chinese>
|
||||||
<Chinesesimp>检查客户端与伺服器端的模组清单是否一致且完整, 并提供讯息表示遗失的模组.</Chinesesimp>
|
<Chinesesimp>检查客户端与伺服器端的模组清单是否一致且完整,并提供讯息表示遗失的模组。</Chinesesimp>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Common_CheckPBO_Action_DisplayName">
|
<Key ID="STR_ACE_Common_CheckPBO_Action_DisplayName">
|
||||||
<English>Action</English>
|
<English>Action</English>
|
||||||
@ -714,8 +714,8 @@
|
|||||||
<Italian>Cosa fare con giocatori che non hanno i PBO corretti?</Italian>
|
<Italian>Cosa fare con giocatori che non hanno i PBO corretti?</Italian>
|
||||||
<Japanese>プレイヤーが正しい PBO を持っていない場合は?</Japanese>
|
<Japanese>プレイヤーが正しい PBO を持っていない場合は?</Japanese>
|
||||||
<Korean>올바르지 않는 PBO를 가진 사람을 어떻게 할까요?</Korean>
|
<Korean>올바르지 않는 PBO를 가진 사람을 어떻게 할까요?</Korean>
|
||||||
<Chinese>若玩家沒有正確的PBO檔時, 將採取何種動作?</Chinese>
|
<Chinese>若玩家沒有正確的PBO檔時,將採取何種動作?</Chinese>
|
||||||
<Chinesesimp>若玩家没有正确的PBO档时, 将采取何种动作?</Chinesesimp>
|
<Chinesesimp>若玩家没有正确的PBO档时,将采取何种动作?</Chinesesimp>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Common_CheckPBO_Action_WarnOnce">
|
<Key ID="STR_ACE_Common_CheckPBO_Action_WarnOnce">
|
||||||
<English>Warn once</English>
|
<English>Warn once</English>
|
||||||
@ -858,8 +858,8 @@
|
|||||||
<Italian>Aggiunge effetti LSD ai veicoli sincronizzati</Italian>
|
<Italian>Aggiunge effetti LSD ai veicoli sincronizzati</Italian>
|
||||||
<Japanese>同期されたオブジェクトに LSD の効果を追加します</Japanese>
|
<Japanese>同期されたオブジェクトに LSD の効果を追加します</Japanese>
|
||||||
<Korean>동기화된 차량에 LSD효과를 추가합니다.</Korean>
|
<Korean>동기화된 차량에 LSD효과를 추가합니다.</Korean>
|
||||||
<Chinese>使被同步的載具產生瘋狂的迷幻效果. (後果自負)</Chinese>
|
<Chinese>使被同步的載具產生瘋狂的迷幻效果。(後果自負)</Chinese>
|
||||||
<Chinesesimp>使被同步的载具产生疯狂的迷幻效果. (后果自负)</Chinesesimp>
|
<Chinesesimp>使被同步的载具产生疯狂的迷幻效果。(后果自负)</Chinesesimp>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Common_toggleHandheldDevice">
|
<Key ID="STR_ACE_Common_toggleHandheldDevice">
|
||||||
<English>Toggle Handheld Device</English>
|
<English>Toggle Handheld Device</English>
|
||||||
|
@ -27,12 +27,11 @@ params ["_wire"];
|
|||||||
_args params ["_wire"];
|
_args params ["_wire"];
|
||||||
|
|
||||||
if (_wire animationPhase "wire_2" == 1) then {
|
if (_wire animationPhase "wire_2" == 1) then {
|
||||||
private ["_dir", "_pos", "_wirecoil"];
|
|
||||||
|
|
||||||
_dir = getDir _wire;
|
private _dir = getDir _wire;
|
||||||
_pos = getPosASL _wire;
|
private _pos = getPosASL _wire;
|
||||||
|
|
||||||
_wirecoil = "ACE_ConcertinaWireCoil" createvehicle [0, 0, 0];
|
private _wirecoil = "ACE_ConcertinaWireCoil" createvehicle [0, 0, 0];
|
||||||
|
|
||||||
deleteVehicle _wire;
|
deleteVehicle _wire;
|
||||||
|
|
||||||
|
@ -17,10 +17,8 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
params ["_wire", "_vehicle"];
|
params ["_wire", "_vehicle"];
|
||||||
|
|
||||||
private ["_type", "_mode", "_anim", "_parts", "_selectionPart", "_selection", "_pos_w", "_dir_w"];
|
private _type = typeOf _wire;
|
||||||
|
private _mode = switch (_type) do {
|
||||||
_type = typeOf _wire;
|
|
||||||
_mode = switch (_type) do {
|
|
||||||
case "ACE_ConcertinaWire": { 0 };
|
case "ACE_ConcertinaWire": { 0 };
|
||||||
case "Land_Razorwire_F": { 1 };
|
case "Land_Razorwire_F": { 1 };
|
||||||
default { -1 };
|
default { -1 };
|
||||||
@ -38,16 +36,16 @@ if (_mode == -1) exitWith {};
|
|||||||
//9.78744 (10)
|
//9.78744 (10)
|
||||||
|
|
||||||
_type = typeOf _wire;
|
_type = typeOf _wire;
|
||||||
_anim = _wire animationPhase "wire_2";
|
private _anim = _wire animationPhase "wire_2";
|
||||||
_pos_w = getPos _wire;
|
private _pos_w = getPos _wire;
|
||||||
_dir_w = getDir _wire;
|
private _dir_w = getDir _wire;
|
||||||
|
|
||||||
if (_mode == 0) then {
|
if (_mode == 0) then {
|
||||||
private ["_x", "_y", "_found", "_wireCheckPosAr", "_no"];
|
private _found = false;
|
||||||
_pos_w params ["_x","_y"];
|
_pos_w params ["_x","_y"];
|
||||||
|
|
||||||
// Check if two Single coils are placed next to each other (i.e playes have built a big wire obstacle)
|
// Check if two Single coils are placed next to each other (i.e playes have built a big wire obstacle)
|
||||||
_wireCheckPosAr = [
|
private _wireCheckPosAr = [
|
||||||
[_x + (sin (_dir_w + 90) * 1.5),_y + (cos (_dir_w + 90) * 1.5)],
|
[_x + (sin (_dir_w + 90) * 1.5),_y + (cos (_dir_w + 90) * 1.5)],
|
||||||
[(_x-(sin _dir_w)) + (sin (_dir_w + 90) * 1.5),(_y-(cos _dir_w)) + (cos (_dir_w + 90) * 1.5)],
|
[(_x-(sin _dir_w)) + (sin (_dir_w + 90) * 1.5),(_y-(cos _dir_w)) + (cos (_dir_w + 90) * 1.5)],
|
||||||
[_x + (sin (_dir_w - 90) * 1.5),_y + (cos (_dir_w - 90) * 1.5)],
|
[_x + (sin (_dir_w - 90) * 1.5),_y + (cos (_dir_w - 90) * 1.5)],
|
||||||
@ -55,7 +53,7 @@ if (_mode == 0) then {
|
|||||||
];
|
];
|
||||||
{
|
{
|
||||||
_found = false;
|
_found = false;
|
||||||
_no = nearestObjects [_x, [typeOf _wire], 3]; //diag_log _no; diag_log ".....";
|
private _no = nearestObjects [_x, [typeOf _wire], 3]; //diag_log _no; diag_log ".....";
|
||||||
_no = _no - [_wire]; //diag_log _no;
|
_no = _no - [_wire]; //diag_log _no;
|
||||||
if (count _no > 0) exitWith {
|
if (count _no > 0) exitWith {
|
||||||
_found = true; //diag_log "found";
|
_found = true; //diag_log "found";
|
||||||
@ -76,6 +74,8 @@ if (_mode == 0) then {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private _parts = [];
|
||||||
|
|
||||||
if (_mode == 1) then {
|
if (_mode == 1) then {
|
||||||
switch (true) do {
|
switch (true) do {
|
||||||
case (_vehicle isKindOf "Tank"): {
|
case (_vehicle isKindOf "Tank"): {
|
||||||
@ -95,9 +95,9 @@ if (_mode == 1) then {
|
|||||||
|
|
||||||
if (canMove _vehicle) then {
|
if (canMove _vehicle) then {
|
||||||
{
|
{
|
||||||
_selectionPart = "hit" + _x;
|
private _selectionPart = "hit" + _x;
|
||||||
if (isText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "hitpoints" >> _selectionPart >> "name")) then {
|
if (isText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "hitpoints" >> _selectionPart >> "name")) then {
|
||||||
_selection = getText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "hitpoints" >> _selectionPart >> "name");
|
private _selection = getText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "hitpoints" >> _selectionPart >> "name");
|
||||||
// TODO: Only the tires that have touched the wire should burst.
|
// TODO: Only the tires that have touched the wire should burst.
|
||||||
_vehicle setHit [_selection, 1];
|
_vehicle setHit [_selection, 1];
|
||||||
};
|
};
|
||||||
@ -107,14 +107,13 @@ if (canMove _vehicle) then {
|
|||||||
if (_mode == 1) then {
|
if (_mode == 1) then {
|
||||||
if (_vehicle isKindOf "StaticWeapon") exitWith {};
|
if (_vehicle isKindOf "StaticWeapon") exitWith {};
|
||||||
[{
|
[{
|
||||||
PARAMS_2(_vehicle,_wire);
|
params ["_vehicle", "_wire"];
|
||||||
|
|
||||||
_vehicle setVelocity ((velocity _vehicle) vectorMultiply 0.75);
|
_vehicle setVelocity ((velocity _vehicle) vectorMultiply 0.75);
|
||||||
|
|
||||||
private ["_vPos", "_vDir"];
|
|
||||||
// Set vehicle back in front of wire, since the wire will make the vehicle jump, and a wire with no geometry lod is undestructible and not recognizeable
|
// Set vehicle back in front of wire, since the wire will make the vehicle jump, and a wire with no geometry lod is undestructible and not recognizeable
|
||||||
_vPos = getPosASL _vehicle;
|
private _vPos = getPosASL _vehicle;
|
||||||
_vDir = getDir _vehicle;
|
private _vDir = getDir _vehicle;
|
||||||
_vehicle setPosASL (_vPos vectorAdd [-0.35 * sin(_vDir), -0.35 * cos(_vDir), 0]);
|
_vehicle setPosASL (_vPos vectorAdd [-0.35 * sin(_vDir), -0.35 * cos(_vDir), 0]);
|
||||||
// TODO: Needs to be placed in safe distance to wire, so we do not constantly re - spawn new wires
|
// TODO: Needs to be placed in safe distance to wire, so we do not constantly re - spawn new wires
|
||||||
}, [_vehicle, _wire], 0.1] call CBA_fnc_waitAndExecute;
|
}, [_vehicle, _wire], 0.1] call CBA_fnc_waitAndExecute;
|
||||||
|
@ -28,6 +28,9 @@ private _totalAmmo = 0;
|
|||||||
{
|
{
|
||||||
_x params ["_mag", "", "_count"];
|
_x params ["_mag", "", "_count"];
|
||||||
if (_count > 0) then {
|
if (_count > 0) then {
|
||||||
|
private _ammo = getText (configFile >> "CfgMagazines" >> _mag >> "ammo");
|
||||||
|
private _model = getText (configFile >> "CfgAmmo" >> _ammo >> "model");
|
||||||
|
if (_model == "\A3\weapons_f\empty") exitWith {TRACE_3("skipping",_mag,_ammo,_model);};
|
||||||
_ammoToDetonate pushBack [_mag, _count];
|
_ammoToDetonate pushBack [_mag, _count];
|
||||||
_totalAmmo = _totalAmmo + _count;
|
_totalAmmo = _totalAmmo + _count;
|
||||||
};
|
};
|
||||||
@ -44,7 +47,9 @@ private _totalAmmo = 0;
|
|||||||
|
|
||||||
// Get ammo from transportAmmo / ace_rearm
|
// Get ammo from transportAmmo / ace_rearm
|
||||||
private _vehCfg = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
private _vehCfg = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||||
if (((getNumber (_vehCfg >> "transportAmmo")) > 1000) || {isClass (_vehCfg >> "ACE_Actions" >> "ACE_MainActions" >> QEGVAR(rearm,TakeAmmo))}) then {
|
|
||||||
|
private _configSupply = (getNumber (_vehCfg >> "transportAmmo")) max (getNumber (_vehCfg >> QEGVAR(rearm,defaultSupply)));
|
||||||
|
if (_vehicle getVariable [QEGVAR(rearm,isSupplyVehicle), (_configSupply > 0)]) then {
|
||||||
TRACE_1("transportAmmo vehicle - adding virtual ammo",typeOf _vehicle);
|
TRACE_1("transportAmmo vehicle - adding virtual ammo",typeOf _vehicle);
|
||||||
|
|
||||||
_ammoToDetonate pushBack ["2000Rnd_65x39_belt", 2000];
|
_ammoToDetonate pushBack ["2000Rnd_65x39_belt", 2000];
|
||||||
|
@ -29,7 +29,7 @@ if (_hitIndex != -1) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// get change in damage
|
// get change in damage
|
||||||
private "_oldDamage";
|
private _oldDamage = 0;
|
||||||
|
|
||||||
if (_hitpoint isEqualTo "#structural") then {
|
if (_hitpoint isEqualTo "#structural") then {
|
||||||
_oldDamage = damage _vehicle;
|
_oldDamage = damage _vehicle;
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
<Polish>Aktywuje efekt samozapłonu amunicji na zniszczonych pojazdach.</Polish>
|
<Polish>Aktywuje efekt samozapłonu amunicji na zniszczonych pojazdach.</Polish>
|
||||||
<French>Active le cook-off (autocombustion des munitions) et les effets de destruction liés.</French>
|
<French>Active le cook-off (autocombustion des munitions) et les effets de destruction liés.</French>
|
||||||
<Italian>Abilita l'esplosione e i relativi effetti di distruzione del veicolo.</Italian>
|
<Italian>Abilita l'esplosione e i relativi effetti di distruzione del veicolo.</Italian>
|
||||||
<Chinese>開啟此功能後, 將使有關載具在損毀時有殉爆的效果</Chinese>
|
<Chinese>開啟此功能後,將使有關載具在損毀時有殉爆的效果。</Chinese>
|
||||||
<Chinesesimp>开启此功能后, 将使有关载具在损毁时有殉爆的效果</Chinesesimp>
|
<Chinesesimp>开启此功能后,将使有关载具在损毁时有殉爆的效果。</Chinesesimp>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_CookOff_generic_turret_wreck">
|
<Key ID="STR_ACE_CookOff_generic_turret_wreck">
|
||||||
<Original>Wreck (Turret)</Original>
|
<Original>Wreck (Turret)</Original>
|
||||||
@ -83,12 +83,13 @@
|
|||||||
<Polish>Aktywuje samozapłon amunicji. Wystrzeliwuje pociski podczas gdy pojazd płonie i posiada amunicję.</Polish>
|
<Polish>Aktywuje samozapłon amunicji. Wystrzeliwuje pociski podczas gdy pojazd płonie i posiada amunicję.</Polish>
|
||||||
<French>Mets à feu les munitions lorsqu'un véhicule est en feu et contient des munitions.</French>
|
<French>Mets à feu les munitions lorsqu'un véhicule est en feu et contient des munitions.</French>
|
||||||
<Italian>Abilita l'esplosione delle munizioni. Spara munizioni di proiettili quando il veicolo va a fuoco e contiene munizioni.</Italian>
|
<Italian>Abilita l'esplosione delle munizioni. Spara munizioni di proiettili quando il veicolo va a fuoco e contiene munizioni.</Italian>
|
||||||
<Chinese>開啟彈藥殉爆效果. 當一台載有彈藥的載具起火時, 將會有殉爆的效果</Chinese>
|
<Chinese>開啟彈藥殉爆效果。當一台載有彈藥的載具起火時, 將會有殉爆的效果。</Chinese>
|
||||||
<Chinesesimp>开启弹药殉爆效果. 当一台载有弹药的载具起火时, 将会有殉爆的效果</Chinesesimp>
|
<Chinesesimp>开启弹药殉爆效果。当一台载有弹药的载具起火时, 将会有殉爆的效果。</Chinesesimp>
|
||||||
<Korean>쿡오프 현상을 활성화 합니다. 이것은 탄약에 불이 붙어있는 동안 주변에 발사체를 발사합니다.</Korean>
|
<Korean>쿡오프 현상을 활성화 합니다. 이것은 탄약에 불이 붙어있는 동안 주변에 발사체를 발사합니다.</Korean>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_CookOff_ammoCookoffDuration_name">
|
<Key ID="STR_ACE_CookOff_ammoCookoffDuration_name">
|
||||||
<English>Ammunition cook off duration</English>
|
<English>Ammunition cook off duration</English>
|
||||||
|
<German>Munitionsselbstzündungdauer</German>
|
||||||
<Polish>Czas trwania samozapłonu amunicji</Polish>
|
<Polish>Czas trwania samozapłonu amunicji</Polish>
|
||||||
<Japanese>弾薬の誘爆持続時間</Japanese>
|
<Japanese>弾薬の誘爆持続時間</Japanese>
|
||||||
<French>Durée cook-off des munitions</French>
|
<French>Durée cook-off des munitions</French>
|
||||||
@ -99,6 +100,7 @@
|
|||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_CookOff_ammoCookoffDuration_tooltip">
|
<Key ID="STR_ACE_CookOff_ammoCookoffDuration_tooltip">
|
||||||
<English>Multiplier for how long cook off lasts [Setting to 0 will disable ammo cookoff]</English>
|
<English>Multiplier for how long cook off lasts [Setting to 0 will disable ammo cookoff]</English>
|
||||||
|
<German>Faktor für die Munitionsselbstzündungdauer [0 zum Deaktivieren]</German>
|
||||||
<French>Multiplicateur de la durée du cook-off des munitions [Une valeur de 0 désactive l'effet]</French>
|
<French>Multiplicateur de la durée du cook-off des munitions [Une valeur de 0 désactive l'effet]</French>
|
||||||
<Polish>Mnożnik decydujący jak długo ma trwać samozapłon amunicji [Ustawienie na 0 spowoduje wyłącznie samozapłonu]</Polish>
|
<Polish>Mnożnik decydujący jak długo ma trwać samozapłon amunicji [Ustawienie na 0 spowoduje wyłącznie samozapłonu]</Polish>
|
||||||
<Japanese>誘爆の持続時間を乗数で設定。[0 に設定で誘爆を無効化]</Japanese>
|
<Japanese>誘爆の持続時間を乗数で設定。[0 に設定で誘爆を無効化]</Japanese>
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#define EMP_RF_ACC 5 // Rangefinder Accuracy
|
#define EMP_RF_ACC 5 // Rangefinder Accuracy
|
||||||
|
|
||||||
PARAMS_3(_slopeDistance,_azimuth,_inclination);
|
params ["_slopeDistance", "_azimuth", "_inclination"];
|
||||||
|
|
||||||
if (GVAR(vectorConnected)) then {
|
if (GVAR(vectorConnected)) then {
|
||||||
GVAR(LAZPOS) = (eyePos player) vectorAdd ([_slopeDistance, _azimuth, _inclination] call CBA_fnc_polar2vect);
|
GVAR(LAZPOS) = (eyePos player) vectorAdd ([_slopeDistance, _azimuth, _inclination] call CBA_fnc_polar2vect);
|
||||||
|
@ -31,8 +31,6 @@ __background ctrlSetText QPATHTOF(UI\dagr_gps.paa);
|
|||||||
if (GVAR(outputPFH) != -1) exitWith {};
|
if (GVAR(outputPFH) != -1) exitWith {};
|
||||||
|
|
||||||
GVAR(outputPFH) = [{
|
GVAR(outputPFH) = [{
|
||||||
private ["_dagrElevation", "_dagrGrid", "_dagrHeading", "_dagrSpeed", "_dagrTime", "_elevation", "_gridArray", "_speed"];
|
|
||||||
|
|
||||||
// Abort Condition
|
// Abort Condition
|
||||||
if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {
|
if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {
|
||||||
GVAR(outputPFH) = -1;
|
GVAR(outputPFH) = -1;
|
||||||
@ -41,30 +39,30 @@ GVAR(outputPFH) = [{
|
|||||||
};
|
};
|
||||||
|
|
||||||
// GRID
|
// GRID
|
||||||
_gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos);
|
private _gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos);
|
||||||
_gridArray params ["_gridArrayX","_gridArrayY"];
|
_gridArray params ["_gridArrayX","_gridArrayY"];
|
||||||
_dagrGrid = format ["%1 %2", ((_gridArrayX) select [0,4]), ((_gridArrayY) select [0,4])];
|
private _dagrGrid = format ["%1 %2", ((_gridArrayX) select [0,4]), ((_gridArrayY) select [0,4])];
|
||||||
|
|
||||||
// SPEED
|
// SPEED
|
||||||
_speed = speed (vehicle ACE_player);
|
private _speed = speed (vehicle ACE_player);
|
||||||
_speed = floor (_speed * 10) / 10;
|
_speed = floor (_speed * 10) / 10;
|
||||||
_speed = abs(_speed);
|
_speed = abs(_speed);
|
||||||
_dagrspeed = str _speed + "kph";
|
_dagrspeed = str _speed + "kph";
|
||||||
|
|
||||||
// Elevation
|
// Elevation
|
||||||
_elevation = getPosASL ACE_player;
|
private _elevation = getPosASL ACE_player;
|
||||||
_elevation = floor ((_elevation select 2) + EGVAR(common,mapAltitude));
|
_elevation = floor ((_elevation select 2) + EGVAR(common,mapAltitude));
|
||||||
_dagrElevation = str _elevation + "m";
|
private _dagrElevation = str _elevation + "m";
|
||||||
|
|
||||||
// Heading
|
// Heading
|
||||||
_dagrHeading = if (!GVAR(useDegrees)) then {
|
private _dagrHeading = if (!GVAR(useDegrees)) then {
|
||||||
floor (DEG_TO_MIL(direction (vehicle ACE_player)))
|
floor (DEG_TO_MIL(direction (vehicle ACE_player)))
|
||||||
} else {
|
} else {
|
||||||
floor (direction (vehicle ACE_player))
|
floor (direction (vehicle ACE_player))
|
||||||
};
|
};
|
||||||
|
|
||||||
// Time
|
// Time
|
||||||
_dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString;
|
private _dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString;
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
__gridControl ctrlSetText format ["%1", _dagrGrid];
|
__gridControl ctrlSetText format ["%1", _dagrGrid];
|
||||||
|
@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dagrElevation", "_dagrTime", "_elevation", "_xCoord", "_yCoord"];
|
|
||||||
|
|
||||||
135471 cutRsc ["DAGR_DISPLAY", "plain down"];
|
135471 cutRsc ["DAGR_DISPLAY", "plain down"];
|
||||||
|
|
||||||
#define __display (uiNameSpace getVariable "DAGR_DISPLAY")
|
#define __display (uiNameSpace getVariable "DAGR_DISPLAY")
|
||||||
@ -39,7 +37,7 @@ if (_lazPosX < 0) then { _lazPosX = _lazPosX + 99999;};
|
|||||||
if (_lazPosY < 0) then {_lazPosY = _lazPosY + 99999;};
|
if (_lazPosY < 0) then {_lazPosY = _lazPosY + 99999;};
|
||||||
|
|
||||||
// Find laser position
|
// Find laser position
|
||||||
_xGrid = toArray Str(round _lazPosX);
|
private _xGrid = toArray Str(round _lazPosX);
|
||||||
|
|
||||||
while {count _xGrid < 5} do {
|
while {count _xGrid < 5} do {
|
||||||
_xGrid = [48] + _xGrid;
|
_xGrid = [48] + _xGrid;
|
||||||
@ -48,7 +46,7 @@ _xGrid resize 4;
|
|||||||
_xGrid = toString _xGrid;
|
_xGrid = toString _xGrid;
|
||||||
_xGrid = parseNumber _xGrid;
|
_xGrid = parseNumber _xGrid;
|
||||||
|
|
||||||
_yGrid = toArray Str(round _lazPosY);
|
private _yGrid = toArray Str(round _lazPosY);
|
||||||
while {count _yGrid < 5} do {
|
while {count _yGrid < 5} do {
|
||||||
_yGrid = [48] + _yGrid;
|
_yGrid = [48] + _yGrid;
|
||||||
};
|
};
|
||||||
@ -56,37 +54,37 @@ _yGrid resize 4;
|
|||||||
_yGrid = toString _yGrid;
|
_yGrid = toString _yGrid;
|
||||||
_yGrid = parseNumber _yGrid;
|
_yGrid = parseNumber _yGrid;
|
||||||
|
|
||||||
_xCoord = switch true do {
|
private _xCoord = switch true do {
|
||||||
case (_xGrid >= 1000): { "" + Str(_xGrid) };
|
case (_xGrid >= 1000): { "" + Str(_xGrid) };
|
||||||
case (_xGrid >= 100): { "0" + Str(_xGrid) };
|
case (_xGrid >= 100): { "0" + Str(_xGrid) };
|
||||||
case (_xGrid >= 10): { "00" + Str(_xGrid) };
|
case (_xGrid >= 10): { "00" + Str(_xGrid) };
|
||||||
default { "000" + Str(_xGrid) };
|
default { "000" + Str(_xGrid) };
|
||||||
};
|
};
|
||||||
|
|
||||||
_yCoord = switch true do {
|
private _yCoord = switch true do {
|
||||||
case (_yGrid >= 1000): { "" + Str(_yGrid) };
|
case (_yGrid >= 1000): { "" + Str(_yGrid) };
|
||||||
case (_yGrid >= 100): { "0" + Str(_yGrid) };
|
case (_yGrid >= 100): { "0" + Str(_yGrid) };
|
||||||
case (_yGrid >= 10): { "00" + Str(_yGrid) };
|
case (_yGrid >= 10): { "00" + Str(_yGrid) };
|
||||||
default { "000" + Str(_yGrid) };
|
default { "000" + Str(_yGrid) };
|
||||||
};
|
};
|
||||||
|
|
||||||
_dagrGrid = _xCoord + " " + _yCoord;
|
private _dagrGrid = _xCoord + " " + _yCoord;
|
||||||
|
|
||||||
// Find target elevation
|
// Find target elevation
|
||||||
_elevation = floor ((_lazPosZ) + EGVAR(common,mapAltitude));
|
private _elevation = floor ((_lazPosZ) + EGVAR(common,mapAltitude));
|
||||||
_dagrElevation = str _elevation + "m";
|
private _dagrElevation = str _elevation + "m";
|
||||||
|
|
||||||
// Time
|
// Time
|
||||||
_dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString;
|
private _dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString;
|
||||||
|
|
||||||
// Bearing
|
// Bearing
|
||||||
_bearing = GVAR(LAZHEADING);
|
private _bearing = GVAR(LAZHEADING);
|
||||||
if (_bearing >= 360) then {_bearing = _bearing - 360;};
|
if (_bearing >= 360) then {_bearing = _bearing - 360;};
|
||||||
if (!GVAR(useDegrees)) then {_bearing = DEG_TO_MIL(_bearing)};
|
if (!GVAR(useDegrees)) then {_bearing = DEG_TO_MIL(_bearing)};
|
||||||
_bearing = floor (_bearing);
|
_bearing = floor (_bearing);
|
||||||
|
|
||||||
// Distance
|
// Distance
|
||||||
_dagrDist = str GVAR(LAZDIST) + "m";
|
private _dagrDist = str GVAR(LAZDIST) + "m";
|
||||||
|
|
||||||
// Put grid into variable so DAGR menu can access it
|
// Put grid into variable so DAGR menu can access it
|
||||||
GVAR(vectorGrid) = _dagrGrid;
|
GVAR(vectorGrid) = _dagrGrid;
|
||||||
|
@ -31,8 +31,6 @@ __background ctrlSetText QPATHTOF(UI\dagr_wp.paa);
|
|||||||
if (GVAR(outputPFH) != -1) exitWith {};
|
if (GVAR(outputPFH) != -1) exitWith {};
|
||||||
|
|
||||||
GVAR(outputPFH) = [{
|
GVAR(outputPFH) = [{
|
||||||
private ["_MYpos", "_WPpos", "_bearing", "_dagrDistance", "_dagrGrid", "_dagrHeading", "_distance", "_gridArray"];
|
|
||||||
|
|
||||||
// Abort Condition
|
// Abort Condition
|
||||||
if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {
|
if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {
|
||||||
GVAR(outputPFH) = -1;
|
GVAR(outputPFH) = -1;
|
||||||
@ -41,13 +39,13 @@ GVAR(outputPFH) = [{
|
|||||||
};
|
};
|
||||||
|
|
||||||
// GRID
|
// GRID
|
||||||
_gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos);
|
private _gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos);
|
||||||
_gridArray params ["_gridArrayX","_gridArrayY"];
|
_gridArray params ["_gridArrayX","_gridArrayY"];
|
||||||
_dagrGrid = format ["%1 %2", (_gridArrayX select [0,4]), (_gridArrayY select [0,4])];
|
private _dagrGrid = format ["%1 %2", (_gridArrayX select [0,4]), (_gridArrayY select [0,4])];
|
||||||
|
|
||||||
// WP Grid
|
// WP Grid
|
||||||
_xGrid2 = floor (DAGR_WP_INFO / 10000);
|
private _xGrid2 = floor (DAGR_WP_INFO / 10000);
|
||||||
_yGrid2 = DAGR_WP_INFO - _xGrid2 * 10000;
|
private _yGrid2 = DAGR_WP_INFO - _xGrid2 * 10000;
|
||||||
|
|
||||||
_xCoord2 = switch true do {
|
_xCoord2 = switch true do {
|
||||||
case (_xGrid2 >= 1000): { "" + Str(_xGrid2) };
|
case (_xGrid2 >= 1000): { "" + Str(_xGrid2) };
|
||||||
@ -66,21 +64,21 @@ GVAR(outputPFH) = [{
|
|||||||
_dagrGrid2 = _xCoord2 + " " + _yCoord2;
|
_dagrGrid2 = _xCoord2 + " " + _yCoord2;
|
||||||
|
|
||||||
// Distance
|
// Distance
|
||||||
_WPpos = [_dagrGrid2, true] call EFUNC(common,getMapPosFromGrid);
|
private _WPpos = [_dagrGrid2, true] call EFUNC(common,getMapPosFromGrid);
|
||||||
_MYpos = [_dagrGrid, true] call EFUNC(common,getMapPosFromGrid);
|
private _MYpos = [_dagrGrid, true] call EFUNC(common,getMapPosFromGrid);
|
||||||
_distance = _MYpos distance _WPpos;
|
private _distance = _MYpos distance _WPpos;
|
||||||
_distance = floor (_distance * 10) / 10;
|
_distance = floor (_distance * 10) / 10;
|
||||||
_dagrDistance = str _distance + "m";
|
private _dagrDistance = str _distance + "m";
|
||||||
|
|
||||||
// Heading
|
// Heading
|
||||||
_dagrHeading = floor (if (GVAR(useDegrees)) then {
|
private _dagrHeading = floor (if (GVAR(useDegrees)) then {
|
||||||
direction (vehicle ACE_player)
|
direction (vehicle ACE_player)
|
||||||
} else {
|
} else {
|
||||||
DEG_TO_MIL(direction (vehicle ACE_player))
|
DEG_TO_MIL(direction (vehicle ACE_player))
|
||||||
});
|
});
|
||||||
|
|
||||||
// WP Heading
|
// WP Heading
|
||||||
_bearing = floor (if (GVAR(useDegrees)) then {
|
private _bearing = floor (if (GVAR(useDegrees)) then {
|
||||||
((_WPpos vectorDiff _MYpos) call CBA_fnc_vectDir)
|
((_WPpos vectorDiff _MYpos) call CBA_fnc_vectDir)
|
||||||
} else {
|
} else {
|
||||||
DEG_TO_MIL(((_WPpos vectorDiff _MYpos) call CBA_fnc_vectDir))
|
DEG_TO_MIL(((_WPpos vectorDiff _MYpos) call CBA_fnc_vectDir))
|
||||||
|
@ -30,11 +30,10 @@
|
|||||||
[0, [false, false, false]], false] call CBA_fnc_addKeybind; // (empty default key)
|
[0, [false, false, false]], false] call CBA_fnc_addKeybind; // (empty default key)
|
||||||
|
|
||||||
//Add deviceKey entry:
|
//Add deviceKey entry:
|
||||||
private ["_conditonCode", "_toggleCode", "_closeCode"];
|
private _conditonCode = {
|
||||||
_conditonCode = {
|
|
||||||
([ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem));
|
([ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem));
|
||||||
};
|
};
|
||||||
_toggleCode = {
|
private _toggleCode = {
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {};
|
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {};
|
||||||
|
|
||||||
@ -44,7 +43,7 @@ _toggleCode = {
|
|||||||
[] call FUNC(menuInit);
|
[] call FUNC(menuInit);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
_closeCode = {
|
private _closeCode = {
|
||||||
// Statement
|
// Statement
|
||||||
if (GVAR(run)) then {
|
if (GVAR(run)) then {
|
||||||
//If dispaly is open, close it:
|
//If dispaly is open, close it:
|
||||||
|
@ -16,16 +16,14 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_animationStateCfgMoves", "_putDownAnim"];
|
|
||||||
|
|
||||||
params ["_target"];
|
params ["_target"];
|
||||||
|
|
||||||
//Check animationState for putDown anim
|
//Check animationState for putDown anim
|
||||||
//This ensures the unit doesn't have to actualy do any animation to drop something
|
//This ensures the unit doesn't have to actualy do any animation to drop something
|
||||||
//This should always be true for the 3 possible status effects that allow disarming
|
//This should always be true for the 3 possible status effects that allow disarming
|
||||||
_animationStateCfgMoves = getText (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState _target) >> "actions");
|
private _animationStateCfgMoves = getText (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState _target) >> "actions");
|
||||||
if (_animationStateCfgMoves == "") exitWith { false };
|
if (_animationStateCfgMoves == "") exitWith { false };
|
||||||
_putDownAnim = getText (configFile >> "CfgMovesBasic" >> "Actions" >> _animationStateCfgMoves >> "PutDown");
|
private _putDownAnim = getText (configFile >> "CfgMovesBasic" >> "Actions" >> _animationStateCfgMoves >> "PutDown");
|
||||||
if (_putDownAnim != "") exitWith { false };
|
if (_putDownAnim != "") exitWith { false };
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,12 +21,10 @@
|
|||||||
|
|
||||||
#define TIME_MAX_WAIT 5
|
#define TIME_MAX_WAIT 5
|
||||||
|
|
||||||
private ["_fncSumArray", "_return", "_holder", "_dropPos", "_targetMagazinesStart", "_holderMagazinesStart", "_xClassname", "_xAmmo", "_targetMagazinesEnd", "_holderMagazinesEnd", "_holderItemsStart", "_targetItemsStart", "_addToCrateClassnames", "_addToCrateCount", "_index", "_holderItemsEnd", "_targetItemsEnd", "_holderIsEmpty"];
|
|
||||||
|
|
||||||
params ["_caller", "_target", "_listOfItemsToRemove", ["_doNotDropAmmo", false, [false]]]; //By default units drop all weapon mags when dropping a weapon
|
params ["_caller", "_target", "_listOfItemsToRemove", ["_doNotDropAmmo", false, [false]]]; //By default units drop all weapon mags when dropping a weapon
|
||||||
|
|
||||||
_fncSumArray = {
|
private _fncSumArray = {
|
||||||
_return = 0;
|
private _return = 0;
|
||||||
{_return = _return + _x;} count (_this select 0);
|
{_return = _return + _x;} count (_this select 0);
|
||||||
_return
|
_return
|
||||||
};
|
};
|
||||||
@ -39,7 +37,7 @@ if (_doNotDropAmmo && {({_x in _listOfItemsToRemove} count (magazines _target))
|
|||||||
[_caller, _target, "Debug: Trying to drop magazine with _doNotDropAmmo flag"] call FUNC(eventTargetFinish);
|
[_caller, _target, "Debug: Trying to drop magazine with _doNotDropAmmo flag"] call FUNC(eventTargetFinish);
|
||||||
};
|
};
|
||||||
|
|
||||||
_holder = objNull;
|
private _holder = objNull;
|
||||||
|
|
||||||
//If not dropping ammo, don't use an existing container
|
//If not dropping ammo, don't use an existing container
|
||||||
if (!_doNotDropAmmo) then {
|
if (!_doNotDropAmmo) then {
|
||||||
@ -52,7 +50,7 @@ if (!_doNotDropAmmo) then {
|
|||||||
|
|
||||||
//Create a new weapon holder
|
//Create a new weapon holder
|
||||||
if (isNull _holder) then {
|
if (isNull _holder) then {
|
||||||
_dropPos = _target modelToWorld [0.4, 0.75, 0]; //offset someone unconscious isn't lying over it
|
private _dropPos = _target modelToWorld [0.4, 0.75, 0]; //offset someone unconscious isn't lying over it
|
||||||
_dropPos set [2, ((getPosASL _target) select 2)];
|
_dropPos set [2, ((getPosASL _target) select 2)];
|
||||||
_holder = createVehicle [DISARM_CONTAINER, _dropPos, [], 0, "CAN_COLLIDE"];
|
_holder = createVehicle [DISARM_CONTAINER, _dropPos, [], 0, "CAN_COLLIDE"];
|
||||||
_holder setPosASL _dropPos;
|
_holder setPosASL _dropPos;
|
||||||
@ -73,19 +71,19 @@ _holder setVariable [QGVAR(holderInUse), true];
|
|||||||
|
|
||||||
|
|
||||||
//Remove Magazines
|
//Remove Magazines
|
||||||
_targetMagazinesStart = magazinesAmmo _target;
|
private _targetMagazinesStart = magazinesAmmo _target;
|
||||||
_holderMagazinesStart = magazinesAmmoCargo _holder;
|
private _holderMagazinesStart = magazinesAmmoCargo _holder;
|
||||||
|
|
||||||
{
|
{
|
||||||
EXPLODE_2_PVT(_x,_xClassname,_xAmmo);
|
_x params ["_xClassname", "_xAmmo"];
|
||||||
if ((_xClassname in _listOfItemsToRemove) && {(getNumber (configFile >> "CfgMagazines" >> _xClassname >> "ACE_isUnique")) == 0}) then {
|
if ((_xClassname in _listOfItemsToRemove) && {(getNumber (configFile >> "CfgMagazines" >> _xClassname >> "ACE_isUnique")) == 0}) then {
|
||||||
_holder addMagazineAmmoCargo [_xClassname, 1, _xAmmo];
|
_holder addMagazineAmmoCargo [_xClassname, 1, _xAmmo];
|
||||||
_target removeMagazine _xClassname;
|
_target removeMagazine _xClassname;
|
||||||
};
|
};
|
||||||
} forEach _targetMagazinesStart;
|
} forEach _targetMagazinesStart;
|
||||||
|
|
||||||
_targetMagazinesEnd = magazinesAmmo _target;
|
private _targetMagazinesEnd = magazinesAmmo _target;
|
||||||
_holderMagazinesEnd = magazinesAmmoCargo _holder;
|
private _holderMagazinesEnd = magazinesAmmoCargo _holder;
|
||||||
|
|
||||||
//Verify Mags dropped from unit:
|
//Verify Mags dropped from unit:
|
||||||
if (({((_x select 0) in _listOfItemsToRemove) && {(getNumber (configFile >> "CfgMagazines" >> (_x select 0) >> "ACE_isUnique")) == 0}} count _targetMagazinesEnd) != 0) exitWith {
|
if (({((_x select 0) in _listOfItemsToRemove) && {(getNumber (configFile >> "CfgMagazines" >> (_x select 0) >> "ACE_isUnique")) == 0}} count _targetMagazinesEnd) != 0) exitWith {
|
||||||
@ -100,14 +98,14 @@ if (!([_targetMagazinesStart, _targetMagazinesEnd, _holderMagazinesStart, _holde
|
|||||||
};
|
};
|
||||||
|
|
||||||
//Remove Items, Assigned Items and NVG
|
//Remove Items, Assigned Items and NVG
|
||||||
_holderItemsStart = getitemCargo _holder;
|
private _holderItemsStart = getitemCargo _holder;
|
||||||
_targetItemsStart = (assignedItems _target) + (items _target) - (weapons _target);
|
private _targetItemsStart = (assignedItems _target) + (items _target) - (weapons _target);
|
||||||
if ((headgear _target) != "") then {_targetItemsStart pushBack (headgear _target);};
|
if ((headgear _target) != "") then {_targetItemsStart pushBack (headgear _target);};
|
||||||
if ((goggles _target) != "") then {_targetItemsStart pushBack (goggles _target);};
|
if ((goggles _target) != "") then {_targetItemsStart pushBack (goggles _target);};
|
||||||
|
|
||||||
|
|
||||||
_addToCrateClassnames = [];
|
private _addToCrateClassnames = [];
|
||||||
_addToCrateCount = [];
|
private _addToCrateCount = [];
|
||||||
{
|
{
|
||||||
if (_x in _listOfItemsToRemove) then {
|
if (_x in _listOfItemsToRemove) then {
|
||||||
if (_x in (items _target)) then {
|
if (_x in (items _target)) then {
|
||||||
@ -115,7 +113,7 @@ _addToCrateCount = [];
|
|||||||
} else {
|
} else {
|
||||||
_target unlinkItem _x;
|
_target unlinkItem _x;
|
||||||
};
|
};
|
||||||
_index = _addToCrateClassnames find _x;
|
private _index = _addToCrateClassnames find _x;
|
||||||
if (_index != -1) then {
|
if (_index != -1) then {
|
||||||
_addToCrateCount set [_index, ((_addToCrateCount select _index) + 1)];
|
_addToCrateCount set [_index, ((_addToCrateCount select _index) + 1)];
|
||||||
} else {
|
} else {
|
||||||
@ -130,8 +128,8 @@ _addToCrateCount = [];
|
|||||||
_holder addItemCargoGlobal [(_addToCrateClassnames select _forEachIndex), (_addToCrateCount select _forEachIndex)];
|
_holder addItemCargoGlobal [(_addToCrateClassnames select _forEachIndex), (_addToCrateCount select _forEachIndex)];
|
||||||
} forEach _addToCrateClassnames;
|
} forEach _addToCrateClassnames;
|
||||||
|
|
||||||
_holderItemsEnd = getitemCargo _holder;
|
private _holderItemsEnd = getitemCargo _holder;
|
||||||
_targetItemsEnd = (assignedItems _target) + (items _target) - (weapons _target);
|
private _targetItemsEnd = (assignedItems _target) + (items _target) - (weapons _target);
|
||||||
if ((headgear _target) != "") then {_targetItemsEnd pushBack (headgear _target);};
|
if ((headgear _target) != "") then {_targetItemsEnd pushBack (headgear _target);};
|
||||||
if ((goggles _target) != "") then {_targetItemsEnd pushBack (goggles _target);};
|
if ((goggles _target) != "") then {_targetItemsEnd pushBack (goggles _target);};
|
||||||
|
|
||||||
@ -158,7 +156,7 @@ if (((vest _target) != "") && {(vest _target) in _listOfItemsToRemove} && {(vest
|
|||||||
|
|
||||||
//If holder is still empty, it will be 'garbage collected' while we wait for the drop 'action' to take place
|
//If holder is still empty, it will be 'garbage collected' while we wait for the drop 'action' to take place
|
||||||
//So add a dummy item and just remove at the end
|
//So add a dummy item and just remove at the end
|
||||||
_holderIsEmpty = ([_holder] call FUNC(getAllGearContainer)) isEqualTo [[],[]];
|
private _holderIsEmpty = ([_holder] call FUNC(getAllGearContainer)) isEqualTo [[],[]];
|
||||||
if (_holderIsEmpty) then {
|
if (_holderIsEmpty) then {
|
||||||
TRACE_1("Debug: adding dummy item to holder",_holder);
|
TRACE_1("Debug: adding dummy item to holder",_holder);
|
||||||
_holder addItemCargoGlobal [DUMMY_ITEM, 1];
|
_holder addItemCargoGlobal [DUMMY_ITEM, 1];
|
||||||
@ -166,16 +164,14 @@ if (_holderIsEmpty) then {
|
|||||||
|
|
||||||
//Start the PFEH to do the actions (which could take >1 frame)
|
//Start the PFEH to do the actions (which could take >1 frame)
|
||||||
[{
|
[{
|
||||||
private ["_needToRemoveWeapon", "_needToRemoveMagazines", "_needToRemoveBackpack", "_needToRemoveVest", "_needToRemoveUniform", "_error", "_magsToPickup", "_index", "_magazinesInHolder"];
|
params ["_args", "_pfID"];
|
||||||
|
_args params ["_caller", "_target", "_listOfItemsToRemove", "_holder", "_holderIsEmpty", "_maxWaitTime", "_doNotDropAmmo", "_startingMagazines"];
|
||||||
|
|
||||||
PARAMS_2(_args,_pfID);
|
private _needToRemoveWeapon = ({_x in _listOfItemsToRemove} count (weapons _target)) > 0;
|
||||||
EXPLODE_8_PVT(_args,_caller,_target,_listOfItemsToRemove,_holder,_holderIsEmpty,_maxWaitTime,_doNotDropAmmo,_startingMagazines);
|
private _needToRemoveMagazines = ({_x in _listOfItemsToRemove} count (magazines _target)) > 0;
|
||||||
|
private _needToRemoveBackpack = ((backPack _target) != "") && {(backPack _target) in _listOfItemsToRemove};
|
||||||
_needToRemoveWeapon = ({_x in _listOfItemsToRemove} count (weapons _target)) > 0;
|
private _needToRemoveVest = ((vest _target) != "") && {(vest _target) in _listOfItemsToRemove};
|
||||||
_needToRemoveMagazines = ({_x in _listOfItemsToRemove} count (magazines _target)) > 0;
|
private _needToRemoveUniform = ((uniform _target) != "") && {(uniform _target) in _listOfItemsToRemove};
|
||||||
_needToRemoveBackpack = ((backPack _target) != "") && {(backPack _target) in _listOfItemsToRemove};
|
|
||||||
_needToRemoveVest = ((vest _target) != "") && {(vest _target) in _listOfItemsToRemove};
|
|
||||||
_needToRemoveUniform = ((uniform _target) != "") && {(uniform _target) in _listOfItemsToRemove};
|
|
||||||
|
|
||||||
if ((CBA_missionTime < _maxWaitTime) && {[_target] call FUNC(canBeDisarmed)} && {_needToRemoveWeapon || _needToRemoveMagazines || _needToRemoveBackpack}) then {
|
if ((CBA_missionTime < _maxWaitTime) && {[_target] call FUNC(canBeDisarmed)} && {_needToRemoveWeapon || _needToRemoveMagazines || _needToRemoveBackpack}) then {
|
||||||
//action drop weapons (keeps loaded magazine and attachements)
|
//action drop weapons (keeps loaded magazine and attachements)
|
||||||
@ -198,18 +194,18 @@ if (_holderIsEmpty) then {
|
|||||||
[_pfID] call CBA_fnc_removePerFrameHandler;
|
[_pfID] call CBA_fnc_removePerFrameHandler;
|
||||||
|
|
||||||
if (_doNotDropAmmo) then {
|
if (_doNotDropAmmo) then {
|
||||||
_error = false;
|
private _error = false;
|
||||||
|
|
||||||
_magsToPickup = +_startingMagazines;
|
private _magsToPickup = +_startingMagazines;
|
||||||
{
|
{
|
||||||
_index = _magsToPickup find _x;
|
private _index = _magsToPickup find _x;
|
||||||
if (_index == -1) exitWith {_error = true; ERROR("More mags than when we started?")};
|
if (_index == -1) exitWith {_error = true; ERROR("More mags than when we started?")};
|
||||||
_magsToPickup deleteAt _index;
|
_magsToPickup deleteAt _index;
|
||||||
} forEach (magazinesAmmo _target);
|
} forEach (magazinesAmmo _target);
|
||||||
|
|
||||||
_magazinesInHolder = magazinesAmmoCargo _holder;
|
private _magazinesInHolder = magazinesAmmoCargo _holder;
|
||||||
{
|
{
|
||||||
_index = _magazinesInHolder find _x;
|
private _index = _magazinesInHolder find _x;
|
||||||
if (_index == -1) exitWith {_error = true; ERROR("Missing mag not in holder")};
|
if (_index == -1) exitWith {_error = true; ERROR("Missing mag not in holder")};
|
||||||
_magazinesInHolder deleteAt _index;
|
_magazinesInHolder deleteAt _index;
|
||||||
} forEach _magsToPickup;
|
} forEach _magsToPickup;
|
||||||
|
@ -18,9 +18,7 @@
|
|||||||
|
|
||||||
params ["_target"];
|
params ["_target"];
|
||||||
|
|
||||||
private ["_allItems", "_classnamesCount", "_index", "_uniqueClassnames"];
|
private _allItems = (((items _target) + (assignedItems _target)) - (weapons _target)) + (weapons _target) + (magazines _target);
|
||||||
|
|
||||||
_allItems = (((items _target) + (assignedItems _target)) - (weapons _target)) + (weapons _target) + (magazines _target);
|
|
||||||
|
|
||||||
if ((backpack _target) != "") then {
|
if ((backpack _target) != "") then {
|
||||||
_allItems pushBack (backpack _target);
|
_allItems pushBack (backpack _target);
|
||||||
@ -39,11 +37,11 @@ if ((goggles _target) != "") then {
|
|||||||
_allItems pushBack (goggles _target);
|
_allItems pushBack (goggles _target);
|
||||||
};
|
};
|
||||||
|
|
||||||
_uniqueClassnames = [];
|
private _uniqueClassnames = [];
|
||||||
_classnamesCount = [];
|
private _classnamesCount = [];
|
||||||
//Filter unique and count
|
//Filter unique and count
|
||||||
{
|
{
|
||||||
_index = _uniqueClassnames find _x;
|
private _index = _uniqueClassnames find _x;
|
||||||
if (_index != -1) then {
|
if (_index != -1) then {
|
||||||
_classnamesCount set [_index, ((_classnamesCount select _index) + 1)];
|
_classnamesCount set [_index, ((_classnamesCount select _index) + 1)];
|
||||||
} else {
|
} else {
|
||||||
|
@ -48,7 +48,6 @@ GVAR(disarmTarget) = _target;
|
|||||||
|
|
||||||
//Setup PFEH
|
//Setup PFEH
|
||||||
[{
|
[{
|
||||||
private ["_groundContainer", "_targetContainer", "_playerName", "_icon", "_rankPicture", "_targetUniqueItems", "_holderUniqueItems", "_holder"];
|
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
params ["_args", "_idPFH"];
|
params ["_args", "_idPFH"];
|
||||||
_args params ["_player", "_target", "_display"];
|
_args params ["_player", "_target", "_display"];
|
||||||
@ -62,13 +61,13 @@ GVAR(disarmTarget) = _target;
|
|||||||
if (!isNull _display) then { closeDialog 0; }; //close dialog if still open
|
if (!isNull _display) then { closeDialog 0; }; //close dialog if still open
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
_groundContainer = _display displayCtrl 632;
|
private _groundContainer = _display displayCtrl 632;
|
||||||
_targetContainer = _display displayCtrl 633;
|
private _targetContainer = _display displayCtrl 633;
|
||||||
_playerName = _display displayCtrl 111;
|
private _playerName = _display displayCtrl 111;
|
||||||
_rankPicture = _display displayCtrl 1203;
|
private _rankPicture = _display displayCtrl 1203;
|
||||||
|
|
||||||
//Show rank and name (just like BIS's inventory)
|
//Show rank and name (just like BIS's inventory)
|
||||||
_icon = format [DEFUALTPATH, toLower (rank _target)];
|
private _icon = format [DEFUALTPATH, toLower (rank _target)];
|
||||||
if (_icon isEqualTo DEFUALTPATH) then {_icon = ""};
|
if (_icon isEqualTo DEFUALTPATH) then {_icon = ""};
|
||||||
_rankPicture ctrlSetText _icon;
|
_rankPicture ctrlSetText _icon;
|
||||||
_playerName ctrlSetText ([GVAR(disarmTarget), false, true] call EFUNC(common,getName));
|
_playerName ctrlSetText ([GVAR(disarmTarget), false, true] call EFUNC(common,getName));
|
||||||
@ -78,11 +77,11 @@ GVAR(disarmTarget) = _target;
|
|||||||
lbClear _targetContainer;
|
lbClear _targetContainer;
|
||||||
|
|
||||||
//Show the items in the ground disarmTarget's inventory
|
//Show the items in the ground disarmTarget's inventory
|
||||||
_targetUniqueItems = [GVAR(disarmTarget)] call FUNC(getAllGearUnit);
|
private _targetUniqueItems = [GVAR(disarmTarget)] call FUNC(getAllGearUnit);
|
||||||
[_targetContainer, _targetUniqueItems] call FUNC(showItemsInListbox);
|
[_targetContainer, _targetUniqueItems] call FUNC(showItemsInListbox);
|
||||||
|
|
||||||
//Try to find a holder that the target is using to drop items into:
|
//Try to find a holder that the target is using to drop items into:
|
||||||
_holder = objNull;
|
private _holder = objNull;
|
||||||
{
|
{
|
||||||
if ((_x getVariable [QGVAR(disarmUnit), objNull]) == _target) exitWith {
|
if ((_x getVariable [QGVAR(disarmUnit), objNull]) == _target) exitWith {
|
||||||
_holder = _x;
|
_holder = _x;
|
||||||
@ -91,7 +90,7 @@ GVAR(disarmTarget) = _target;
|
|||||||
|
|
||||||
//If a holder exists, show it's inventory
|
//If a holder exists, show it's inventory
|
||||||
if (!isNull _holder) then {
|
if (!isNull _holder) then {
|
||||||
_holderUniqueItems = [_holder] call FUNC(getAllGearContainer);
|
private _holderUniqueItems = [_holder] call FUNC(getAllGearContainer);
|
||||||
[_groundContainer, _holderUniqueItems] call FUNC(showItemsInListbox);
|
[_groundContainer, _holderUniqueItems] call FUNC(showItemsInListbox);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -26,7 +26,7 @@ params ["_listBoxCtrl", "_itemsCountArray"];
|
|||||||
private _count = (_itemsCountArray select 1) select _forEachIndex;
|
private _count = (_itemsCountArray select 1) select _forEachIndex;
|
||||||
|
|
||||||
if ((_classname != DUMMY_ITEM) && {_classname != "ACE_FakePrimaryWeapon"}) then { //Don't show the dummy potato or fake weapon
|
if ((_classname != DUMMY_ITEM) && {_classname != "ACE_FakePrimaryWeapon"}) then { //Don't show the dummy potato or fake weapon
|
||||||
private "_configPath";
|
private _configPath = configNull;
|
||||||
private _displayName = "";
|
private _displayName = "";
|
||||||
private _picture = "";
|
private _picture = "";
|
||||||
switch (true) do {
|
switch (true) do {
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_4(_startA,_endA,_startB,_endB);
|
params ["_startA", "_endA", "_startB", "_endB"];
|
||||||
|
|
||||||
//Quick Lazy Count Check
|
//Quick Lazy Count Check
|
||||||
if (((count _startA) + (count _startB)) != ((count _endA) + (count _endB))) exitWith {
|
if (((count _startA) + (count _startB)) != ((count _endA) + (count _endB))) exitWith {
|
||||||
|
@ -30,8 +30,8 @@ private _carriedItem = _unit getVariable [QGVAR(carriedObject), objNull];
|
|||||||
//disabled for persons
|
//disabled for persons
|
||||||
if (_carriedItem isKindOf "CAManBase") exitWith {false};
|
if (_carriedItem isKindOf "CAManBase") exitWith {false};
|
||||||
|
|
||||||
private _position = getPosATL _carriedItem;
|
private _position = getPosASL _carriedItem;
|
||||||
private _maxHeight = (_unit modelToWorldVisual [0,0,0]) select 2;
|
private _maxHeight = (_unit modelToWorldVisualWorld [0, 0, 0]) select 2;
|
||||||
|
|
||||||
_position set [2, ((_position select 2) + _scrollAmount min (_maxHeight + 1.5)) max _maxHeight];
|
_position set [2, ((_position select 2) + _scrollAmount min (_maxHeight + 1.5)) max _maxHeight];
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ _position set [2, ((_position select 2) + _scrollAmount min (_maxHeight + 1.5))
|
|||||||
detach _carriedItem;
|
detach _carriedItem;
|
||||||
|
|
||||||
// Uses this method of selecting position because setPosATL did not have immediate effect
|
// Uses this method of selecting position because setPosATL did not have immediate effect
|
||||||
private _positionChange = _position vectorDiff (getPosATL _carriedItem);
|
private _positionChange = _position vectorDiff (getPosASL _carriedItem);
|
||||||
private _selectionPosition = _unit worldToModel (ASLtoAGL getPosWorld _carriedItem);
|
private _selectionPosition = _unit worldToModel (ASLtoAGL getPosWorld _carriedItem);
|
||||||
_selectionPosition = _selectionPosition vectorAdd _positionChange;
|
_selectionPosition = _selectionPosition vectorAdd _positionChange;
|
||||||
_carriedItem attachTo [_unit, _selectionPosition];
|
_carriedItem attachTo [_unit, _selectionPosition];
|
||||||
|
@ -44,7 +44,7 @@ onSetup parameters:
|
|||||||
isAttachable = 0;
|
isAttachable = 0;
|
||||||
displayName = CSTRING(IRSensor);
|
displayName = CSTRING(IRSensor);
|
||||||
picture = QPATHTOF(Data\UI\PressurePlate.paa);
|
picture = QPATHTOF(Data\UI\PressurePlate.paa);
|
||||||
onPlace = "false";
|
onPlace = QUOTE(false);
|
||||||
};
|
};
|
||||||
class Timer {
|
class Timer {
|
||||||
isAttachable = 1;
|
isAttachable = 1;
|
||||||
@ -57,6 +57,6 @@ onSetup parameters:
|
|||||||
isAttachable = 0;
|
isAttachable = 0;
|
||||||
displayName = CSTRING(TripWire);
|
displayName = CSTRING(TripWire);
|
||||||
picture = QPATHTOF(Data\UI\Tripwire.paa);
|
picture = QPATHTOF(Data\UI\Tripwire.paa);
|
||||||
onPlace = "false";
|
onPlace = QUOTE(false);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -80,7 +80,7 @@ class RscACE_SelectTimeUI {
|
|||||||
y = 0.06;
|
y = 0.06;
|
||||||
w = 0.49;
|
w = 0.49;
|
||||||
h = 0.025;
|
h = 0.025;
|
||||||
onSliderPosChanged = "private ['_mins', '_secs'];_mins = floor((_this select 1)/60);_secs=floor((_this select 1) - (_mins*60));ctrlSetText [8870, format[localize 'STR_ACE_Explosives_TimerMenu',_mins, _secs]];";
|
onSliderPosChanged = "_mins = floor((_this select 1)/60);_secs=floor((_this select 1) - (_mins*60));ctrlSetText [8870, format[localize 'STR_ACE_Explosives_TimerMenu',_mins, _secs]];";
|
||||||
};
|
};
|
||||||
class cancelBtn: RscButton {
|
class cancelBtn: RscButton {
|
||||||
idc = 8855;
|
idc = 8855;
|
||||||
|
@ -21,23 +21,21 @@
|
|||||||
params ["_unit", "_explosive", "_magazineClass", "_extra"];
|
params ["_unit", "_explosive", "_magazineClass", "_extra"];
|
||||||
TRACE_4("params",_unit,_explosive,_magazineClass,_extra);
|
TRACE_4("params",_unit,_explosive,_magazineClass,_extra);
|
||||||
|
|
||||||
private ["_config", "_detonators", "_hasRequired", "_requiredItems", "_code", "_count", "_codeSet"];
|
|
||||||
|
|
||||||
// Config is the last item in the list of passed in items.
|
// Config is the last item in the list of passed in items.
|
||||||
_config = (_this select 3) select (count (_this select 3) - 1);
|
private _config = (_this select 3) select (count (_this select 3) - 1);
|
||||||
|
|
||||||
_requiredItems = getArray(_config >> "requires");
|
private _requiredItems = getArray(_config >> "requires");
|
||||||
_hasRequired = true;
|
private _hasRequired = true;
|
||||||
_detonators = [_unit] call FUNC(getDetonators);
|
private _detonators = [_unit] call FUNC(getDetonators);
|
||||||
{
|
{
|
||||||
if !(_x in _detonators) exitWith{
|
if !(_x in _detonators) exitWith{
|
||||||
_hasRequired = false;
|
_hasRequired = false;
|
||||||
};
|
};
|
||||||
} count _requiredItems;
|
} count _requiredItems;
|
||||||
|
|
||||||
_codeSet = false;
|
private _codeSet = false;
|
||||||
while {!_codeSet} do {
|
while {!_codeSet} do {
|
||||||
_code = str(round (random 9999));
|
private _code = str(round (random 9999));
|
||||||
_count = 4 - count (toArray _code);
|
_count = 4 - count (toArray _code);
|
||||||
while {_count > 0} do {
|
while {_count > 0} do {
|
||||||
_code = "0" + _code;
|
_code = "0" + _code;
|
||||||
@ -48,7 +46,7 @@ while {!_codeSet} do {
|
|||||||
if (isNil QGVAR(CellphoneIEDs)) then {
|
if (isNil QGVAR(CellphoneIEDs)) then {
|
||||||
GVAR(CellphoneIEDs) = [];
|
GVAR(CellphoneIEDs) = [];
|
||||||
};
|
};
|
||||||
_count = GVAR(CellphoneIEDs) pushBack [_explosive,_code,GetNumber(ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> "Cellphone" >> "FuseTime")];
|
private _count = GVAR(CellphoneIEDs) pushBack [_explosive,_code,GetNumber(ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> "Cellphone" >> "FuseTime")];
|
||||||
_count = _count + 1;
|
_count = _count + 1;
|
||||||
publicVariable QGVAR(CellphoneIEDs);
|
publicVariable QGVAR(CellphoneIEDs);
|
||||||
|
|
||||||
|
@ -21,14 +21,12 @@
|
|||||||
params ["_unit", "_explosive", "_magazineClass"];
|
params ["_unit", "_explosive", "_magazineClass"];
|
||||||
TRACE_3("params",_unit,_explosive,_magazineClass);
|
TRACE_3("params",_unit,_explosive,_magazineClass);
|
||||||
|
|
||||||
private ["_clacker", "_config", "_requiredItems", "_hasRequired", "_detonators"];
|
|
||||||
|
|
||||||
// Config is the last item in the list of passed in items.
|
// Config is the last item in the list of passed in items.
|
||||||
_config = (_this select 3) select (count (_this select 3) - 1);
|
private _config = (_this select 3) select (count (_this select 3) - 1);
|
||||||
|
|
||||||
_requiredItems = getArray(_config >> "requires");
|
private _requiredItems = getArray(_config >> "requires");
|
||||||
_hasRequired = true;
|
private _hasRequired = true;
|
||||||
_detonators = [_unit] call FUNC(getDetonators);
|
private _detonators = [_unit] call FUNC(getDetonators);
|
||||||
{
|
{
|
||||||
if !(_x in _detonators) exitWith{
|
if !(_x in _detonators) exitWith{
|
||||||
_hasRequired = false;
|
_hasRequired = false;
|
||||||
@ -36,9 +34,9 @@ _detonators = [_unit] call FUNC(getDetonators);
|
|||||||
} count _requiredItems;
|
} count _requiredItems;
|
||||||
|
|
||||||
if !(_hasRequired) exitWith {};
|
if !(_hasRequired) exitWith {};
|
||||||
_config = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> configName _config;
|
private _config = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> configName _config;
|
||||||
|
|
||||||
_clacker = _unit getVariable [QGVAR(Clackers), []];
|
private _clacker = _unit getVariable [QGVAR(Clackers), []];
|
||||||
GVAR(PlacedCount) = GVAR(PlacedCount) + 1;
|
GVAR(PlacedCount) = GVAR(PlacedCount) + 1;
|
||||||
|
|
||||||
_clacker pushBack [_explosive, getNumber(_config >> "FuseTime"), format [localize LSTRING(DetonateCode),
|
_clacker pushBack [_explosive, getNumber(_config >> "FuseTime"), format [localize LSTRING(DetonateCode),
|
||||||
|
@ -19,18 +19,16 @@
|
|||||||
params ["_unit", "_detonator"];
|
params ["_unit", "_detonator"];
|
||||||
TRACE_2("params",_unit,_detonator);
|
TRACE_2("params",_unit,_detonator);
|
||||||
|
|
||||||
private ["_result", "_item", "_children", "_range", "_required","_explosivesList"];
|
private _range = getNumber (ConfigFile >> "CfgWeapons" >> _detonator >> QGVAR(Range));
|
||||||
|
|
||||||
_range = getNumber (ConfigFile >> "CfgWeapons" >> _detonator >> QGVAR(Range));
|
private _result = [_unit] call FUNC(getPlacedExplosives);
|
||||||
|
private _children = [];
|
||||||
_result = [_unit] call FUNC(getPlacedExplosives);
|
private _explosivesList = [];
|
||||||
_children = [];
|
|
||||||
_explosivesList = [];
|
|
||||||
{
|
{
|
||||||
if (!isNull(_x select 0)) then {
|
if (!isNull(_x select 0)) then {
|
||||||
_required = getArray (ConfigFile >> "ACE_Triggers" >> (_x select 4) >> "requires");
|
private _required = getArray (ConfigFile >> "ACE_Triggers" >> (_x select 4) >> "requires");
|
||||||
if (_detonator in _required) then {
|
if (_detonator in _required) then {
|
||||||
_item = ConfigFile >> "CfgMagazines" >> (_x select 3);
|
private _item = ConfigFile >> "CfgMagazines" >> (_x select 3);
|
||||||
|
|
||||||
_explosivesList pushBack _x;
|
_explosivesList pushBack _x;
|
||||||
|
|
||||||
|
@ -18,15 +18,13 @@
|
|||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
TRACE_1("params",_unit);
|
TRACE_1("params",_unit);
|
||||||
|
|
||||||
private ["_mags", "_item", "_index", "_children", "_itemCount", "_list"];
|
private _mags = magazines _unit;
|
||||||
|
private _list = [];
|
||||||
_mags = magazines _unit;
|
private _itemCount = [];
|
||||||
_list = [];
|
|
||||||
_itemCount = [];
|
|
||||||
{
|
{
|
||||||
_item = ConfigFile >> "CfgMagazines" >> _x;
|
private _item = ConfigFile >> "CfgMagazines" >> _x;
|
||||||
if (getNumber(_item >> QGVAR(Placeable)) == 1) then {
|
if (getNumber(_item >> QGVAR(Placeable)) == 1) then {
|
||||||
_index = _list find _item;
|
private _index = _list find _item;
|
||||||
if (_index != -1) then {
|
if (_index != -1) then {
|
||||||
_itemCount set [_index, (_itemCount select _index) + 1];
|
_itemCount set [_index, (_itemCount select _index) + 1];
|
||||||
} else {
|
} else {
|
||||||
@ -36,7 +34,7 @@ _itemCount = [];
|
|||||||
};
|
};
|
||||||
} forEach _mags;
|
} forEach _mags;
|
||||||
|
|
||||||
_children = [];
|
private _children = [];
|
||||||
|
|
||||||
{
|
{
|
||||||
private _name = getText (_x >> "displayNameShort");
|
private _name = getText (_x >> "displayNameShort");
|
||||||
|
@ -19,10 +19,8 @@
|
|||||||
params ["_name", "_code"];
|
params ["_name", "_code"];
|
||||||
TRACE_2("params",_name,_code);
|
TRACE_2("params",_name,_code);
|
||||||
|
|
||||||
private ["_speedDial", "_found"];
|
private _speedDial = ace_player getVariable [QGVAR(SpeedDial), []];
|
||||||
|
private _found = false;
|
||||||
_speedDial = ace_player getVariable [QGVAR(SpeedDial), []];
|
|
||||||
_found = false;
|
|
||||||
|
|
||||||
if ((_code) == "") exitWith {
|
if ((_code) == "") exitWith {
|
||||||
[_name] call FUNC(removeFromSpeedDial);
|
[_name] call FUNC(removeFromSpeedDial);
|
||||||
|
@ -18,12 +18,10 @@
|
|||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
TRACE_1("params",_unit);
|
TRACE_1("params",_unit);
|
||||||
|
|
||||||
private ["_children", "_config", "_detonators"];
|
private _detonators = [_unit] call FUNC(getDetonators);
|
||||||
|
private _children = [];
|
||||||
_detonators = [_unit] call FUNC(getDetonators);
|
|
||||||
_children = [];
|
|
||||||
{
|
{
|
||||||
_config = ConfigFile >> "CfgWeapons" >> _x;
|
private _config = ConfigFile >> "CfgWeapons" >> _x;
|
||||||
_children pushBack
|
_children pushBack
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
|
@ -19,16 +19,14 @@
|
|||||||
params ["_magazine", "_explosive"];
|
params ["_magazine", "_explosive"];
|
||||||
TRACE_2("params",_magazine,_explosive);
|
TRACE_2("params",_magazine,_explosive);
|
||||||
|
|
||||||
private ["_hasRequiredItems","_triggerTypes", "_children", "_detonators", "_required", "_magTriggers", "_isAttached"];
|
private _isAttached = !isNull (attachedTo _explosive);
|
||||||
|
private _detonators = [ACE_player] call FUNC(getDetonators);
|
||||||
_isAttached = !isNull (attachedTo _explosive);
|
private _triggerTypes = [_magazine] call FUNC(triggerType);
|
||||||
_detonators = [ACE_player] call FUNC(getDetonators);
|
private _magTriggers = ConfigFile >> "CfgMagazines" >> _magazine >> "ACE_Triggers";
|
||||||
_triggerTypes = [_magazine] call FUNC(triggerType);
|
private _children = [];
|
||||||
_magTriggers = ConfigFile >> "CfgMagazines" >> _magazine >> "ACE_Triggers";
|
|
||||||
_children = [];
|
|
||||||
{
|
{
|
||||||
_required = getArray (_x >> "requires");
|
private _required = getArray (_x >> "requires");
|
||||||
_hasRequiredItems = true;
|
private _hasRequiredItems = true;
|
||||||
{
|
{
|
||||||
if !(_x in _detonators) exitWith {
|
if !(_x in _detonators) exitWith {
|
||||||
_hasRequiredItems = false;
|
_hasRequiredItems = false;
|
||||||
|
@ -24,12 +24,10 @@
|
|||||||
params ["_unit", "_range", "_item", ["_triggerClassname", "#unknown", [""]]];
|
params ["_unit", "_range", "_item", ["_triggerClassname", "#unknown", [""]]];
|
||||||
TRACE_4("detonateExplosive",_unit,_range,_item,_triggerClassname);
|
TRACE_4("detonateExplosive",_unit,_range,_item,_triggerClassname);
|
||||||
|
|
||||||
private ["_result", "_ignoreRange", "_pos"];
|
private _ignoreRange = (_range == -1);
|
||||||
|
|
||||||
_ignoreRange = (_range == -1);
|
|
||||||
if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {TRACE_1("out of range",_range); false};
|
if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {TRACE_1("out of range",_range); false};
|
||||||
|
|
||||||
_result = true;
|
private _result = true;
|
||||||
{
|
{
|
||||||
// Pass [Unit<OBJECT>, MaxRange <NUMBER>, Explosive <OBJECT>, FuzeTime <NUMBER>, TriggerItem <STRING>]
|
// Pass [Unit<OBJECT>, MaxRange <NUMBER>, Explosive <OBJECT>, FuzeTime <NUMBER>, TriggerItem <STRING>]
|
||||||
private _handlerResult = [_unit, _range, _item select 0, _item select 1, _triggerClassname] call _x;
|
private _handlerResult = [_unit, _range, _item select 0, _item select 1, _triggerClassname] call _x;
|
||||||
@ -38,14 +36,13 @@ _result = true;
|
|||||||
if (!_result) exitWith {false};
|
if (!_result) exitWith {false};
|
||||||
|
|
||||||
if (getNumber (ConfigFile >> "CfgAmmo" >> typeOf (_item select 0) >> "TriggerWhenDestroyed") == 0) then {
|
if (getNumber (ConfigFile >> "CfgAmmo" >> typeOf (_item select 0) >> "TriggerWhenDestroyed") == 0) then {
|
||||||
private ["_exp", "_previousExp"];
|
private _previousExp = _item select 0;
|
||||||
_previousExp = _item select 0;
|
private _exp = getText (ConfigFile >> "CfgAmmo" >> typeOf (_previousExp) >> QGVAR(Explosive));
|
||||||
_exp = getText (ConfigFile >> "CfgAmmo" >> typeOf (_previousExp) >> QGVAR(Explosive));
|
|
||||||
if (_exp != "") then {
|
if (_exp != "") then {
|
||||||
_exp = createVehicle [_exp, [0,0,15001], [], 0, "NONE"];
|
_exp = createVehicle [_exp, [0,0,15001], [], 0, "NONE"];
|
||||||
_exp setDir (getDir _previousExp);
|
_exp setDir (getDir _previousExp);
|
||||||
_item set [0, _exp];
|
_item set [0, _exp];
|
||||||
_pos = getPosASL _previousExp;
|
private _pos = getPosASL _previousExp;
|
||||||
deleteVehicle _previousExp;
|
deleteVehicle _previousExp;
|
||||||
_exp setPosASL _pos;
|
_exp setPosASL _pos;
|
||||||
};
|
};
|
||||||
|
@ -19,23 +19,20 @@
|
|||||||
params ["_unit", "_code"];
|
params ["_unit", "_code"];
|
||||||
TRACE_2("params",_unit,_code);
|
TRACE_2("params",_unit,_code);
|
||||||
|
|
||||||
private ["_arr", "_ran", "_i"];
|
|
||||||
|
|
||||||
if (_unit getVariable [QGVAR(Dialing),false]) exitWith {};
|
if (_unit getVariable [QGVAR(Dialing),false]) exitWith {};
|
||||||
if !(alive _unit) exitWith {};
|
if !(alive _unit) exitWith {};
|
||||||
_unit setVariable [QGVAR(Dialing), true, true];
|
_unit setVariable [QGVAR(Dialing), true, true];
|
||||||
|
|
||||||
_ran = (ceil(random 8)) + 1;
|
private _ran = (ceil(random 8)) + 1;
|
||||||
_arr = [];
|
private _arr = [];
|
||||||
for [{_i=0}, {_i<_ran}, {_i=_i + 1}] do {
|
for "_i" from 1 to _ran do {
|
||||||
_arr = _arr + ['.','..','...',''];
|
_arr = _arr + ['.','..','...',''];
|
||||||
};
|
};
|
||||||
if (_unit == ace_player) then {
|
if (_unit == ace_player) then {
|
||||||
ctrlSetText [1400,"Calling"];
|
ctrlSetText [1400,"Calling"];
|
||||||
[FUNC(dialingPhone), 0.25, [_unit,4,_arr,_code]] call CALLSTACK(CBA_fnc_addPerFrameHandler);
|
[FUNC(dialingPhone), 0.25, [_unit,4,_arr,_code]] call CALLSTACK(CBA_fnc_addPerFrameHandler);
|
||||||
} else {
|
} else {
|
||||||
private ["_explosive"];
|
private _explosive = [_code] call FUNC(getSpeedDialExplosive);
|
||||||
_explosive = [_code] call FUNC(getSpeedDialExplosive);
|
|
||||||
if ((count _explosive) > 0) then {
|
if ((count _explosive) > 0) then {
|
||||||
[{
|
[{
|
||||||
playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)),objNull, false, getPosASL (_this select 1),3.16228,1,75];
|
playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)),objNull, false, getPosASL (_this select 1),3.16228,1,75];
|
||||||
|
@ -21,16 +21,14 @@
|
|||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
TRACE_1("params",_unit);
|
TRACE_1("params",_unit);
|
||||||
|
|
||||||
private ["_clackerList", "_adjustedList", "_list", "_filter"];
|
private _filter = nil;
|
||||||
|
|
||||||
_filter = nil;
|
|
||||||
if (count _this > 1) then {
|
if (count _this > 1) then {
|
||||||
_filter = ConfigFile >> "ACE_Triggers" >> (_this select 1);
|
_filter = ConfigFile >> "ACE_Triggers" >> (_this select 1);
|
||||||
};
|
};
|
||||||
_clackerList = [];
|
private _clackerList = [];
|
||||||
_adjustedList = false;
|
private _adjustedList = false;
|
||||||
_clackerList = _unit getVariable [QGVAR(Clackers), []];
|
_clackerList = _unit getVariable [QGVAR(Clackers), []];
|
||||||
_list = [];
|
private _list = [];
|
||||||
{
|
{
|
||||||
if (isNull (_x select 0)) then {
|
if (isNull (_x select 0)) then {
|
||||||
_clackerList set [_forEachIndex, "X"];
|
_clackerList set [_forEachIndex, "X"];
|
||||||
|
@ -18,10 +18,8 @@
|
|||||||
params ["_code"];
|
params ["_code"];
|
||||||
TRACE_1("params",_code);
|
TRACE_1("params",_code);
|
||||||
|
|
||||||
private ["_explosive"];
|
|
||||||
|
|
||||||
if (isNil QGVAR(CellphoneIEDs)) exitWith {[]};
|
if (isNil QGVAR(CellphoneIEDs)) exitWith {[]};
|
||||||
_explosive = [];
|
private _explosive = [];
|
||||||
{
|
{
|
||||||
if ((_x select 1) == _code) exitWith {
|
if ((_x select 1) == _code) exitWith {
|
||||||
_explosive = _x;
|
_explosive = _x;
|
||||||
|
@ -18,10 +18,8 @@
|
|||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
TRACE_1("params",_unit);
|
TRACE_1("params",_unit);
|
||||||
|
|
||||||
private ["_result", "_magazines"];
|
private _result = false;
|
||||||
|
private _magazines = magazines _unit;
|
||||||
_result = false;
|
|
||||||
_magazines = magazines _unit;
|
|
||||||
{
|
{
|
||||||
if (getNumber (ConfigFile >> "CfgMagazines" >> _x >> QGVAR(Placeable)) == 1) exitWith {
|
if (getNumber (ConfigFile >> "CfgMagazines" >> _x >> QGVAR(Placeable)) == 1) exitWith {
|
||||||
_result = true;
|
_result = true;
|
||||||
|
@ -41,12 +41,12 @@ if (!("ACE_DefusalKit" in (items ACE_player))) exitWith {};
|
|||||||
//If player moved >5 meters from last pos, then rescan
|
//If player moved >5 meters from last pos, then rescan
|
||||||
if (((getPosASL ace_player) distance _setPosition) > 5) then {
|
if (((getPosASL ace_player) distance _setPosition) > 5) then {
|
||||||
{
|
{
|
||||||
if (((_x distance ACE_player) < 15) && {!(_x in _minesHelped)}) then {
|
if (((_x distance ACE_player) < 15) && {!(_x in _minesHelped)} && {(getModelInfo _x) select 0 != "empty.p3d"}) then {
|
||||||
|
|
||||||
private _config = configFile >> "CfgAmmo" >> typeOf _x;
|
private _config = configFile >> "CfgAmmo" >> typeOf _x;
|
||||||
private _size = getNumber (_config >> QGVAR(size));
|
private _size = getNumber (_config >> QGVAR(size));
|
||||||
TRACE_3("Making Defuse Helper",(_x),(typeOf _x),(_size == 1));
|
TRACE_3("Making Defuse Helper",(_x),(typeOf _x),(_size == 1));
|
||||||
private ["_defuseHelper"];
|
private _defuseHelper = objNull;
|
||||||
if (_size == 1) then {
|
if (_size == 1) then {
|
||||||
_defuseHelper = "ACE_DefuseObject_Large" createVehicleLocal (getPos _x);
|
_defuseHelper = "ACE_DefuseObject_Large" createVehicleLocal (getPos _x);
|
||||||
} else {
|
} else {
|
||||||
|
@ -25,8 +25,7 @@ if ((_receiver != ace_player) && {_giver != ace_player}) exitWith {};
|
|||||||
|
|
||||||
private _config = ConfigFile >> "CfgWeapons" >> _item;
|
private _config = ConfigFile >> "CfgWeapons" >> _item;
|
||||||
if (isClass _config && {getNumber(_config >> QGVAR(Detonator)) == 1}) then {
|
if (isClass _config && {getNumber(_config >> QGVAR(Detonator)) == 1}) then {
|
||||||
private ["_clackerItems"];
|
private _clackerItems = _giver getVariable [QGVAR(Clackers), []];
|
||||||
_clackerItems = _giver getVariable [QGVAR(Clackers), []];
|
|
||||||
_receiver setVariable [QGVAR(Clackers), (_receiver getVariable [QGVAR(Clackers), []]) + _clackerItems, true];
|
_receiver setVariable [QGVAR(Clackers), (_receiver getVariable [QGVAR(Clackers), []]) + _clackerItems, true];
|
||||||
|
|
||||||
private _detonators = [_giver] call FUNC(getDetonators);
|
private _detonators = [_giver] call FUNC(getDetonators);
|
||||||
|
@ -24,11 +24,9 @@
|
|||||||
params ["_unit", "_pos", "_dir", "_magazineClass", "_triggerConfig", "_triggerSpecificVars", ["_setupPlaceholderObject", objNull]];
|
params ["_unit", "_pos", "_dir", "_magazineClass", "_triggerConfig", "_triggerSpecificVars", ["_setupPlaceholderObject", objNull]];
|
||||||
TRACE_7("params",_unit,_pos,_dir,_magazineClass,_triggerConfig,_triggerSpecificVars,_setupPlaceholderObject);
|
TRACE_7("params",_unit,_pos,_dir,_magazineClass,_triggerConfig,_triggerSpecificVars,_setupPlaceholderObject);
|
||||||
|
|
||||||
private ["_ammo", "_explosive", "_attachedTo", "_magazineTrigger", "_pitch", "_digDistance", "_canDigDown", "_soundEnviron", "_surfaceType"];
|
|
||||||
|
|
||||||
[_unit, "PutDown"] call EFUNC(common,doGesture);
|
[_unit, "PutDown"] call EFUNC(common,doGesture);
|
||||||
|
|
||||||
_attachedTo = objNull;
|
private _attachedTo = objNull;
|
||||||
if (!isNull _setupPlaceholderObject) then {
|
if (!isNull _setupPlaceholderObject) then {
|
||||||
_attachedTo = attachedTo _setupPlaceholderObject;
|
_attachedTo = attachedTo _setupPlaceholderObject;
|
||||||
deleteVehicle _setupPlaceholderObject;
|
deleteVehicle _setupPlaceholderObject;
|
||||||
@ -39,7 +37,7 @@ if (isNil "_triggerConfig") exitWith {
|
|||||||
objNull
|
objNull
|
||||||
};
|
};
|
||||||
|
|
||||||
_magazineTrigger = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> _triggerConfig;
|
private _magazineTrigger = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> _triggerConfig;
|
||||||
_triggerConfig = ConfigFile >> "ACE_Triggers" >> _triggerConfig;
|
_triggerConfig = ConfigFile >> "ACE_Triggers" >> _triggerConfig;
|
||||||
|
|
||||||
if (isNil "_triggerConfig") exitWith {
|
if (isNil "_triggerConfig") exitWith {
|
||||||
@ -47,7 +45,7 @@ if (isNil "_triggerConfig") exitWith {
|
|||||||
objNull
|
objNull
|
||||||
};
|
};
|
||||||
|
|
||||||
_ammo = getText(ConfigFile >> "CfgMagazines" >> _magazineClass >> "ammo");
|
private _ammo = getText(ConfigFile >> "CfgMagazines" >> _magazineClass >> "ammo");
|
||||||
if (isText(_magazineTrigger >> "ammo")) then {
|
if (isText(_magazineTrigger >> "ammo")) then {
|
||||||
_ammo = getText (_magazineTrigger >> "ammo");
|
_ammo = getText (_magazineTrigger >> "ammo");
|
||||||
};
|
};
|
||||||
@ -55,14 +53,14 @@ _triggerSpecificVars pushBack _triggerConfig;
|
|||||||
|
|
||||||
//Dig the explosive down into the ground (usually on "pressurePlate")
|
//Dig the explosive down into the ground (usually on "pressurePlate")
|
||||||
if (isNumber (_magazineTrigger >> "digDistance")) then {
|
if (isNumber (_magazineTrigger >> "digDistance")) then {
|
||||||
_digDistance = getNumber (_magazineTrigger >> "digDistance");
|
private _digDistance = getNumber (_magazineTrigger >> "digDistance");
|
||||||
|
|
||||||
//Get Surface Type:
|
//Get Surface Type:
|
||||||
_canDigDown = true;
|
private _canDigDown = true;
|
||||||
_surfaceType = surfaceType _pos;
|
private _surfaceType = surfaceType _pos;
|
||||||
if ((_surfaceType select [0,1]) == "#") then {_surfaceType = _surfaceType select [1, 99];};
|
if ((_surfaceType select [0,1]) == "#") then {_surfaceType = _surfaceType select [1, 99];};
|
||||||
if ((_surfaceType != "") || {isClass (configFile >> "CfgSurfaces" >> _surfaceType >> "soundEnviron")}) then {
|
if ((_surfaceType != "") || {isClass (configFile >> "CfgSurfaces" >> _surfaceType >> "soundEnviron")}) then {
|
||||||
_soundEnviron = getText (configFile >> "CfgSurfaces" >> _surfaceType >> "soundEnviron");
|
private _soundEnviron = getText (configFile >> "CfgSurfaces" >> _surfaceType >> "soundEnviron");
|
||||||
TRACE_2("Dig Down Surface",_surfaceType,_soundEnviron);
|
TRACE_2("Dig Down Surface",_surfaceType,_soundEnviron);
|
||||||
_canDigDown = !(_soundEnviron in ["road", "tarmac", "concrete", "concrete_int", "int_concrete", "concrete_ext"]);
|
_canDigDown = !(_soundEnviron in ["road", "tarmac", "concrete", "concrete_int", "int_concrete", "concrete_ext"]);
|
||||||
};
|
};
|
||||||
@ -75,7 +73,7 @@ if (isNumber (_magazineTrigger >> "digDistance")) then {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
_explosive = createVehicle [_ammo, _pos, [], 0, "NONE"];
|
private _explosive = createVehicle [_ammo, _pos, [], 0, "NONE"];
|
||||||
_explosive setPosATL _pos;
|
_explosive setPosATL _pos;
|
||||||
|
|
||||||
if (!isNull _attachedTo) then {
|
if (!isNull _attachedTo) then {
|
||||||
@ -91,7 +89,7 @@ if (isText(_triggerConfig >> "onPlace") && {[_unit,_explosive,_magazineClass,_tr
|
|||||||
|
|
||||||
//TODO: placing explosives on hills looks funny
|
//TODO: placing explosives on hills looks funny
|
||||||
|
|
||||||
_pitch = getNumber (_magazineTrigger >> "pitch");
|
private _pitch = getNumber (_magazineTrigger >> "pitch");
|
||||||
|
|
||||||
//Globaly set the position and angle:
|
//Globaly set the position and angle:
|
||||||
[QGVAR(place), [_explosive, _dir, _pitch, _unit]] call CBA_fnc_globalEvent;
|
[QGVAR(place), [_explosive, _dir, _pitch, _unit]] call CBA_fnc_globalEvent;
|
||||||
|
@ -24,12 +24,10 @@
|
|||||||
params ["_vehicle", "_unit", "_magClassname"];
|
params ["_vehicle", "_unit", "_magClassname"];
|
||||||
TRACE_3("params",_vehicle,_unit,_magClassname);
|
TRACE_3("params",_vehicle,_unit,_magClassname);
|
||||||
|
|
||||||
private ["_isAttachable", "_setupObjectClass", "_supportedTriggers", "_p3dModel"];
|
|
||||||
|
|
||||||
//Get setup object vehicle and model:
|
//Get setup object vehicle and model:
|
||||||
_setupObjectClass = getText(ConfigFile >> "CfgMagazines" >> _magClassname >> QGVAR(SetupObject));
|
private _setupObjectClass = getText(ConfigFile >> "CfgMagazines" >> _magClassname >> QGVAR(SetupObject));
|
||||||
if (!isClass (configFile >> "CfgVehicles" >> _setupObjectClass)) exitWith {ERROR("Bad Vehicle");};
|
if (!isClass (configFile >> "CfgVehicles" >> _setupObjectClass)) exitWith {ERROR("Bad Vehicle");};
|
||||||
_p3dModel = getText (configFile >> "CfgVehicles" >> _setupObjectClass >> "model");
|
private _p3dModel = getText (configFile >> "CfgVehicles" >> _setupObjectClass >> "model");
|
||||||
if (_p3dModel == "") exitWith {ERROR("No Model");}; //"" - will crash game!
|
if (_p3dModel == "") exitWith {ERROR("No Model");}; //"" - will crash game!
|
||||||
|
|
||||||
[_unit, "forceWalk", "ACE_Explosives", true] call EFUNC(common,statusEffect_set);
|
[_unit, "forceWalk", "ACE_Explosives", true] call EFUNC(common,statusEffect_set);
|
||||||
@ -44,8 +42,8 @@ _unit setVariable [QGVAR(cancelActionEH), [_unit, "zoomtemp", {true}, {GVAR(plac
|
|||||||
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetModel _p3dModel;
|
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetModel _p3dModel;
|
||||||
|
|
||||||
//Make sure it has a trigger that works when attached (eg, no tripwires that only do pressurePlate)
|
//Make sure it has a trigger that works when attached (eg, no tripwires that only do pressurePlate)
|
||||||
_isAttachable = false;
|
private _isAttachable = false;
|
||||||
_supportedTriggers = getArray (configFile >> "CfgMagazines" >> _magClassname >> "ACE_Triggers" >> "SupportedTriggers");
|
private _supportedTriggers = getArray (configFile >> "CfgMagazines" >> _magClassname >> "ACE_Triggers" >> "SupportedTriggers");
|
||||||
{
|
{
|
||||||
if ((getNumber (configFile >> "ACE_Triggers" >> _x >> "isAttachable")) == 1) exitWith {_isAttachable = true;};
|
if ((getNumber (configFile >> "ACE_Triggers" >> _x >> "isAttachable")) == 1) exitWith {_isAttachable = true;};
|
||||||
} forEach _supportedTriggers;
|
} forEach _supportedTriggers;
|
||||||
@ -62,10 +60,8 @@ GVAR(TweakedAngle) = 0;
|
|||||||
params ["_args", "_pfID"];
|
params ["_args", "_pfID"];
|
||||||
_args params ["_unit", "_magClassname", "_setupObjectClass", "_isAttachable"];
|
_args params ["_unit", "_magClassname", "_setupObjectClass", "_isAttachable"];
|
||||||
|
|
||||||
private ["_angle", "_attachVehicle", "_badPosition", "_basePosASL", "_cameraAngle", "_distanceFromBase", "_expSetupVehicle", "_index", "_intersectsWith", "_lookDirVector", "_max", "_min", "_modelDir", "_modelOffset", "_modelUp", "_placeAngle", "_realDistance", "_return", "_screenPos", "_testBase", "_testPos", "_testPositionIsValid", "_virtualPosASL"];
|
private _lookDirVector = ((positionCameraToWorld [0,0,0]) call EFUNC(common,positionToASL)) vectorFromTo ((positionCameraToWorld [0,0,10]) call EFUNC(common,positionToASL));
|
||||||
|
private _basePosASL = (eyePos _unit);
|
||||||
_lookDirVector = ((positionCameraToWorld [0,0,0]) call EFUNC(common,positionToASL)) vectorFromTo ((positionCameraToWorld [0,0,10]) call EFUNC(common,positionToASL));
|
|
||||||
_basePosASL = (eyePos _unit);
|
|
||||||
if (cameraView == "EXTERNAL") then { //If external, show explosive over the right shoulder
|
if (cameraView == "EXTERNAL") then { //If external, show explosive over the right shoulder
|
||||||
_basePosASL = _basePosASL vectorAdd ((positionCameraToWorld [0.3,0,0]) vectorDiff (positionCameraToWorld [0,0,0]));
|
_basePosASL = _basePosASL vectorAdd ((positionCameraToWorld [0.3,0,0]) vectorDiff (positionCameraToWorld [0,0,0]));
|
||||||
};
|
};
|
||||||
@ -74,13 +70,13 @@ GVAR(TweakedAngle) = 0;
|
|||||||
_basePosASL set [2, ((_basePosASL select 2) - 0.3)];
|
_basePosASL set [2, ((_basePosASL select 2) - 0.3)];
|
||||||
_lookDirVector = ((positionCameraToWorld [0,0,0]) call EFUNC(common,positionToASL)) vectorFromTo ((positionCameraToWorld [0,3,10]) call EFUNC(common,positionToASL));
|
_lookDirVector = ((positionCameraToWorld [0,0,0]) call EFUNC(common,positionToASL)) vectorFromTo ((positionCameraToWorld [0,3,10]) call EFUNC(common,positionToASL));
|
||||||
};
|
};
|
||||||
_cameraAngle = (_lookDirVector select 0) atan2 (_lookDirVector select 1);
|
private _cameraAngle = (_lookDirVector select 0) atan2 (_lookDirVector select 1);
|
||||||
|
|
||||||
_testPositionIsValid = {
|
private _testPositionIsValid = {
|
||||||
_testBase = _basePosASL vectorAdd (_lookDirVector vectorMultiply (_this select 0));
|
private _testBase = _basePosASL vectorAdd (_lookDirVector vectorMultiply (_this select 0));
|
||||||
_return = true;
|
private _return = true;
|
||||||
{
|
{
|
||||||
_testPos = _testBase vectorAdd [0.1 * (_x select 0) * (cos _cameraAngle), 0.1 * (_x select 0) * (sin _cameraAngle), 0.1 * (_x select 1)];
|
private _testPos = _testBase vectorAdd [0.1 * (_x select 0) * (cos _cameraAngle), 0.1 * (_x select 0) * (sin _cameraAngle), 0.1 * (_x select 1)];
|
||||||
#ifdef DEBUG_MODE_FULL
|
#ifdef DEBUG_MODE_FULL
|
||||||
drawLine3d [(eyePos _unit) call EFUNC(common,ASLToPosition), (_testPos) call EFUNC(common,ASLToPosition), [1,0,0,1]];
|
drawLine3d [(eyePos _unit) call EFUNC(common,ASLToPosition), (_testPos) call EFUNC(common,ASLToPosition), [1,0,0,1]];
|
||||||
#endif
|
#endif
|
||||||
@ -89,22 +85,22 @@ GVAR(TweakedAngle) = 0;
|
|||||||
_return
|
_return
|
||||||
};
|
};
|
||||||
|
|
||||||
_distanceFromBase = PLACE_RANGE_MAX;
|
private _distanceFromBase = PLACE_RANGE_MAX;
|
||||||
_badPosition = !([_distanceFromBase] call _testPositionIsValid);
|
private _badPosition = !([_distanceFromBase] call _testPositionIsValid);
|
||||||
_attachVehicle = objNull;
|
private _attachVehicle = objNull;
|
||||||
|
|
||||||
if (_isAttachable && _badPosition) then {
|
if (_isAttachable && _badPosition) then {
|
||||||
_attachVehicle = objNull;
|
_attachVehicle = objNull;
|
||||||
_testBase = _basePosASL vectorAdd _lookDirVector;
|
private _testBase = _basePosASL vectorAdd _lookDirVector;
|
||||||
{
|
{
|
||||||
_testPos = _testBase vectorAdd [0.1 * (_x select 0) * (cos _cameraAngle), 0.1 * (_x select 0) * (sin _cameraAngle), 0.1 * (_x select 1)];
|
private _testPos = _testBase vectorAdd [0.1 * (_x select 0) * (cos _cameraAngle), 0.1 * (_x select 0) * (sin _cameraAngle), 0.1 * (_x select 1)];
|
||||||
_intersectsWith = lineIntersectsWith [eyePos _unit, _testPos, _unit];
|
private _intersectsWith = lineIntersectsWith [eyePos _unit, _testPos, _unit];
|
||||||
if (count _intersectsWith == 1) exitWith {_attachVehicle = (_intersectsWith select 0);};
|
if (count _intersectsWith == 1) exitWith {_attachVehicle = (_intersectsWith select 0);};
|
||||||
} forEach [[0,0], [-1,-1], [1,-1], [-1,1], [1,1]];
|
} forEach [[0,0], [-1,-1], [1,-1], [-1,1], [1,1]];
|
||||||
if ((!isNull _attachVehicle) && {[PLACE_RANGE_MIN] call _testPositionIsValid} &&
|
if ((!isNull _attachVehicle) && {[PLACE_RANGE_MIN] call _testPositionIsValid} &&
|
||||||
{(_attachVehicle isKindOf "Car") || {_attachVehicle isKindOf "Tank"} || {_attachVehicle isKindOf "Air"} || {_attachVehicle isKindOf "Ship"}}) then {
|
{(_attachVehicle isKindOf "Car") || {_attachVehicle isKindOf "Tank"} || {_attachVehicle isKindOf "Air"} || {_attachVehicle isKindOf "Ship"}}) then {
|
||||||
_min = PLACE_RANGE_MIN;
|
private _min = PLACE_RANGE_MIN;
|
||||||
_max = PLACE_RANGE_MAX;
|
private _max = PLACE_RANGE_MAX;
|
||||||
for "_index" from 0 to 6 do {
|
for "_index" from 0 to 6 do {
|
||||||
_distanceFromBase = (_min + _max) / 2;
|
_distanceFromBase = (_min + _max) / 2;
|
||||||
if ([_distanceFromBase] call _testPositionIsValid) then {
|
if ([_distanceFromBase] call _testPositionIsValid) then {
|
||||||
@ -120,7 +116,7 @@ GVAR(TweakedAngle) = 0;
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
_virtualPosASL = _basePosASL vectorAdd (_lookDirVector vectorMultiply _distanceFromBase);
|
private _virtualPosASL = _basePosASL vectorAdd (_lookDirVector vectorMultiply _distanceFromBase);
|
||||||
|
|
||||||
//Update mouse hint:
|
//Update mouse hint:
|
||||||
if (_badPosition) then {
|
if (_badPosition) then {
|
||||||
@ -160,8 +156,8 @@ GVAR(TweakedAngle) = 0;
|
|||||||
(QGVAR(virtualAmmo) call BIS_fnc_rscLayer) cutText ["", "PLAIN"];
|
(QGVAR(virtualAmmo) call BIS_fnc_rscLayer) cutText ["", "PLAIN"];
|
||||||
|
|
||||||
if (GVAR(placeAction) == PLACE_APPROVE) then {
|
if (GVAR(placeAction) == PLACE_APPROVE) then {
|
||||||
_placeAngle = 0;
|
private _placeAngle = 0;
|
||||||
_expSetupVehicle = _setupObjectClass createVehicle (_virtualPosASL call EFUNC(common,ASLToPosition));
|
private _expSetupVehicle = _setupObjectClass createVehicle (_virtualPosASL call EFUNC(common,ASLToPosition));
|
||||||
|
|
||||||
TRACE_1("Planting Mass", (getMass _expSetupVehicle));
|
TRACE_1("Planting Mass", (getMass _expSetupVehicle));
|
||||||
//If the object is too heavy, it can kill a player if it colides
|
//If the object is too heavy, it can kill a player if it colides
|
||||||
@ -173,7 +169,7 @@ GVAR(TweakedAngle) = 0;
|
|||||||
_expSetupVehicle setDir _placeAngle;
|
_expSetupVehicle setDir _placeAngle;
|
||||||
_placeAngle = _placeAngle + 180; //CfgAmmos seem to be 180 for some reason
|
_placeAngle = _placeAngle + 180; //CfgAmmos seem to be 180 for some reason
|
||||||
} else {
|
} else {
|
||||||
_modelOffset = _attachVehicle worldToModel (_virtualPosASL call EFUNC(common,ASLToPosition));
|
private _modelOffset = _attachVehicle worldToModel (_virtualPosASL call EFUNC(common,ASLToPosition));
|
||||||
_placeAngle = _cameraAngle - (getDir _attachVehicle) + 180;
|
_placeAngle = _cameraAngle - (getDir _attachVehicle) + 180;
|
||||||
_expSetupVehicle attachTo [_attachVehicle, _modelOffset];
|
_expSetupVehicle attachTo [_attachVehicle, _modelOffset];
|
||||||
_expSetupVehicle setVectorDirAndUp [[0,0,-1],[(sin _placeAngle),(cos _placeAngle),0]];
|
_expSetupVehicle setVectorDirAndUp [[0,0,-1],[(sin _placeAngle),(cos _placeAngle),0]];
|
||||||
@ -191,21 +187,21 @@ GVAR(TweakedAngle) = 0;
|
|||||||
|
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
_screenPos = worldToScreen (_virtualPosASL call EFUNC(common,ASLToPosition));
|
private _screenPos = worldToScreen (_virtualPosASL call EFUNC(common,ASLToPosition));
|
||||||
if (_badPosition || {_screenPos isEqualTo []}) then {
|
if (_badPosition || {_screenPos isEqualTo []}) then {
|
||||||
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow false;
|
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow false;
|
||||||
} else {
|
} else {
|
||||||
//Show the model on the hud in aprox the same size/location as it will be placed:
|
//Show the model on the hud in aprox the same size/location as it will be placed:
|
||||||
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow true;
|
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow true;
|
||||||
|
|
||||||
_realDistance = ((_virtualPosASL call EFUNC(common,ASLToPosition)) distance (positionCameraToWorld [0,0,0])) / ((call CBA_fnc_getFov) select 1);
|
private _realDistance = ((_virtualPosASL call EFUNC(common,ASLToPosition)) distance (positionCameraToWorld [0,0,0])) / ((call CBA_fnc_getFov) select 1);
|
||||||
_screenPos = [(_screenPos select 0), _realDistance, (_screenPos select 1)];
|
_screenPos = [(_screenPos select 0), _realDistance, (_screenPos select 1)];
|
||||||
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetPosition _screenPos;
|
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetPosition _screenPos;
|
||||||
|
|
||||||
_modelDir = [0,0,-1];
|
private _modelDir = [0,0,-1];
|
||||||
_modelUp = [0,-1,0];
|
private _modelUp = [0,-1,0];
|
||||||
if (isNull _attachVehicle) then {
|
if (isNull _attachVehicle) then {
|
||||||
_angle = acos (_lookDirVector select 2);
|
private _angle = acos (_lookDirVector select 2);
|
||||||
_modelUp = [0, (cos _angle), (sin _angle)];
|
_modelUp = [0, (cos _angle), (sin _angle)];
|
||||||
_modelDir = [cos GVAR(TweakedAngle), sin GVAR(TweakedAngle), 0] vectorCrossProduct _modelUp;
|
_modelDir = [cos GVAR(TweakedAngle), sin GVAR(TweakedAngle), 0] vectorCrossProduct _modelUp;
|
||||||
};
|
};
|
||||||
|
@ -19,15 +19,12 @@
|
|||||||
params ["_unit", "_target"];
|
params ["_unit", "_target"];
|
||||||
TRACE_2("params",_unit,_target);
|
TRACE_2("params",_unit,_target);
|
||||||
|
|
||||||
private ["_actionToPlay", "_defuseTime", "_isEOD"];
|
|
||||||
|
|
||||||
_target = attachedTo (_target);
|
_target = attachedTo (_target);
|
||||||
|
|
||||||
_fnc_DefuseTime = {
|
private _fnc_DefuseTime = {
|
||||||
params ["_specialist", "_target"];
|
params ["_specialist", "_target"];
|
||||||
TRACE_2("defuseTime",_specialist,_target);
|
TRACE_2("defuseTime",_specialist,_target);
|
||||||
private ["_defuseTime"];
|
private _defuseTime = 5;
|
||||||
_defuseTime = 5;
|
|
||||||
if (isNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> QGVAR(DefuseTime))) then {
|
if (isNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> QGVAR(DefuseTime))) then {
|
||||||
_defuseTime = getNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> QGVAR(DefuseTime));
|
_defuseTime = getNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> QGVAR(DefuseTime));
|
||||||
};
|
};
|
||||||
@ -36,7 +33,7 @@ _fnc_DefuseTime = {
|
|||||||
};
|
};
|
||||||
_defuseTime
|
_defuseTime
|
||||||
};
|
};
|
||||||
_actionToPlay = "MedicOther";
|
private _actionToPlay = "MedicOther";
|
||||||
if (STANCE _unit == "Prone") then {
|
if (STANCE _unit == "Prone") then {
|
||||||
_actionToPlay = "PutDown";
|
_actionToPlay = "PutDown";
|
||||||
};
|
};
|
||||||
@ -49,7 +46,7 @@ if (ACE_player != _unit) then {
|
|||||||
[_unit, _actionToPlay] call EFUNC(common,doGesture);
|
[_unit, _actionToPlay] call EFUNC(common,doGesture);
|
||||||
_unit disableAI "MOVE";
|
_unit disableAI "MOVE";
|
||||||
_unit disableAI "TARGET";
|
_unit disableAI "TARGET";
|
||||||
_defuseTime = [[_unit] call EFUNC(Common,isEOD), _target] call _fnc_DefuseTime;
|
private _defuseTime = [[_unit] call EFUNC(Common,isEOD), _target] call _fnc_DefuseTime;
|
||||||
[{
|
[{
|
||||||
params ["_unit", "_target"];
|
params ["_unit", "_target"];
|
||||||
TRACE_2("defuse finished",_unit,_target);
|
TRACE_2("defuse finished",_unit,_target);
|
||||||
@ -60,8 +57,8 @@ if (ACE_player != _unit) then {
|
|||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
[_unit, _actionToPlay] call EFUNC(common,doGesture);
|
[_unit, _actionToPlay] call EFUNC(common,doGesture);
|
||||||
_isEOD = [_unit] call EFUNC(Common,isEOD);
|
private _isEOD = [_unit] call EFUNC(Common,isEOD);
|
||||||
_defuseTime = [_isEOD, _target] call _fnc_DefuseTime;
|
private _defuseTime = [_isEOD, _target] call _fnc_DefuseTime;
|
||||||
if (_isEOD || {!GVAR(RequireSpecialist)}) then {
|
if (_isEOD || {!GVAR(RequireSpecialist)}) then {
|
||||||
[_defuseTime, [_unit,_target], {(_this select 0) call FUNC(defuseExplosive)}, {}, (localize LSTRING(DefusingExplosive)), {true}, ["isNotSwimming"]] call EFUNC(common,progressBar);
|
[_defuseTime, [_unit,_target], {(_this select 0) call FUNC(defuseExplosive)}, {}, (localize LSTRING(DefusingExplosive)), {true}, ["isNotSwimming"]] call EFUNC(common,progressBar);
|
||||||
};
|
};
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user