Merge branch 'medical-rewrite' into medical-rewrite-effects

This commit is contained in:
PabstMirror 2017-03-18 09:56:42 -05:00
commit e3af1b55a5
34 changed files with 213 additions and 109 deletions

View File

@ -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;

View File

@ -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
};

View File

@ -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;

View File

@ -48,4 +48,6 @@ if (ctrlVisible 3001) then {
ctrlShow [3001, true];
ctrlShow [3002, true];
ctrlSetFocus ((uiNamespace getVariable ["ATragMX_Display", displayNull]) displayCtrl 3002);
};

View File

@ -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";

View File

@ -13,6 +13,7 @@ PREP(ASLToPosition);
PREP(binarizeNumber);
PREP(blurScreen);
PREP(cachedCall);
PREP(canDig);
PREP(canGetInPosition);
PREP(canInteractWith);
PREP(changeProjectileDirection);

View File

@ -0,0 +1,31 @@
/*
* Author: Ruthberg, commy2
* Checks if the player can dig on the surface below (enough dust).
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Can Dig <BOOL>
*
* 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}

View File

@ -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" \
]

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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.")};

View File

@ -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)}];

View File

@ -8,13 +8,14 @@
* 1: Damage to Add <NUMBER>
* 2: Body part ("Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg") <STRING>
* 3: Projectile Type <STRING>
* 3: Source <OBJECT>
*
* Return Value:
* HandleDamage's return <NUMBER>
* Successful <BOOL>
*
* 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

View File

@ -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);

View File

@ -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);

View File

@ -61,7 +61,7 @@
<English>Avulsion</English>
<German>Avulsion</German>
<Italian>Avulsione</Italian>
<Russian>Рваная рана</Russian>
<Russian>Авульсия</Russian>
<French>Avulsion</French>
<Polish>Rana płatowa</Polish>
<Spanish>Avulsión</Spanish>
@ -75,7 +75,7 @@
<English>Minor Avulsion</English>
<German>Kleine Avulsion</German>
<Italian>Minima Avulsione</Italian>
<Russian>Малая рваная рана</Russian>
<Russian>Малая Авульсия</Russian>
<French>Petite avulsion</French>
<Polish>Pomniejsza rana płatowa</Polish>
<Spanish>Avulsión menor</Spanish>
@ -89,7 +89,7 @@
<English>Medium Avulsion</English>
<German>Mittlere Avulsion</German>
<Italian>Media Avulsione</Italian>
<Russian>Средняя рваная рана</Russian>
<Russian>Средняя Авульсия</Russian>
<French>Moyenne avulsion</French>
<Polish>Średnia rana płatowa</Polish>
<Spanish>Avulsión media</Spanish>
@ -103,7 +103,7 @@
<English>Large Avulsion</English>
<German>Große Avulsion</German>
<Italian>Alta Avulsione</Italian>
<Russian>Большая рваная рана</Russian>
<Russian>Большая Авульсия</Russian>
<French>Grande avulsion</French>
<Polish>Duża rana płatowa</Polish>
<Spanish>Avulsión severa</Spanish>

View File

@ -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

View File

@ -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");

View File

@ -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 {

View File

@ -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 {};

View File

@ -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

View File

@ -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 <OBJECT>
*
* Return Value:
* Can deploy <BOOL>
@ -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)

View File

@ -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;

View File

@ -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];

View File

@ -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

View File

@ -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 <OBJECT>
@ -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)

View File

@ -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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 883 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 853 KiB

View File

@ -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.
<img src="{{ site.baseurl }}/img/wiki/feature/atragmx1.jpg" width="431" height="600" alt="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`.
<img src="{{ site.baseurl }}/img/wiki/feature/atragmx2.png" width="1127" height="600" alt="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.
<img src="{{ site.baseurl }}/img/wiki/feature/atragmx3.png" width="1123" height="600" alt="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" %}

View File

@ -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)