diff --git a/TO_MERGE/agm/Movement/UI/IconFatigue_ca.paa b/TO_MERGE/agm/Movement/UI/IconFatigue_ca.paa deleted file mode 100644 index c1cf3fb92f..0000000000 Binary files a/TO_MERGE/agm/Movement/UI/IconFatigue_ca.paa and /dev/null differ diff --git a/TO_MERGE/agm/Movement/clientInit.sqf b/TO_MERGE/agm/Movement/clientInit.sqf deleted file mode 100644 index e7d39b60f9..0000000000 --- a/TO_MERGE/agm/Movement/clientInit.sqf +++ /dev/null @@ -1,4 +0,0 @@ -// by commy2 - -//0 spawn compile preprocessFileLineNumbers "\AGM_Movement\fatigue.sqf"; -0 spawn compile preprocessFileLineNumbers "\AGM_Movement\showWeight.sqf"; diff --git a/TO_MERGE/agm/Movement/config.cpp b/TO_MERGE/agm/Movement/config.cpp deleted file mode 100644 index 689d482a2e..0000000000 --- a/TO_MERGE/agm/Movement/config.cpp +++ /dev/null @@ -1,223 +0,0 @@ -// PATCH CONFIG -class CfgPatches { - class AGM_Movement { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.10; - requiredAddons[] = {AGM_Core}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"commy2", "KoffeinFlummi", "Tachii"}; - authorUrl = "https://github.com/commy2/"; - }; -}; - -class CfgFunctions { - class AGM_Movement { - class AGM_Movement { - file = "AGM_Movement\functions"; - class blinking; - class canClimb; - class climb; - class fatigueModule; - class heartbeat; - class getWeight; - class handleClimb; - class recoil; - class stumble; - class vision; - }; - }; -}; - -class Extended_PostInit_EventHandlers { - class AGM_Movement { - clientInit = "call compile preprocessFileLineNumbers '\AGM_Movement\clientInit.sqf'"; - }; -}; - -class AGM_Core_Default_Keys { - class climb { - displayName = "$STR_AGM_Movement_Climb"; - condition = "_player == _vehicle"; - statement = "[_player] call AGM_Movement_fnc_climb"; - key = 47; - shift = 0; - control = 1; - alt = 0; - }; -}; - -/*class CfgInventoryGlobalVariable { - maxSoldierLoad = 1200; -};*/ - -class CfgFatigue { - MinValue1 = 0.2; - MinValue2 = 0.8; - NormalRunSpeed = 7.2; - TiredRunSpeedLimit = 0.8; - FrequencyMin = 0.2; - FrequencyMax = 1.0; - TotalLoadCoef = 1.1; - MaxDuty = 10; -}; - -class CfgSounds { - class AGM_Heartbeat { - name = "AGM_Heartbeat"; - sound[] = {"AGM_Movement\sounds\heartbeat.ogg",1,1}; - titles[] = {}; - }; -}; - -class AGM_Core_Options { - class useImperial { - displayName = "$STR_AGM_Movement_UseImperial"; - default = 0; - }; -}; - -// leaving this for compatibility -class CfgVehicles { - class Module_F; - class AGM_ModuleFatigue: Module_F { - author = "AGM Team"; - category = "AGM"; - displayName = "Fatigue System"; - function = "AGM_Movement_fnc_fatigueModule"; - scope = 2; - isGlobal = 1; - icon = "\AGM_Movement\UI\IconFatigue_ca.paa"; - class Arguments { - class CoefFatigue { - displayName = "Getting Tired Coef."; - description = "Multiplier for the rate of getting tired. Default: 1"; - defaultValue = 1; - }; - class CoefRecover { - displayName = "Recover Coef."; - description = "Multiplier for the time to rest after getting tired. Default: 1"; - defaultValue = 1; - }; - }; - }; -}; - -class CfgMovesBasic { - class ManActions { - AGM_Climb = "AGM_Climb"; - }; - - class Actions { - class RifleStandActionsNoAdjust; - class RifleLowStandActionsNoAdjust; - - // WEAPON RAISED - RUNNING - class RifleStandActionsRunF: RifleStandActionsNoAdjust { - getOver = "AovrPercMrunSrasWrflDf"; - }; - class RifleStandActionsRunFL: RifleStandActionsNoAdjust { - getOver = "AovrPercMrunSrasWrflDf"; - }; - class RifleStandActionsRunFR: RifleStandActionsNoAdjust { - getOver = "AovrPercMrunSrasWrflDf"; - }; - // WEAPON RAISED - SPRINTING - class RifleStandEvasiveActionsF: RifleStandActionsNoAdjust { - getOver = "AovrPercMrunSrasWrflDf"; - }; - class RifleStandEvasiveActionsFL: RifleStandActionsNoAdjust { - getOver = "AovrPercMrunSrasWrflDf"; - }; - class RifleStandEvasiveActionsFR: RifleStandActionsNoAdjust { - getOver = "AovrPercMrunSrasWrflDf"; - }; - // WEAPON LOWERED - RUNNING - class RifleLowStandActionsRunF: RifleLowStandActionsNoAdjust { - getOver = "AovrPercMrunSrasWrflDf"; - }; - class RifleLowStandActionsRunFL: RifleLowStandActionsNoAdjust { - getOver = "AovrPercMrunSrasWrflDf"; - }; - class RifleLowStandActionsRunFR: RifleLowStandActionsNoAdjust { - getOver = "AovrPercMrunSrasWrflDf"; - }; - }; -}; - -class CfgMovesMaleSdr: CfgMovesBasic { - class StandBase; - class States { - // better slow walk with lowered rifle animation - class AmovPercMstpSrasWrflDnon; - class AmovPercMrunSrasWrflDf: AmovPercMstpSrasWrflDnon { - InterpolateTo[] = {"AovrPercMrunSrasWrflDf",0.22,"AmovPercMrunSlowWrflDf",0.025,"AmovPercMwlkSrasWrflDf",0.025,"AmovPknlMrunSrasWrflDf",0.03,"AmovPercMrunSlowWrflDf_AmovPpneMstpSrasWrflDnon",0.02,"AmovPercMevaSrasWrflDf",0.025,"Unconscious",0.01,"AmovPercMtacSrasWrflDf",0.02,"AmovPercMrunSrasWrflDfl",0.02,"AmovPercMrunSrasWrflDfl_ldst",0.02,"AmovPercMrunSrasWrflDfr",0.02,"AmovPercMrunSrasWrflDfr_ldst",0.02,"AmovPercMstpSrasWrflDnon",0.02,"AmovPercMrunSrasWrflDl",0.02,"AmovPercMrunSrasWrflDbl",0.02,"AmovPercMrunSrasWrflDb",0.02,"AmovPercMrunSrasWrflDbr",0.02,"AmovPercMrunSrasWrflDr",0.02,"AmovPknlMstpSlowWrflDnon_relax",0.1,"AmovPercMrunSrasWrflDf_ldst",0.02,"AmovPercMrunSrasWrflDf",0.02}; - }; - - class AmovPercMstpSlowWrflDnon; - class AmovPercMwlkSlowWrflDf: AmovPercMstpSlowWrflDnon { - speed = 0.3; //0.206897; - file = "\A3\anims_f\Data\Anim\Sdr\Mov\Erc\Wlk\Low\Rfl\AmovPercMwlkSlowWrflDf_ver2"; - leftHandIKCurve[] = {1}; - }; - class AmovPercMwlkSlowWrflDfl: AmovPercMwlkSlowWrflDf { - leftHandIKCurve[] = {}; - }; - class AmovPercMwlkSlowWrflDfr: AmovPercMwlkSlowWrflDf { - leftHandIKCurve[] = {}; - }; - class AmovPercMwlkSlowWrflDb: AmovPercMwlkSlowWrflDf { - leftHandIKCurve[] = {}; - }; - class AmovPercMwlkSlowWrflDbl: AmovPercMwlkSlowWrflDf { - leftHandIKCurve[] = {}; - }; - class AmovPercMwlkSlowWrflDbr: AmovPercMwlkSlowWrflDf { - leftHandIKCurve[] = {}; - }; - class AmovPercMwlkSlowWrflDl: AmovPercMwlkSlowWrflDf { - leftHandIKCurve[] = {}; - }; - class AmovPercMwlkSlowWrflDr: AmovPercMwlkSlowWrflDf { - leftHandIKCurve[] = {}; - }; - - // enable optics in prone left and right stance - class AidlPpneMstpSrasWrflDnon_G0S; - class AadjPpneMstpSrasWrflDleft: AidlPpneMstpSrasWrflDnon_G0S { - enableOptics = 1; - }; - class AadjPpneMstpSrasWrflDright: AidlPpneMstpSrasWrflDnon_G0S { - enableOptics = 1; - }; - class AadjPpneMstpSrasWrflDup; - class AadjPpneMstpSrasWrflDdown: AadjPpneMstpSrasWrflDup { - enableOptics = 1; - }; - - class AidlPpneMstpSrasWpstDnon_G0S; - class AadjPpneMstpSrasWpstDleft: AidlPpneMstpSrasWpstDnon_G0S { - enableOptics = 2; - }; - class AadjPpneMstpSrasWpstDright: AidlPpneMstpSrasWpstDnon_G0S { - enableOptics = 2; - }; - class AadjPpneMstpSrasWpstDup; - class AadjPpneMstpSrasWpstDdown: AadjPpneMstpSrasWpstDup { - enableOptics = 2; - }; - - // climb animation - class AmovPercMstpSnonWnonDnon: StandBase { - ConnectTo[] += {"AGM_Climb",0.02}; - }; - - class AmovPercMstpSnonWnonDnon_AcrgPknlMstpSnonWnonDnon_getInMedium; - class AGM_Climb: AmovPercMstpSnonWnonDnon_AcrgPknlMstpSnonWnonDnon_getInMedium { - canReload = 0; - forceAim = 1; - }; - }; -}; diff --git a/TO_MERGE/agm/Movement/fatigue.sqf b/TO_MERGE/agm/Movement/fatigue.sqf deleted file mode 100644 index fc248a17ed..0000000000 --- a/TO_MERGE/agm/Movement/fatigue.sqf +++ /dev/null @@ -1,55 +0,0 @@ -// by commy2 - -#define THRESHOLD_1 0.8 -#define THRESHOLD_2 0.9 -#define THRESHOLD_3 0.99 - -// init onEachFrame EH -AGM_UpdatePlayerFatigue_EHID = ["AGM_UpdatePlayerFatigue", "onEachFrame", { - _player = AGM_player; - - // calc new fatigue - _fatigue = getFatigue _player; - _fatigueOld = _player getVariable ["AGM_Fatigue", getFatigue _player]; - - if (_fatigue > _fatigueOld) then { - _fatigue = _fatigueOld + (missionNamespace getVariable ["AGM_Fatigue_CoefFatigue", 1]) * (_fatigue - _fatigueOld) max 0 min 1; - } else { - _fatigue = _fatigueOld - (missionNamespace getVariable ["AGM_Fatigue_CoefRecover", 1]) * (_fatigueOld - _fatigue) max 0 min 1; - }; - - _player setFatigue _fatigue; - _player setVariable ["AGM_Fatigue", _fatigue]; - - ["Fatigue", _player, {getFatigue _this}] call AGM_Debug_fnc_log; -}] call BIS_fnc_addStackedEventHandler; - -// init script ehids -_handleRecoil = scriptNull; -_handleBlinking = scriptNull; -_handleHeartbeat = scriptNull; -_handleStumble = scriptNull; - -// apply fatigue effects -while {true} do { - _fatigue = getFatigue AGM_player; - - if (_fatigue > THRESHOLD_1) then { - if (scriptDone _handleHeartbeat) then { - _handleHeartbeat = call AGM_Movement_fnc_heartbeat; - }; - if (_fatigue > THRESHOLD_2) then { - if (scriptDone _handleBlinking) then { - _handleBlinking = call AGM_Movement_fnc_blinking; - }; - - if (_fatigue > THRESHOLD_3) then { - if (scriptDone _handleStumble) then { - _handleStumble = call AGM_Movement_fnc_stumble; - }; - }; - }; - }; - - sleep 0.5; -}; diff --git a/TO_MERGE/agm/Movement/functions/fn_blinking.sqf b/TO_MERGE/agm/Movement/functions/fn_blinking.sqf deleted file mode 100644 index 6d28e87e66..0000000000 --- a/TO_MERGE/agm/Movement/functions/fn_blinking.sqf +++ /dev/null @@ -1,23 +0,0 @@ -// by commy2 - -private "_script_handle"; - -_script_handle = _this spawn { - if (!isTouchingGround player) exitWith {}; - - _ppEffect = ppEffectCreate ["ColorCorrections", 1240]; - _ppEffect ppEffectEnable true; - _ppEffect ppEffectForceInNVG true; - _ppEffect ppEffectAdjust [0, -1, 0, [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]; - _ppEffect ppEffectCommit 0.2; - sleep 0.2; - - _ppEffect ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [1, 1, 1, 1], [0.5, 0.5, 0.5, 0.5]]; - _ppEffect ppEffectCommit 0.2; - sleep 0.2; - - _ppEffect ppEffectEnable false; - ppEffectDestroy _ppEffect; - sleep 2 + random 2; -}; -_script_handle diff --git a/TO_MERGE/agm/Movement/functions/fn_climb.sqf b/TO_MERGE/agm/Movement/functions/fn_climb.sqf deleted file mode 100644 index 05f7e61606..0000000000 --- a/TO_MERGE/agm/Movement/functions/fn_climb.sqf +++ /dev/null @@ -1,21 +0,0 @@ -// by commy2 - -private "_unit"; - -_unit = _this select 0; - -if !([_unit] call AGM_Movement_fnc_canClimb) exitWith { - [localize "STR_AGM_Movement_CanNotClimb"] call AGM_Core_fnc_displayTextStructured; -}; - -if !(_unit getVariable ["AGM_isClimbInit", false]) then { - _unit addEventHandler ["AnimDone", { - if (local (_this select 0) && {_this select 1 == "AGM_Climb"}) then {_this call AGM_Movement_fnc_handleClimb}; - }]; - - _unit setVariable ["AGM_isClimbInit", true]; -}; - -[_unit] call AGM_Core_fnc_fixLoweredRifleAnimation; -[_unit, "AmovPercMstpSnonWnonDnon", 2] call AGM_Core_fnc_doAnimation; -[_unit, "AGM_Climb", 0] call AGM_Core_fnc_doAnimation; diff --git a/TO_MERGE/agm/Movement/functions/fn_fatigueModule.sqf b/TO_MERGE/agm/Movement/functions/fn_fatigueModule.sqf deleted file mode 100644 index 9e9ab34759..0000000000 --- a/TO_MERGE/agm/Movement/functions/fn_fatigueModule.sqf +++ /dev/null @@ -1,14 +0,0 @@ -// by commy2 - -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; - -if !(_activated) exitWith {}; - -AGM_Fatigue_Module = true; - -AGM_Fatigue_CoefFatigue = parseNumber (_logic getVariable "CoefFatigue"); -AGM_Fatigue_CoefRecover = parseNumber (_logic getVariable "CoefRecover"); - -diag_log text "[AGM]: Fatigue Module Initialized."; diff --git a/TO_MERGE/agm/Movement/functions/fn_getWeight.sqf b/TO_MERGE/agm/Movement/functions/fn_getWeight.sqf deleted file mode 100644 index db9b286422..0000000000 --- a/TO_MERGE/agm/Movement/functions/fn_getWeight.sqf +++ /dev/null @@ -1,17 +0,0 @@ -// by commy2 - -#define FACTOR_POUND_TO_KILOGRAMM 1/2.2046 - -private ["_unit", "_weight"]; - -_unit = _this select 0; - -_weight = loadAbs _unit * 0.1; - -if (profileNamespace getVariable ["AGM_useImperial", false]) then { - _weight = format ["%1lb", (round (_weight * 100)) / 100]; -} else { - _weight = format ["%1kg", (round (_weight * FACTOR_POUND_TO_KILOGRAMM * 100)) / 100]; -}; - -_weight diff --git a/TO_MERGE/agm/Movement/functions/fn_heartbeat.sqf b/TO_MERGE/agm/Movement/functions/fn_heartbeat.sqf deleted file mode 100644 index 260d814def..0000000000 --- a/TO_MERGE/agm/Movement/functions/fn_heartbeat.sqf +++ /dev/null @@ -1,9 +0,0 @@ -// by commy2 - -private "_script_handle"; - -_script_handle = _this spawn { - playSound "AGM_Heartbeat"; - sleep 8; -}; -_script_handle diff --git a/TO_MERGE/agm/Movement/functions/fn_recoil.sqf b/TO_MERGE/agm/Movement/functions/fn_recoil.sqf deleted file mode 100644 index 342453cf6d..0000000000 --- a/TO_MERGE/agm/Movement/functions/fn_recoil.sqf +++ /dev/null @@ -1,15 +0,0 @@ -// by commy2 - -private "_script_handle"; - -_script_handle = _this spawn { - _recoilFactor = _this select 0; - _recoverThreshold = _this select 1; - - player setUnitRecoilCoefficient (_recoilFactor * unitRecoilCoefficient player); - - waitUntil {getFatigue player < _recoverThreshold}; - - player setUnitRecoilCoefficient (_recoilFactor / unitRecoilCoefficient player); -}; -_script_handle diff --git a/TO_MERGE/agm/Movement/functions/fn_stumble.sqf b/TO_MERGE/agm/Movement/functions/fn_stumble.sqf deleted file mode 100644 index 7ca8a28bbf..0000000000 --- a/TO_MERGE/agm/Movement/functions/fn_stumble.sqf +++ /dev/null @@ -1,16 +0,0 @@ -// by commy2 - -_this spawn { - if (isTouchingGround player) then { - _animation = switch (currentWeapon player) do { - case "" : {"AmovPpneMstpSnonWnonDnon"}; - case (primaryWeapon player) : {"AmovPpneMstpSrasWrflDnon"}; - case (secondaryWeapon player) : {"AmovPpneMstpSrasWrflDnon"}; - case (handgunWeapon player) : {"AmovPpneMstpSrasWpstDnon"}; - case (binocular player) : {"AmovPpneMstpSrasWbinDnon"}; - default {"AmovPpneMstpSnonWnonDnon"}; - }; - [player, _animation] call AGM_Core_fnc_doAnimation; - }; - sleep 6; -} diff --git a/TO_MERGE/agm/Movement/functions/fn_vision.sqf b/TO_MERGE/agm/Movement/functions/fn_vision.sqf deleted file mode 100644 index 79a88df785..0000000000 --- a/TO_MERGE/agm/Movement/functions/fn_vision.sqf +++ /dev/null @@ -1,18 +0,0 @@ -// by commy2 - -private "_script_handle"; - -_script_handle = _this spawn { - _ppEffect = ppEffectCreate ["radialBlur", 1241]; - - _ppEffect ppEffectEnable true; - _ppEffect ppEffectForceInNVG true; - _ppEffect ppEffectAdjust [0.01, 0.01, 0.1, 0.1]; - _ppEffect ppEffectCommit 0; - - sleep 0.5; - - _ppEffect ppEffectEnable false; - ppEffectDestroy _ppEffect; -}; -_script_handle diff --git a/TO_MERGE/agm/Movement/showWeight.sqf b/TO_MERGE/agm/Movement/showWeight.sqf deleted file mode 100644 index 2fcdff7b05..0000000000 --- a/TO_MERGE/agm/Movement/showWeight.sqf +++ /dev/null @@ -1,10 +0,0 @@ -//by commy2 - -while {true} do { - waitUntil {!isNull (findDisplay 602)}; - waitUntil { - _player = AGM_player; - findDisplay 602 displayCtrl 111 ctrlSetText format ["%1 - %2 %3", [_player] call AGM_Core_fnc_getName, localize "STR_AGM_Movement_Weight", [_player] call AGM_Movement_fnc_getWeight]; - isNull (findDisplay 602) - }; -}; diff --git a/TO_MERGE/agm/Movement/sounds/Heartbeat.ogg b/TO_MERGE/agm/Movement/sounds/Heartbeat.ogg deleted file mode 100644 index 2e370a566e..0000000000 Binary files a/TO_MERGE/agm/Movement/sounds/Heartbeat.ogg and /dev/null differ diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 02a471a124..59b5d7734e 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -99,6 +99,14 @@ GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex); ["playerVisionModeChanged", [ACE_player, _newPlayerVisionMode]] call FUNC(localEvent); }; + // "inventoryDisplayChanged" event + _newInventoryDisplayIsOpen = !(isNull findDisplay 602); + if !(_newInventoryDisplayIsOpen isEqualTo GVAR(OldInventoryDisplayIsOpen)) then { + // Raise ACE event locally + GVAR(OldInventoryDisplayIsOpen) = _newInventoryDisplayIsOpen; + ["inventoryDisplayChanged", [ACE_player, _newInventoryDisplayIsOpen]] call FUNC(localEvent); + }; + // "zeusDisplayChanged" event _newZeusDisplayIsOpen = !(isNull findDisplay 312); if !(_newZeusDisplayIsOpen isEqualTo GVAR(OldZeusDisplayIsOpen)) then { diff --git a/addons/movement/$PBOPREFIX$ b/addons/movement/$PBOPREFIX$ new file mode 100644 index 0000000000..5898817efe --- /dev/null +++ b/addons/movement/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\movement \ No newline at end of file diff --git a/addons/movement/CfgEventHandlers.hpp b/addons/movement/CfgEventHandlers.hpp new file mode 100644 index 0000000000..0cd959a047 --- /dev/null +++ b/addons/movement/CfgEventHandlers.hpp @@ -0,0 +1,12 @@ + +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)); + }; +}; diff --git a/addons/movement/CfgFatigue.hpp b/addons/movement/CfgFatigue.hpp new file mode 100644 index 0000000000..288462ccb9 --- /dev/null +++ b/addons/movement/CfgFatigue.hpp @@ -0,0 +1,11 @@ + +class CfgFatigue { + MinValue1 = 0.2; + MinValue2 = 0.8; + NormalRunSpeed = 7.2; + TiredRunSpeedLimit = 0.8; + FrequencyMin = 0.2; + FrequencyMax = 1.0; + TotalLoadCoef = 1.1; + MaxDuty = 10; +}; diff --git a/addons/movement/CfgInventoryGlobalVariable.hpp b/addons/movement/CfgInventoryGlobalVariable.hpp new file mode 100644 index 0000000000..1210f3df58 --- /dev/null +++ b/addons/movement/CfgInventoryGlobalVariable.hpp @@ -0,0 +1,4 @@ + +class CfgInventoryGlobalVariable { + maxSoldierLoad = 1200; +}; diff --git a/addons/movement/CfgMoves.hpp b/addons/movement/CfgMoves.hpp new file mode 100644 index 0000000000..9d32d4e856 --- /dev/null +++ b/addons/movement/CfgMoves.hpp @@ -0,0 +1,117 @@ + +class CfgMovesBasic { + class ManActions { + ACE_Climb = "ACE_Climb"; + }; + + class Actions { + class RifleStandActionsNoAdjust; + class RifleLowStandActionsNoAdjust; + + // WEAPON RAISED - RUNNING + class RifleStandActionsRunF: RifleStandActionsNoAdjust { + getOver = "AovrPercMrunSrasWrflDf"; + }; + class RifleStandActionsRunFL: RifleStandActionsNoAdjust { + getOver = "AovrPercMrunSrasWrflDf"; + }; + class RifleStandActionsRunFR: RifleStandActionsNoAdjust { + getOver = "AovrPercMrunSrasWrflDf"; + }; + // WEAPON RAISED - SPRINTING + class RifleStandEvasiveActionsF: RifleStandActionsNoAdjust { + getOver = "AovrPercMrunSrasWrflDf"; + }; + class RifleStandEvasiveActionsFL: RifleStandActionsNoAdjust { + getOver = "AovrPercMrunSrasWrflDf"; + }; + class RifleStandEvasiveActionsFR: RifleStandActionsNoAdjust { + getOver = "AovrPercMrunSrasWrflDf"; + }; + // WEAPON LOWERED - RUNNING + class RifleLowStandActionsRunF: RifleLowStandActionsNoAdjust { + getOver = "AovrPercMrunSrasWrflDf"; + }; + class RifleLowStandActionsRunFL: RifleLowStandActionsNoAdjust { + getOver = "AovrPercMrunSrasWrflDf"; + }; + class RifleLowStandActionsRunFR: RifleLowStandActionsNoAdjust { + getOver = "AovrPercMrunSrasWrflDf"; + }; + }; +}; + +class CfgMovesMaleSdr: CfgMovesBasic { + class StandBase; + class States { + // better slow walk with lowered rifle animation + class AmovPercMstpSrasWrflDnon; + class AmovPercMrunSrasWrflDf: AmovPercMstpSrasWrflDnon { + InterpolateTo[] = {"AovrPercMrunSrasWrflDf",0.22,"AmovPercMrunSlowWrflDf",0.025,"AmovPercMwlkSrasWrflDf",0.025,"AmovPknlMrunSrasWrflDf",0.03,"AmovPercMrunSlowWrflDf_AmovPpneMstpSrasWrflDnon",0.02,"AmovPercMevaSrasWrflDf",0.025,"Unconscious",0.01,"AmovPercMtacSrasWrflDf",0.02,"AmovPercMrunSrasWrflDfl",0.02,"AmovPercMrunSrasWrflDfl_ldst",0.02,"AmovPercMrunSrasWrflDfr",0.02,"AmovPercMrunSrasWrflDfr_ldst",0.02,"AmovPercMstpSrasWrflDnon",0.02,"AmovPercMrunSrasWrflDl",0.02,"AmovPercMrunSrasWrflDbl",0.02,"AmovPercMrunSrasWrflDb",0.02,"AmovPercMrunSrasWrflDbr",0.02,"AmovPercMrunSrasWrflDr",0.02,"AmovPknlMstpSlowWrflDnon_relax",0.1,"AmovPercMrunSrasWrflDf_ldst",0.02,"AmovPercMrunSrasWrflDf",0.02}; + }; + + class AmovPercMstpSlowWrflDnon; + class AmovPercMwlkSlowWrflDf: AmovPercMstpSlowWrflDnon { + speed = 0.3; //0.206897; + file = "\A3\anims_f\Data\Anim\Sdr\Mov\Erc\Wlk\Low\Rfl\AmovPercMwlkSlowWrflDf_ver2"; + leftHandIKCurve[] = {1}; + }; + class AmovPercMwlkSlowWrflDfl: AmovPercMwlkSlowWrflDf { + leftHandIKCurve[] = {}; + }; + class AmovPercMwlkSlowWrflDfr: AmovPercMwlkSlowWrflDf { + leftHandIKCurve[] = {}; + }; + class AmovPercMwlkSlowWrflDb: AmovPercMwlkSlowWrflDf { + leftHandIKCurve[] = {}; + }; + class AmovPercMwlkSlowWrflDbl: AmovPercMwlkSlowWrflDf { + leftHandIKCurve[] = {}; + }; + class AmovPercMwlkSlowWrflDbr: AmovPercMwlkSlowWrflDf { + leftHandIKCurve[] = {}; + }; + class AmovPercMwlkSlowWrflDl: AmovPercMwlkSlowWrflDf { + leftHandIKCurve[] = {}; + }; + class AmovPercMwlkSlowWrflDr: AmovPercMwlkSlowWrflDf { + leftHandIKCurve[] = {}; + }; + + // enable optics in prone left and right stance + class AidlPpneMstpSrasWrflDnon_G0S; + class AadjPpneMstpSrasWrflDleft: AidlPpneMstpSrasWrflDnon_G0S { + enableOptics = 1; + }; + class AadjPpneMstpSrasWrflDright: AidlPpneMstpSrasWrflDnon_G0S { + enableOptics = 1; + }; + class AadjPpneMstpSrasWrflDup; + class AadjPpneMstpSrasWrflDdown: AadjPpneMstpSrasWrflDup { + enableOptics = 1; + }; + + class AidlPpneMstpSrasWpstDnon_G0S; + class AadjPpneMstpSrasWpstDleft: AidlPpneMstpSrasWpstDnon_G0S { + enableOptics = 2; + }; + class AadjPpneMstpSrasWpstDright: AidlPpneMstpSrasWpstDnon_G0S { + enableOptics = 2; + }; + class AadjPpneMstpSrasWpstDup; + class AadjPpneMstpSrasWpstDdown: AadjPpneMstpSrasWpstDup { + enableOptics = 2; + }; + + // climb animation + class AmovPercMstpSnonWnonDnon: StandBase { + ConnectTo[] += {"ACE_Climb",0.02}; + }; + + class AmovPercMstpSnonWnonDnon_AcrgPknlMstpSnonWnonDnon_getInMedium; + class ACE_Climb: AmovPercMstpSnonWnonDnon_AcrgPknlMstpSnonWnonDnon_getInMedium { + canReload = 0; + forceAim = 1; + }; + }; +}; diff --git a/addons/movement/XEH_postInit.sqf b/addons/movement/XEH_postInit.sqf new file mode 100644 index 0000000000..edf1991006 --- /dev/null +++ b/addons/movement/XEH_postInit.sqf @@ -0,0 +1,19 @@ +//by commy2 +#include "script_component.hpp" + +["inventoryDisplayLoaded", { + + [{ + private "_dialog"; + + _dialog = _this select 0; + + if (isNull _dialog) exitWith { + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + + _dialog displayCtrl 111 ctrlSetText format ["%1 - %2 %3", [ACE_player] call EFUNC(common,getName), localize "STR_ACE_Movement_Weight", [ACE_player] call FUNC(getWeight)]; + + }, 0, _this select 0] call CBA_fnc_addPerFrameHandler; + +}] call EFUNC(common,addEventHandler); diff --git a/addons/movement/XEH_preInit.sqf b/addons/movement/XEH_preInit.sqf new file mode 100644 index 0000000000..e4c6a2f056 --- /dev/null +++ b/addons/movement/XEH_preInit.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" + +PREP(getWeight); +PREP(canClimb); +PREP(climb); +PREP(handleClimb); diff --git a/addons/movement/config.cpp b/addons/movement/config.cpp new file mode 100644 index 0000000000..7137d44469 --- /dev/null +++ b/addons/movement/config.cpp @@ -0,0 +1,37 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"commy2","KoffeinFlummi","Tachii"}; + authorUrl = "https://github.com/commy2/"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgFatigue.hpp" +//#include "CfgInventoryGlobalVariable.hpp" +#include "CfgMoves.hpp" + +class ACE_Default_Keys { + class climb { + displayName = "$STR_ACE_Movement_Climb"; + condition = QUOTE(_player == _vehicle); + statement = QUOTE([_player] call FUNC(climb);); + key = 47; + shift = 0; + control = 1; + alt = 0; + }; +}; + +class ACE_Options { + class useImperial { + displayName = "$STR_ACE_Movement_UseImperial"; + default = 0; + }; +}; diff --git a/TO_MERGE/agm/Movement/functions/fn_canClimb.sqf b/addons/movement/functions/fnc_canClimb.sqf similarity index 95% rename from TO_MERGE/agm/Movement/functions/fn_canClimb.sqf rename to addons/movement/functions/fnc_canClimb.sqf index 271a26e221..bd62bfb768 100644 --- a/TO_MERGE/agm/Movement/functions/fn_canClimb.sqf +++ b/addons/movement/functions/fnc_canClimb.sqf @@ -1,4 +1,5 @@ // by commy2 +#include "script_component.hpp" private ["_unit", "_pos", "_dir"]; diff --git a/addons/movement/functions/fnc_climb.sqf b/addons/movement/functions/fnc_climb.sqf new file mode 100644 index 0000000000..8a2988f00f --- /dev/null +++ b/addons/movement/functions/fnc_climb.sqf @@ -0,0 +1,22 @@ +// by commy2 +#include "script_component.hpp" + +private "_unit"; + +_unit = _this select 0; + +if !([_unit] call FUNC(canClimb)) exitWith { + [localize "STR_ACE_Movement_CanNotClimb"] call EFUNC(common,displayTextStructured); +}; + +if !(_unit getVariable ["ACE_isClimbInit", false]) then { + _unit addEventHandler ["AnimDone", { + if (local (_this select 0) && {_this select 1 == "ACE_Climb"}) then {_this call FUNC(handleClimb)}; + }]; + + _unit setVariable ["ACE_isClimbInit", true]; +}; + +[_unit] call EFUNC(common,fixLoweredRifleAnimation); +[_unit, "AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); +[_unit, "ACE_Climb", 0] call EFUNC(common,doAnimation); diff --git a/addons/movement/functions/fnc_getWeight.sqf b/addons/movement/functions/fnc_getWeight.sqf new file mode 100644 index 0000000000..9cbd7939bb --- /dev/null +++ b/addons/movement/functions/fnc_getWeight.sqf @@ -0,0 +1,16 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_weight"]; + +_unit = _this select 0; + +_weight = loadAbs _unit * 0.1; + +if (profileNamespace getVariable ["ACE_useImperial", false]) then { + _weight = format ["%1lb", (round (_weight * 100)) / 100]; +} else { + _weight = format ["%1kg", (round (_weight * FACTOR_POUND_TO_KILOGRAMM * 100)) / 100]; +}; + +_weight diff --git a/TO_MERGE/agm/Movement/functions/fn_handleClimb.sqf b/addons/movement/functions/fnc_handleClimb.sqf similarity index 70% rename from TO_MERGE/agm/Movement/functions/fn_handleClimb.sqf rename to addons/movement/functions/fnc_handleClimb.sqf index 3501fbee99..a96beccc2c 100644 --- a/TO_MERGE/agm/Movement/functions/fn_handleClimb.sqf +++ b/addons/movement/functions/fnc_handleClimb.sqf @@ -1,4 +1,5 @@ // by commy2 +#include "script_component.hpp" private ["_unit", "_anim", "_pos"]; @@ -6,7 +7,7 @@ _unit = _this select 0; _anim = _this select 1; _pos = _unit modelToWorld (_unit selectionPosition "camera"); -[_unit, "AmovPknlMstpSnonWnonDnon", 2] call AGM_Core_fnc_doAnimation; +[_unit, "AmovPknlMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); _pos = _pos vectorDiff (_unit selectionPosition "camera"); diff --git a/addons/movement/functions/script_component.hpp b/addons/movement/functions/script_component.hpp new file mode 100644 index 0000000000..d33fa99b30 --- /dev/null +++ b/addons/movement/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\movement\script_component.hpp" \ No newline at end of file diff --git a/addons/movement/script_component.hpp b/addons/movement/script_component.hpp new file mode 100644 index 0000000000..9b8954bf62 --- /dev/null +++ b/addons/movement/script_component.hpp @@ -0,0 +1,14 @@ +#define COMPONENT movement +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_MOVEMENT + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_MOVEMENT + #define DEBUG_SETTINGS DEBUG_ENABLED_MOVEMENT +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + +#define FACTOR_POUND_TO_KILOGRAMM 1/2.2046 diff --git a/TO_MERGE/agm/Movement/stringtable.xml b/addons/movement/stringtable.xml similarity index 88% rename from TO_MERGE/agm/Movement/stringtable.xml rename to addons/movement/stringtable.xml index 505a013950..d31896acaa 100644 --- a/TO_MERGE/agm/Movement/stringtable.xml +++ b/addons/movement/stringtable.xml @@ -1,8 +1,8 @@  - + - + Show weight in lb Zeige Gewicht in Pfund Mostrar peso en libras @@ -14,7 +14,7 @@ Súly megjelenítése fontban. Показать вес в фунтах - + Weight: Gewicht: Peso: @@ -26,7 +26,7 @@ Súly: Вес: - + Climb Klettern Wspinaczka @@ -34,7 +34,7 @@ Vylézt Подняться - + Can't climb here Kann hier nicht klettern Nie możesz wspiąć się tutaj