diff --git a/addons/advanced_fatigue/functions/fnc_getAnimDuty.sqf b/addons/advanced_fatigue/functions/fnc_getAnimDuty.sqf index 3698ff9113..629152b6a1 100644 --- a/addons/advanced_fatigue/functions/fnc_getAnimDuty.sqf +++ b/addons/advanced_fatigue/functions/fnc_getAnimDuty.sqf @@ -21,6 +21,7 @@ private _duty = 1; private _animType = _animName select [1, 3]; GVAR(isSwimming) = false; +GVAR(isProne) = (stance _unit) == "PRONE"; if (_animType in ["idl", "mov", "adj"]) then { switch (_animName select [5, 3]) do { @@ -29,6 +30,7 @@ if (_animType in ["idl", "mov", "adj"]) then { }; case ("pne"): { _duty = 10; + GVAR(isProne) = true; // #4880 - Unarmed sprint->prone has wrong `stance` }; default { _duty = 1; diff --git a/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf b/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf index fd2234d1f2..c2c673fd95 100644 --- a/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf +++ b/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf @@ -18,18 +18,8 @@ #include "script_component.hpp" params ["_unit", "_velocity"]; -private _virtualLoad = 0; -{ - _virtualLoad = _virtualLoad + (_x getVariable [QEGVAR(movement,vLoad), 0]); -} forEach [ - _unit, - uniformContainer _unit, - vestContainer _unit, - backpackContainer _unit -]; +private _gearMass = ((_unit getVariable [QEGVAR(movement,totalLoad), loadAbs _unit]) / 22.046) * GVAR(loadFactor); -private _gearMass = ((loadAbs _unit + _virtualLoad) * 0.1 / 2.2046) * GVAR(loadFactor); -private _terrainFactor = 1; private _terrainAngle = asin (1 - ((surfaceNormal getPosASL _unit) select 2)); private _terrainGradient = (_terrainAngle / 45 min 1) * 5 * GVAR(terrainGradientFactor); private _duty = GVAR(animDuty); @@ -50,12 +40,12 @@ if (_velocity > 2) then { ( 2.10 * SIM_BODYMASS + 4 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2) - + _terrainFactor * (SIM_BODYMASS + _gearMass) * (0.90 * (_velocity ^ 2) + 0.66 * _velocity * _terrainGradient) + + (SIM_BODYMASS + _gearMass) * (0.90 * (_velocity ^ 2) + 0.66 * _velocity * _terrainGradient) ) * 0.23 * _duty } else { ( 1.05 * SIM_BODYMASS + 4 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2) - + _terrainFactor * (SIM_BODYMASS + _gearMass) * (1.15 * (_velocity ^ 2) + 0.66 * _velocity * _terrainGradient) + + (SIM_BODYMASS + _gearMass) * (1.15 * (_velocity ^ 2) + 0.66 * _velocity * _terrainGradient) ) * 0.23 * _duty }; diff --git a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf index ee8f33f5c7..d01eeefa78 100644 --- a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf +++ b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf @@ -20,7 +20,7 @@ private _currentWork = REE; private _currentSpeed = (vectorMagnitude (velocity ACE_player)) min 6; // fix #4481. Diving to the ground is recorded as PRONE stance with running speed velocity. Cap maximum speed to fix. -if (stance ACE_player == "PRONE") then { +if (GVAR(isProne)) then { _currentSpeed = _currentSpeed min 1.5; }; @@ -32,11 +32,11 @@ if ((vehicle ACE_player == ACE_player) && {_currentSpeed > 0.1} && {isTouchingGr // Calculate muscle damage increase // Note: Muscle damage recovery is ignored as it takes multiple days GVAR(muscleDamage) = GVAR(muscleDamage) + (_currentWork / GVAR(peakPower)) ^ 3.2 * 0.00004; -private _muscleIntegrity = 1 - GVAR(muscleDamage); +private _muscleIntegritySqrt = sqrt (1 - GVAR(muscleDamage)); // Calculate available power -private _ae1PathwayPowerFatigued = GVAR(ae1PathwayPower) * sqrt (GVAR(ae1Reserve) / AE1_MAXRESERVE) * OXYGEN * sqrt _muscleIntegrity; -private _ae2PathwayPowerFatigued = GVAR(ae2PathwayPower) * sqrt (GVAR(ae2Reserve) / AE2_MAXRESERVE) * OXYGEN * sqrt _muscleIntegrity; +private _ae1PathwayPowerFatigued = GVAR(ae1PathwayPower) * sqrt (GVAR(ae1Reserve) / AE1_MAXRESERVE) * OXYGEN * _muscleIntegritySqrt; +private _ae2PathwayPowerFatigued = GVAR(ae2PathwayPower) * sqrt (GVAR(ae2Reserve) / AE2_MAXRESERVE) * OXYGEN * _muscleIntegritySqrt; // Calculate how much power is consumed from each reserve private _ae1Power = _currentWork min _ae1PathwayPowerFatigued; diff --git a/addons/atragmx/functions/fnc_toggle_option_menu.sqf b/addons/atragmx/functions/fnc_toggle_option_menu.sqf index ea14baedad..99928e2cc8 100644 --- a/addons/atragmx/functions/fnc_toggle_option_menu.sqf +++ b/addons/atragmx/functions/fnc_toggle_option_menu.sqf @@ -48,4 +48,6 @@ if (ctrlVisible 3001) then { ctrlShow [3001, true]; ctrlShow [3002, true]; + + ctrlSetFocus ((uiNamespace getVariable ["ATragMX_Display", displayNull]) displayCtrl 3002); }; diff --git a/addons/common/CfgLocationTypes.hpp b/addons/common/CfgLocationTypes.hpp index 15b56c120c..163c1e5a88 100644 --- a/addons/common/CfgLocationTypes.hpp +++ b/addons/common/CfgLocationTypes.hpp @@ -4,7 +4,7 @@ class CfgLocationTypes { class ACE_HashLocation { color[] = {0,0,0,0}; - drawStyle = "bananas"; + drawStyle = "WARNING-ACE_HashLocation_is_deprecated"; // Replaced by CBA_fnc_createNamespace font = "RobotoCondensed"; importance = 5; name = "HashLocation"; diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp index 13e7f00bea..9cdee7bb54 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -13,6 +13,7 @@ PREP(ASLToPosition); PREP(binarizeNumber); PREP(blurScreen); PREP(cachedCall); +PREP(canDig); PREP(canGetInPosition); PREP(canInteractWith); PREP(changeProjectileDirection); diff --git a/addons/common/functions/fnc_canDig.sqf b/addons/common/functions/fnc_canDig.sqf new file mode 100644 index 0000000000..b3cdfd8405 --- /dev/null +++ b/addons/common/functions/fnc_canDig.sqf @@ -0,0 +1,31 @@ +/* + * Author: Ruthberg, commy2 + * Checks if the player can dig on the surface below (enough dust). + * + * Arguments: + * 0: Unit + * + * Return Value: + * Can Dig + * + * Example: + * [ACE_player] call ace_common_fnc_canDig + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit"]; + +private _posASL = getPosASL _unit; + +if ((getPosATL _unit) select 2 > 0.05 || // Walking on objects, such as buildings, pavements, etc. + {surfaceIsWater _posASL} // posATL in low water (not as low to allow awalking) is negative +) exitWith {false}; + +private _surfaceClass = (surfaceType _posASL) select [1]; +private _surfaceType = getText (configFile >> "CfgSurfaces" >> _surfaceClass >> "soundEnviron"); +private _surfaceDust = getNumber (configFile >> "CfgSurfaces" >> _surfaceClass >> "dust"); +TRACE_2("Surface",_surfaceType,_surfaceDust); + +!(_surfaceType in DIG_SURFACE_BLACKLIST) && {_surfaceDust >= 0.1} diff --git a/addons/common/script_component.hpp b/addons/common/script_component.hpp index af8e0a5229..66f7ac63bf 100644 --- a/addons/common/script_component.hpp +++ b/addons/common/script_component.hpp @@ -19,3 +19,16 @@ #define VERSION_CONFIG_COMMON VERSION_CONFIG;\ versionDesc = "ACE 3";\ versionAct = QUOTE(call COMPILE_FILE(init_versionTooltip)) + + +#define DIG_SURFACE_BLACKLIST [ \ + "concrete", "concrete_exp", "concrete_int", "int_concrete", "int_concrete_exp", \ + "pavement_exp", "int_pavement_exp", \ + "tiling", "tiles_int", "int_tiles", \ + "roof_tin", "roof_tiles", "rooftiles_exp", \ + "tarmac", "asphalt_exp", \ + "stones_exp", "rock", "stony", \ + "metal", "gridmetal_exp", "metalplate_exp", "int_metalplate_exp", "metal_int", "wavymetal", "wavymetal_exp", "int_metal", "steel_exp", \ + "lino_exp", "int_lino_exp", "int_mat_exp", \ + "wood", "wood_int", "int_wood", "softwood_exp", "int_softwood_exp", "int_solidwood_exp" \ +] diff --git a/addons/cookoff/functions/fnc_cookOff.sqf b/addons/cookoff/functions/fnc_cookOff.sqf index 7ae36670ac..b75eaf9eb3 100644 --- a/addons/cookoff/functions/fnc_cookOff.sqf +++ b/addons/cookoff/functions/fnc_cookOff.sqf @@ -132,6 +132,6 @@ if (local _vehicle) then { if (local _vehicle) then { _vehicle setDamage 1; }; - }, [_vehicle, _effects], 4 + random 20] call CBA_fnc_waitAndExecute; - }, [_vehicle, _effects, _positions], 3 + random 15] call CBA_fnc_waitAndExecute; -}, _vehicle, 0.5 + random 5] call CBA_fnc_waitAndExecute; + }, [_vehicle, _effects], 14] call CBA_fnc_waitAndExecute; + }, [_vehicle, _effects, _positions], 10.5] call CBA_fnc_waitAndExecute; +}, _vehicle, 3] call CBA_fnc_waitAndExecute; diff --git a/addons/cookoff/functions/fnc_cookOffBox.sqf b/addons/cookoff/functions/fnc_cookOffBox.sqf index f944d917e8..6f834a15b6 100644 --- a/addons/cookoff/functions/fnc_cookOffBox.sqf +++ b/addons/cookoff/functions/fnc_cookOffBox.sqf @@ -71,6 +71,6 @@ if (local _box) then { if (local _box) then { _box setDamage 1; }; - }, [_box, _effects], 45 + random 75] call CBA_fnc_waitAndExecute; // Give signifcant time for ammo cookoff to occur (perhaps keep the box alive until all cooked off?) - }, [_box, _effects], 3 + random 15] call CBA_fnc_waitAndExecute; -}, _box, 0.5 + random 5] call CBA_fnc_waitAndExecute; + }, [_box, _effects], 82.5] call CBA_fnc_waitAndExecute; // Give signifcant time for ammo cookoff to occur (perhaps keep the box alive until all cooked off?) + }, [_box, _effects], 10.5] call CBA_fnc_waitAndExecute; +}, _box, 3] call CBA_fnc_waitAndExecute; diff --git a/addons/gforces/functions/fnc_addPFEH.sqf b/addons/gforces/functions/fnc_addPFEH.sqf index 9bd4d7fa1a..bf320e0fe5 100644 --- a/addons/gforces/functions/fnc_addPFEH.sqf +++ b/addons/gforces/functions/fnc_addPFEH.sqf @@ -14,6 +14,10 @@ //Reset forces array GVAR(GForces) = []; +// init array to full array of neutral g-forces +GVAR(GForces) resize 30; +GVAR(GForces) = GVAR(GForces) apply {1}; + GVAR(GForces_Index) = 0; // Setup ppEffect @@ -26,4 +30,4 @@ GVAR(GForces_CC) ppEffectCommit 0.4; GVAR(lastUpdateTime) = 0; GVAR(oldVel) = [0,0,0]; -GVAR(pfID) = [DFUNC(pfhUpdateGForces), 0, []] call CBA_fnc_addPerFrameHandler; +GVAR(pfID) = [LINKFUNC(pfhUpdateGForces), 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf index 48370c2431..3be0130030 100644 --- a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf +++ b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf @@ -27,7 +27,7 @@ private _accel = ((_newVel vectorDiff GVAR(oldVel)) vectorMultiply (1 / INTERVAL private _currentGForce = (((_accel vectorDotProduct vectorUp (vehicle ACE_player)) / 9.8) max -10) min 10; GVAR(GForces) set [GVAR(GForces_Index), _currentGForce]; -GVAR(GForces_Index) = (GVAR(GForces_Index) + 1) % round (AVERAGEDURATION / INTERVAL); +GVAR(GForces_Index) = (GVAR(GForces_Index) + 1) % 30; // 30 = round (AVERAGEDURATION / INTERVAL); GVAR(oldVel) = _newVel; /* Source: https://github.com/KoffeinFlummi/AGM/issues/1774#issuecomment-70341573 diff --git a/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf b/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf index 949aa60da1..e02403b323 100644 --- a/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf +++ b/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf @@ -24,6 +24,7 @@ TRACE_3("params",_group,_leadColor,_unitColor); if (_group isEqualType grpNull) then {_group = groupID _group}; +if (_group == "") exitWith {ERROR("Group ID is blank, which is not valid.")}; if (!([_leadColor] call FUNC(isValidColorArray))) exitWith {ERROR("leadColor is not a valid color array.")}; if (!([_unitColor] call FUNC(isValidColorArray))) exitWith {ERROR("color is not a valid color array.")}; diff --git a/addons/map_gestures/functions/fnc_receiverInit.sqf b/addons/map_gestures/functions/fnc_receiverInit.sqf index b132dad1d7..9386523340 100644 --- a/addons/map_gestures/functions/fnc_receiverInit.sqf +++ b/addons/map_gestures/functions/fnc_receiverInit.sqf @@ -22,4 +22,4 @@ if (!isNil QGVAR(DrawMapHandlerID)) then { (findDisplay 12 displayCtrl 51) ctrlRemoveEventHandler ["Draw", GVAR(DrawMapHandlerID)]; GVAR(DrawMapHandlerID) = nil; }; -GVAR(DrawMapHandlerID) = findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", FUNC(drawMapGestures)]; +GVAR(DrawMapHandlerID) = findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", {call FUNC(drawMapGestures)}]; diff --git a/addons/medical/functions/fnc_addDamageToUnit.sqf b/addons/medical/functions/fnc_addDamageToUnit.sqf index e13928cc0d..d84429c347 100644 --- a/addons/medical/functions/fnc_addDamageToUnit.sqf +++ b/addons/medical/functions/fnc_addDamageToUnit.sqf @@ -8,13 +8,14 @@ * 1: Damage to Add * 2: Body part ("Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg") * 3: Projectile Type + * 3: Source * * Return Value: - * HandleDamage's return + * Successful * * Example: * [player, 0.8, "rightleg", "bullet"] call ace_medical_fnc_addDamageToUnit - * [cursorTarget, 1, "body", "stab"] call ace_medical_fnc_addDamageToUnit + * [cursorTarget, 1, "body", "stab", player] call ace_medical_fnc_addDamageToUnit * * Public: Yes */ @@ -22,42 +23,42 @@ // #define DEBUG_TESTRESULTS #include "script_component.hpp" -params [["_unit", objNull, [objNull]], ["_damageToAdd", -1, [0]], ["_bodyPart", "", [""]], ["_typeOfDamage", "", [""]]]; -TRACE_4("params",_unit,_damageToAdd,_bodyPart,_typeOfDamage); +params [["_unit", objNull, [objNull]], ["_damageToAdd", -1, [0]], ["_bodyPart", "", [""]], ["_typeOfDamage", "", [""]], ["_instigator", objNull, [objNull]]]; +TRACE_5("params",_unit,_damageToAdd,_bodyPart,_typeOfDamage,_instigator); -_bodyPart = toLower _bodyPart; -if (isNull _unit || {!local _unit} || {!alive _unit}) exitWith {ERROR_1("addDamageToUnit - badUnit %1", _this); -1}; -if (_damageToAdd < 0) exitWith {ERROR_1("addDamageToUnit - bad damage %1", _this); -1}; -if !(_bodyPart in ALL_BODY_PARTS) exitWith {ERROR_1("addDamageToUnit - bad selection %1", _this); -1}; +private _bodyPartIndex = ALL_BODY_PARTS find (toLower _bodyPart); +if (isNull _unit || {!local _unit} || {!alive _unit}) exitWith {ERROR_1("addDamageToUnit - badUnit %1", _this); false}; +if (_damageToAdd < 0) exitWith {ERROR_1("addDamageToUnit - bad damage %1", _this); false}; +if (_bodyPartIndex < 0) exitWith {ERROR_1("addDamageToUnit - bad selection %1", _this); false}; -//Get the hitpoint and the index -private _hitpoint = [_unit, _bodyPart, true] call ace_medical_fnc_translateSelections; -(getAllHitPointsDamage _unit) params [["_allHitPoints", []]]; -private _hitpointIndex = -1; -{ //case insensitive find - if (_x == _hitpoint) exitWith {_hitpointIndex = _forEachIndex;}; -} forEach _allHitPoints; -if (_hitpointIndex < 0) exitWith {ERROR_1("addDamageToUnit - bad hitpointIndex %1", _this); -1}; +// Extension is case sensitive and expects this format (different from ALL_BODY_PARTS) +_bodyPart = ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"] select _bodyPartIndex; -private _currentDamage = _unit getHitIndex _hitpointIndex; +if (!isNull _instigator) then { + _unit setVariable [QEGVAR(medical_engine,lastShooter), _instigator]; + _unit setVariable [QEGVAR(medical_engine,lastInstigator), _instigator]; +}; #ifdef DEBUG_TESTRESULTS -private _checkAtFrame = diag_frameno + 5; -private _partNumber = ALL_BODY_PARTS find _bodyPart; -private _startDmg = (_unit getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]) select _partNumber; -private _debugCode = { - params ["", "_unit", "_startDmg", "_damageToAdd", "_partNumber"]; - private _endDmg = (_unit getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]) select _partNumber; - if ((!alive _unit) || {_endDmg > _startDmg}) then { - INFO_6("addDamageToUnit - PASSED - [unit:%1, partNo:%2, addDmg:%3] results:[alive:%4 old:%5 new:%6]", _unit, _partNumber, _damageToAdd, alive _unit, _startDmg, _endDmg); - } else { - ERROR_6("addDamageToUnit - FAILED - [unit:%1, partNo:%2, addDmg:%3] results:[alive:%4 old:%5 new:%6]", _unit, _partNumber, _damageToAdd, alive _unit, _startDmg, _endDmg); - }; -}; -[{diag_frameno > (_this select 0)}, _debugCode, [_checkAtFrame, _unit, _startDmg, _damageToAdd, _partNumber]] call CBA_fnc_waitUntilAndExecute; +private _startDmg = +(_unit getVariable [QGVAR(bodyPartDamage), [-1]]); +private _startPain = _unit getVariable [QGVAR(pain), 0]; #endif -private _return = [_unit, _bodyPart, (_currentDamage + _damageToAdd), _unit, _typeOfDamage, _hitpointIndex, objNull] call FUNC(handleDamage); // todo - switch to medical engine -TRACE_1("handleDamage called",_return); +[QEGVAR(medical_engine,woundReceived), [_unit, _bodyPart, _damageToAdd, _instigator, _typeOfDamage]] call CBA_fnc_localEvent; -_return +#ifdef DEBUG_TESTRESULTS +private _endDmg = _unit getVariable [QGVAR(bodyPartDamage), [-1]]; +private _endPain = _unit getVariable [QGVAR(pain), 0]; +private _typeOfDamageAdj = _typeOfDamage call EFUNC(medical_damage,getTypeOfDamage); +private _config = configFile >> "ACE_Medical_Injuries" >> "damageTypes" >> _typeOfDamageAdj; +private _selectionSpecific = true; +if (isClass _config) then { + _selectionSpecific = (getNumber (_config >> "selectionSpecific")) == 1; +} else { + WARNING_2("Damage type not in config [%1:%2]", _typeOfDamage, _config); +}; +INFO_4("Debug AddDamageToUnit: Type [%1] - Selection Specific [%2] - HitPoint [%3 -> %4]",_typeOfDamage,_selectionSpecific,_startDmg select _bodyPartIndex,_endDmg select _bodyPartIndex); +INFO_4("Pain Change [%1 -> %2] - BodyPartDamage Change [%3 -> %4]",_startPain,_endPain,_startDmg,_endDmg); +#endif + +true diff --git a/addons/medical_damage/XEH_preInit.sqf b/addons/medical_damage/XEH_preInit.sqf index f3e7680270..21c5d4b15f 100644 --- a/addons/medical_damage/XEH_preInit.sqf +++ b/addons/medical_damage/XEH_preInit.sqf @@ -6,6 +6,12 @@ ADDON = false; call FUNC(parseConfigForInjuries); +addMissionEventHandler ["Loaded",{ + INFO("Mission Loaded - Reloading medical configs for extension"); + // Reload configs into extension (handle full game restart) + call FUNC(parseConfigForInjuries); +}]; + // decide which woundsHandler to use by whether the extension is present or not if ("ace_medical" callExtension "version" != "") then { DFUNC(woundsHandlerActive) = FUNC(woundsHandler); diff --git a/addons/medical_damage/functions/fnc_woundsHandler.sqf b/addons/medical_damage/functions/fnc_woundsHandler.sqf index 340aa54499..abd0744e9f 100644 --- a/addons/medical_damage/functions/fnc_woundsHandler.sqf +++ b/addons/medical_damage/functions/fnc_woundsHandler.sqf @@ -18,8 +18,8 @@ #define MATH_E 2.71828182846 -params ["_unit", "_bodyPart", "_damage", "_typeOfProjectile", "_typeOfDamage"]; -TRACE_5("start",_unit,_bodyPart,_damage,_typeOfProjectile,_typeOfDamage); +params ["_unit", "_bodyPart", "_damage", "_shooter", "_typeOfDamage"]; +TRACE_5("start",_unit,_bodyPart,_damage,_shooter,_typeOfDamage); if (_typeOfDamage isEqualTo "") then { _typeOfDamage = "unknown"; @@ -29,6 +29,7 @@ if (_typeOfDamage isEqualTo "") then { private _openWounds = _unit getVariable [QEGVAR(medical,openWounds), []]; private _woundID = _unit getVariable [QEGVAR(medical,lastUniqueWoundID), 1]; +TRACE_4("extension call",_bodyPart,_damage,_typeOfDamage,_woundID); private _extensionOutput = "ace_medical" callExtension format ["HandleDamageWounds,%1,%2,%3,%4", _bodyPart, _damage, _typeOfDamage, _woundID]; TRACE_1("",_extensionOutput); diff --git a/addons/medical_damage/stringtable.xml b/addons/medical_damage/stringtable.xml index d721bc2e89..e74d80fc48 100644 --- a/addons/medical_damage/stringtable.xml +++ b/addons/medical_damage/stringtable.xml @@ -61,7 +61,7 @@ Avulsion Avulsion Avulsione - Рваная рана + Авульсия Avulsion Rana płatowa Avulsión @@ -75,7 +75,7 @@ Minor Avulsion Kleine Avulsion Minima Avulsione - Малая рваная рана + Малая Авульсия Petite avulsion Pomniejsza rana płatowa Avulsión menor @@ -89,7 +89,7 @@ Medium Avulsion Mittlere Avulsion Media Avulsione - Средняя рваная рана + Средняя Авульсия Moyenne avulsion Średnia rana płatowa Avulsión media @@ -103,7 +103,7 @@ Large Avulsion Große Avulsion Alta Avulsione - Большая рваная рана + Большая Авульсия Grande avulsion Duża rana płatowa Avulsión severa diff --git a/addons/medical_engine/XEH_postInit.sqf b/addons/medical_engine/XEH_postInit.sqf index 0e1abd1ea9..f420474e68 100644 --- a/addons/medical_engine/XEH_postInit.sqf +++ b/addons/medical_engine/XEH_postInit.sqf @@ -19,7 +19,8 @@ #ifdef DEBUG_MODE_FULL [QGVAR(woundReceived), { - //diag_log _this; + params ["_unit", "_woundedHitPoint", "_receivedDamage", "_shooter", "_ammo"]; + TRACE_5("wound",_unit,_woundedHitPoint, _receivedDamage, _shooter, _ammo); //systemChat str _this; }] call CBA_fnc_addEventHandler; #endif diff --git a/addons/movement/functions/fnc_handleVirtualMass.sqf b/addons/movement/functions/fnc_handleVirtualMass.sqf index 8e33197089..8dc1412c4a 100644 --- a/addons/movement/functions/fnc_handleVirtualMass.sqf +++ b/addons/movement/functions/fnc_handleVirtualMass.sqf @@ -28,6 +28,8 @@ private _virtualLoad = 0; backpackContainer _unit ]; +_unit setVariable [QGVAR(totalLoad), (loadAbs _unit + _virtualLoad)]; + // get absolute vanilla load private _absLoad = getNumber (configFile >> "CfgInventoryGlobalVariable" >> "maxSoldierLoad"); diff --git a/addons/rangecard/functions/fnc_updateRangeCard.sqf b/addons/rangecard/functions/fnc_updateRangeCard.sqf index e62a5ee418..42863e2911 100644 --- a/addons/rangecard/functions/fnc_updateRangeCard.sqf +++ b/addons/rangecard/functions/fnc_updateRangeCard.sqf @@ -174,7 +174,7 @@ if (isNil {_cacheEntry}) then { [_scopeBaseAngle,_boreHeight,_airFriction,_mv,_x,EGVAR(scopes,zeroReferenceBarometricPressure),EGVAR(scopes,zeroReferenceHumidity),100,4,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,_transonicStabilityCoef,_forEachIndex,_useABConfig] call FUNC(calculateRangeCard); } forEach [-15, -5, 5, 10, 15, 20, 25, 30, 35]; } else { - [_scopeBaseAngle,_boreHeight,_airFriction,_muzzleVelocity,15,EGVAR(scopes,zeroReferenceBarometricPressure),EGVAR(scopes,zeroReferenceHumidity),100,4,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,_transonicStabilityCoef,4,_useABConfig] call FUNC(calculateRangeCard); + [_scopeBaseAngle,_boreHeight,_airFriction,_muzzleVelocity,15,EGVAR(scopes,zeroReferenceBarometricPressure),EGVAR(scopes,zeroReferenceHumidity),100,4,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,_transonicStabilityCoef,3,_useABConfig] call FUNC(calculateRangeCard); }; for "_i" from 0 to 9 do { diff --git a/addons/rearm/CfgVehicles.hpp b/addons/rearm/CfgVehicles.hpp index c60256dee4..ef006b61be 100644 --- a/addons/rearm/CfgVehicles.hpp +++ b/addons/rearm/CfgVehicles.hpp @@ -109,6 +109,7 @@ class CfgVehicles { // Ammo Vehicles (with full inheritance for granted ACE_Actions) class Car_F: Car {}; class Truck_F: Car_F {}; + class Tank_F: Tank {}; class Truck_03_base_F: Truck_F {}; class O_Truck_03_ammo_F: Truck_03_base_F { @@ -135,6 +136,13 @@ class CfgVehicles { MACRO_REARM_TRUCK_ACTIONS }; + class APC_Tracked_01_base_F: Tank_F {}; + class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F {}; + class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { + transportAmmo = 0; + MACRO_REARM_TRUCK_ACTIONS + }; + class Helicopter_Base_F: Helicopter {}; class Helicopter_Base_H: Helicopter_Base_F {}; class Heli_Transport_04_base_F: Helicopter_Base_H {}; diff --git a/addons/rearm/XEH_postInit.sqf b/addons/rearm/XEH_postInit.sqf index cfbbdf9d4d..296728807f 100644 --- a/addons/rearm/XEH_postInit.sqf +++ b/addons/rearm/XEH_postInit.sqf @@ -13,3 +13,11 @@ if (isServer) then { [QGVAR(makeDummyEH), FUNC(makeDummy)] call CBA_fnc_addEventHandler; [QGVAR(rearmEntireVehicleSuccessLocalEH), FUNC(rearmEntireVehicleSuccessLocal)] call CBA_fnc_addEventHandler; [QGVAR(rearmSuccessLocalEH), FUNC(rearmSuccessLocal)] call CBA_fnc_addEventHandler; + + +#ifdef DEBUG_MODE_FULL +INFO("Showing CfgVehicles with vanilla transportAmmo"); +{ + WARNING_2("Type [%1] needs config [transportAmmo: %2]", configName _x, getNumber (_x >> 'transportAmmo')); +} forEach (configProperties [configFile >> "CfgVehicles", "(isClass _x) && {(getNumber (_x >> 'transportAmmo')) > 0}", true]); +#endif diff --git a/addons/sandbag/functions/fnc_canDeploy.sqf b/addons/sandbag/functions/fnc_canDeploy.sqf index b9bd025dff..426dde56f2 100644 --- a/addons/sandbag/functions/fnc_canDeploy.sqf +++ b/addons/sandbag/functions/fnc_canDeploy.sqf @@ -1,9 +1,9 @@ /* * Author: Ruthberg, commy2 - * Checks if the player can deploy a sandbag + * Checks if the player can deploy a sandbag. * * Arguments: - * None + * 0: Unit * * Return Value: * Can deploy @@ -15,15 +15,8 @@ */ #include "script_component.hpp" -#define SURFACE_BLACKLIST ["water", "concrete", "tarmac", "wood", "metal", "roof_tin", "roof_tiles", "wood_int", "concrete_int", "tiles_int", "metal_int", "stony", "rock", "int_concrete", "int_tiles", "int_wood", "tiling", "wavymetal", "int_metal"] - params ["_unit"]; if !("ACE_Sandbag_empty" in items _unit) exitWith {false}; -private ["_surfaceClass", "_surfaceType"]; - -_surfaceClass = (surfaceType getPosASL _unit) select [1]; -_surfaceType = getText (configFile >> "CfgSurfaces" >> _surfaceClass >> "soundEnviron"); - -!(_surfaceType in SURFACE_BLACKLIST) +_unit call EFUNC(common,canDig) diff --git a/addons/sandbag/functions/fnc_deployConfirm.sqf b/addons/sandbag/functions/fnc_deployConfirm.sqf index 47b74533a1..68328cca67 100644 --- a/addons/sandbag/functions/fnc_deployConfirm.sqf +++ b/addons/sandbag/functions/fnc_deployConfirm.sqf @@ -29,14 +29,12 @@ _unit removeItem "ACE_Sandbag_empty"; params ["_unit"]; - private ["_position", "_direction", "_sandBag"]; - - _position = getPosASL GVAR(sandBag); - _direction = getDir GVAR(sandBag); + private _position = getPosASL GVAR(sandBag); + private _direction = getDir GVAR(sandBag); deleteVehicle GVAR(sandBag); - _sandBag = createVehicle ["ACE_SandbagObject", [0, 0, 0], [], 0, "NONE"]; + private _sandBag = createVehicle ["ACE_SandbagObject", [0, 0, 0], [], 0, "NONE"]; _sandBag setPosASL _position; _sandBag setDir _direction; diff --git a/addons/scopes/functions/fnc_inventoryCheck.sqf b/addons/scopes/functions/fnc_inventoryCheck.sqf index 2af9c56ec0..817d301221 100644 --- a/addons/scopes/functions/fnc_inventoryCheck.sqf +++ b/addons/scopes/functions/fnc_inventoryCheck.sqf @@ -74,6 +74,7 @@ private _newGuns = [primaryWeapon _player, secondaryWeapon _player, handgunWeapo if ((_newOptics select _x) == "") then { // Check if the weapon comes with an integrated optic + private _weaponConfig = configFile >> "CfgWeapons" >> (_newGuns select _x); private _verticalIncrement = 0; if (isNumber (_weaponConfig >> "ACE_ScopeAdjust_VerticalIncrement")) then { _verticalIncrement = getNumber (_weaponConfig >> "ACE_ScopeAdjust_VerticalIncrement"); @@ -90,6 +91,7 @@ private _newGuns = [primaryWeapon _player, secondaryWeapon _player, handgunWeapo if (isArray (_weaponConfig >> "ACE_ScopeAdjust_Horizontal")) then { _maxHorizontal = getArray (_weaponConfig >> "ACE_ScopeAdjust_Horizontal"); }; + TRACE_5("",_newGuns select _x,_verticalIncrement,_horizontalIncrement,_maxVertical,_maxHorizontal); (GVAR(scopeAdjust) select _x) set [0, _maxVertical]; (GVAR(scopeAdjust) select _x) set [1, _verticalIncrement]; (GVAR(scopeAdjust) select _x) set [2, _maxHorizontal]; diff --git a/addons/tagging/XEH_postInit.sqf b/addons/tagging/XEH_postInit.sqf index ddac9b9ab9..6693bda2f6 100644 --- a/addons/tagging/XEH_postInit.sqf +++ b/addons/tagging/XEH_postInit.sqf @@ -3,8 +3,7 @@ // Cache for static objects -GVAR(cacheStaticModels) = createLocation ["ACE_HashLocation", [-10000,-10000,-10000], 0, 0]; -GVAR(cacheStaticModels) setText QGVAR(cacheStaticModels); +GVAR(cacheStaticModels) = [false] call CBA_fnc_createNamespace; // Consider static everything vehicle that inherit from Static // This include houses (which we don't need), but also walls, that we do diff --git a/addons/trenches/functions/fnc_canDigTrench.sqf b/addons/trenches/functions/fnc_canDigTrench.sqf index 0cbed2d9b7..a99c5c6b60 100644 --- a/addons/trenches/functions/fnc_canDigTrench.sqf +++ b/addons/trenches/functions/fnc_canDigTrench.sqf @@ -1,6 +1,6 @@ /* * Author: Ruthberg, commy2, esteldunedain - * Checks if a unit can dig a trench + * Checks if a unit can dig a trench. * * Arguments: * 0: Unit @@ -15,17 +15,8 @@ */ #include "script_component.hpp" -#define SURFACE_BLACKLIST ["water", "concrete", "tarmac", "wood", "metal", "roof_tin", "roof_tiles", "wood_int", "concrete_int", "tiles_int", "metal_int", "stony", "rock", "int_concrete", "int_tiles", "int_wood", "tiling", "wavymetal", "int_metal"] - params ["_unit"]; if !("ACE_EntrenchingTool" in items _unit) exitWith {false}; -// Can't dig trench if above ground level -if ((getPosATL _unit) select 2 > 0.05) exitWith {false}; - -private _surfaceClass = (surfaceType getPosASL _unit) select [1]; -private _surfaceType = getText (configFile >> "CfgSurfaces" >> _surfaceClass >> "soundEnviron"); -TRACE_1("",_surfaceType); - -!(_surfaceType in SURFACE_BLACKLIST) +_unit call EFUNC(common,canDig) diff --git a/addons/vehiclelock/functions/fnc_lockpick.sqf b/addons/vehiclelock/functions/fnc_lockpick.sqf index 3ac7385a04..2ce856dd37 100644 --- a/addons/vehiclelock/functions/fnc_lockpick.sqf +++ b/addons/vehiclelock/functions/fnc_lockpick.sqf @@ -51,9 +51,11 @@ if (!([[_unit, _veh]] call _condition)) exitWith {false}; _returnValue = _funcType in ["canLockpick", "startLockpick", "finishLockpick"]; switch (_funcType) do { - case "canLockpick": {}; + case "canLockpick": { + _returnValue = !([_unit, _veh] call FUNC(hasKeyForVehicle)) && {(locked _veh) in [2, 3]}; + }; case "startLockpick": { - [_vehLockpickStrenth, [_unit, _veh, "finishLockpick"], {(_this select 0) call FUNC(lockpick)}, {}, (localize LSTRING(Action_LockpickInUse)), _condition] call EFUNC(common,progressBar); + [_vehLockpickStrenth, [_unit, _veh, "finishLockpick"], {(_this select 0) call FUNC(lockpick)}, {}, (localize LSTRING(Action_LockpickInUse)), _condition, ["isNotInside"]] call EFUNC(common,progressBar); }; case "finishLockpick": { [QGVAR(setVehicleLock), [_veh, false], [_veh]] call CBA_fnc_targetEvent; diff --git a/docs/img/wiki/feature/atragmx1.jpg b/docs/img/wiki/feature/atragmx1.jpg new file mode 100644 index 0000000000..d80768a686 Binary files /dev/null and b/docs/img/wiki/feature/atragmx1.jpg differ diff --git a/docs/img/wiki/feature/atragmx2.png b/docs/img/wiki/feature/atragmx2.png new file mode 100644 index 0000000000..6cdaabd3f8 Binary files /dev/null and b/docs/img/wiki/feature/atragmx2.png differ diff --git a/docs/img/wiki/feature/atragmx3.png b/docs/img/wiki/feature/atragmx3.png new file mode 100644 index 0000000000..dd4a1800e1 Binary files /dev/null and b/docs/img/wiki/feature/atragmx3.png differ diff --git a/docs/wiki/feature/atragmx.md b/docs/wiki/feature/atragmx.md index d6ca29e7b5..fde3bf8880 100644 --- a/docs/wiki/feature/atragmx.md +++ b/docs/wiki/feature/atragmx.md @@ -12,21 +12,65 @@ version: patch: 0 --- -## Overview +## 1. Overview -### Sub-feature 1 -Short description of sub-feature 1. +### 1.1 AtragMx from Horus Vision -### Sub-feature 2 -Short description of sub-feature 2. +Horus ATragMX software considers atmospheric conditions, gun data, ammunition, range, speed and muzzle velocity to calculate precise aiming solutions with "come-up" results – and even accounts for Coriolis and spin drift effects. ATragMX, loaded on a handheld computer made by TDS Recon, is easy to use and lightning-fast. The Recon meets the rigorous MIL-STD-810F military standard for drops, vibration, humidity, altitude and extreme temperatures. +## 2. Usage -## Usage +### 2.1 Example with M14 and default 7.62mm 20Rnd Mag -Short overview of how to use the feature, e.g. menu options, key bindings, -instructions. May not apply to all modules. +**Start of the mission:** + - Open the Range Card and check the cartridge, the zeroed distance, the rifle twist, +the Muzzle Velocity at 15°C and the Bore Height at the end. + RangeCard -## Dependencies + - Open the AtragMx and the `Atmsphr` column, select `Default` and `Done`. + - `Open Gun` the 7.62x51mm M80 in the `GunList`. + - Select `E` (English unit) at the top right. + - Open the `Gun` column, check and update the `Bore`, the `Rifle Twist` and `Done`. + - Select `M` (Metric unit) at the top right. + - Open the `Gun` column, check and update the `Muzzle Velocity`, the `Zero Range` and `Done`. + - *The Muzzle Velocity Table will be automatically updated.* + - Optionally, `Save Gun` and `Done` in the `GunList`. + +**In position:** + - Update the `Atmsphr` column with the Kestrel and `Done` (Check the new Muzzle Velocity in the `Gun` column). + - Update the `Target` column. + - Apply the vertical and horizontal elevations on the scope. + - Control the breath and press. + +### 2.2 Example with Truing tool + +**Start of the mission:** + - Select `Drag Coef Table` in the `Options` menu. + - Add the `ZR` and the `C1` (`Gun` column) in the table and `Done`. + +**In position:** + - Open the `Truing Drop` in the `Options` menu. + - Add the actual `Target Range` in the `SUPER` column and `Calc`. + - Add the same `Target Range` in the `SUB` column and `Calc`. + - Apply the actual scope elevation in the `Drop` field and `Calc`. + - `Accept` the new `C1`, `Gun` column and `Elev` are updated. + - *The Drag Coefficient Table will be automatically updated.* + - Optionally, `Save Gun` and `Done` in the `GunList`. + + Calculation + + - If a new `Target Range` is applied in the `Target` column, select `Drag Coef Table` in the `Options` menu and `Done`. + - The ballistic coefficient `C1` and the elevation `Elev` will be recalculated. + +Interpolation + + ### 3. Official Manual and Horus Videos + + - [Official Manual](https://github.com/acemod/ACE3/blob/master/extras/manual_Horus_ATrag-v385.pdf) + - [Horus video part1](https://www.youtube.com/watch?v=pg6oqT5jVds) + - [Horus video part2](https://www.youtube.com/watch?v=7SkRnbwoPmw) + +### 4. Dependencies {% include dependencies_list.md component="atragmx" %} diff --git a/tools/publish.py b/tools/publish.py index 894a79720c..02ed225d82 100644 --- a/tools/publish.py +++ b/tools/publish.py @@ -107,7 +107,7 @@ def main(argv): #ACE Main - http://steamcommunity.com/sharedfiles/filedetails/?id=463939057 - # publishFolder(ace_release_dir, "463939057", changelog_path) + # Note: command line publisher doesn't like our file structure, just upload this one manually @@ -115,10 +115,14 @@ def main(argv): folder = buildCompatFolder("@ace_compat_rhs_usf3", ["ace_compat_rhs_usf3.*"]) publishFolder(folder, "773125288", changelog_path) - #RHS Compat Commies - http://steamcommunity.com/sharedfiles/filedetails/?id=773131200 + #RHS Compat Russians - http://steamcommunity.com/sharedfiles/filedetails/?id=773131200 folder = buildCompatFolder("@ace_compat_rhs_afrf3", ["ace_compat_rhs_afrf3.*"]) publishFolder(folder, "773131200", changelog_path) + #RHS Compat GREF - http://steamcommunity.com/sharedfiles/filedetails/?id=884966711 + folder = buildCompatFolder("@ace_compat_rhs_gref3", ["ace_compat_rhs_gref3.*"]) + publishFolder(folder, "884966711", changelog_path) + #ADR97 (p90)- http://steamcommunity.com/sharedfiles/filedetails/?id=773136286 folder = buildCompatFolder("@ace_adr97_compat", ["ace_compat_adr_97.*"]) publishFolder(folder, "773136286", changelog_path)