From 36b7ac0623ef86c2eed6796734882fc33509bc1c Mon Sep 17 00:00:00 2001 From: John Lillis Date: Wed, 15 Nov 2017 12:16:15 -0500 Subject: [PATCH 1/3] Add swayFactor option to advanced fatigue --- addons/advanced_fatigue/ACE_Settings.hpp | 7 +++++++ addons/advanced_fatigue/CfgVehicles.hpp | 6 ++++++ addons/advanced_fatigue/functions/fnc_handleEffects.sqf | 6 +++--- addons/advanced_fatigue/functions/fnc_moduleSettings.sqf | 1 + addons/advanced_fatigue/initSettings.sqf | 9 +++++++++ addons/advanced_fatigue/stringtable.xml | 6 ++++++ 6 files changed, 32 insertions(+), 3 deletions(-) diff --git a/addons/advanced_fatigue/ACE_Settings.hpp b/addons/advanced_fatigue/ACE_Settings.hpp index 8abdcc5865b..4a7efcbaadb 100644 --- a/addons/advanced_fatigue/ACE_Settings.hpp +++ b/addons/advanced_fatigue/ACE_Settings.hpp @@ -42,4 +42,11 @@ class ACE_Settings { typeName = "SCALAR"; value = 1; }; + class GVAR(swayFactor) { + category = CSTRING(DisplayName); + displayName = CSTRING(SwayFactor); + description = CSTRING(SwayFactor_Description); + typeName = "SCALAR"; + value = 1; + }; }; diff --git a/addons/advanced_fatigue/CfgVehicles.hpp b/addons/advanced_fatigue/CfgVehicles.hpp index f6cead81e1b..0f4065ba07c 100644 --- a/addons/advanced_fatigue/CfgVehicles.hpp +++ b/addons/advanced_fatigue/CfgVehicles.hpp @@ -40,6 +40,12 @@ class CfgVehicles { typeName = "NUMBER"; defaultValue = 1; }; + class SwayFactor { + displayName = CSTRING(SwayFactor); + description = CSTRING(SwayFactor_Description); + typeName = "NUMBER"; + defaultValue = 1; + }; }; }; }; diff --git a/addons/advanced_fatigue/functions/fnc_handleEffects.sqf b/addons/advanced_fatigue/functions/fnc_handleEffects.sqf index 111727c826e..a1ab7ac1df8 100644 --- a/addons/advanced_fatigue/functions/fnc_handleEffects.sqf +++ b/addons/advanced_fatigue/functions/fnc_handleEffects.sqf @@ -90,12 +90,12 @@ if (_overexhausted) then { switch (stance _unit) do { case ("CROUCH"): { - _unit setCustomAimCoef (1.0 + _fatigue ^ 2 * 0.1); + _unit setCustomAimCoef ((1.0 + _fatigue ^ 2 * 0.1) * GVAR(swayFactor)); }; case ("PRONE"): { - _unit setCustomAimCoef (1.0 + _fatigue ^ 2 * 2.0); + _unit setCustomAimCoef ((1.0 + _fatigue ^ 2 * 2.0) * GVAR(swayFactor)); }; default { - _unit setCustomAimCoef (1.5 + _fatigue ^ 2 * 3.0); + _unit setCustomAimCoef ((1.5 + _fatigue ^ 2 * 3.0) * GVAR(swayFactor)); }; }; diff --git a/addons/advanced_fatigue/functions/fnc_moduleSettings.sqf b/addons/advanced_fatigue/functions/fnc_moduleSettings.sqf index 9d1a0a6ab6e..d9037601823 100644 --- a/addons/advanced_fatigue/functions/fnc_moduleSettings.sqf +++ b/addons/advanced_fatigue/functions/fnc_moduleSettings.sqf @@ -21,3 +21,4 @@ params ["_logic"]; [_logic, QGVAR(recoveryFactor), "RecoveryFactor"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(loadFactor), "LoadFactor"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(terrainGradientFactor), "TerrainGradientFactor"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(swayFactor), "SwayFactor"] call EFUNC(common,readSettingFromModule); diff --git a/addons/advanced_fatigue/initSettings.sqf b/addons/advanced_fatigue/initSettings.sqf index d6c8acd0dba..ea8ddb45d66 100644 --- a/addons/advanced_fatigue/initSettings.sqf +++ b/addons/advanced_fatigue/initSettings.sqf @@ -57,3 +57,12 @@ [0, 2, 1, 1], true ] call CBA_Settings_fnc_init; + +[ + QGVAR(swayFactor), + "SLIDER", + [LSTRING(SwayFactor), LSTRING(SwayFactor_Description)], + "ACE3 Advanced Fatigue", + [0, 2, 1, 1], + true +] call CBA_Settings_fnc_init; diff --git a/addons/advanced_fatigue/stringtable.xml b/addons/advanced_fatigue/stringtable.xml index 95b30d3c57f..429bc076ccc 100644 --- a/addons/advanced_fatigue/stringtable.xml +++ b/addons/advanced_fatigue/stringtable.xml @@ -109,6 +109,12 @@ 設定陡峭的地形將會影響多少體力的流失,值越高代表體力流失越快 设定陡峭的地形将会影响多少体力的流,失值越高代表体力流失越快 + + Sway factor + + + Changes how much fatigue influences weapon sway. Higher means more weapon sway. + Enabled Aktiv From 947b89d5aacd04289001d9e901250672a78907da Mon Sep 17 00:00:00 2001 From: John Lillis Date: Wed, 15 Nov 2017 12:22:56 -0500 Subject: [PATCH 2/3] Update docs and stringtable.xml --- addons/advanced_fatigue/stringtable.xml | 2 +- docs/wiki/framework/advanced-fatigue-framework.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/advanced_fatigue/stringtable.xml b/addons/advanced_fatigue/stringtable.xml index 429bc076ccc..7f6b552eb41 100644 --- a/addons/advanced_fatigue/stringtable.xml +++ b/addons/advanced_fatigue/stringtable.xml @@ -113,7 +113,7 @@ Sway factor - Changes how much fatigue influences weapon sway. Higher means more weapon sway. + Influences the amount of weapon sway. Higher means more sway. Enabled diff --git a/docs/wiki/framework/advanced-fatigue-framework.md b/docs/wiki/framework/advanced-fatigue-framework.md index 7ef836b7f27..93c9aa9b77d 100644 --- a/docs/wiki/framework/advanced-fatigue-framework.md +++ b/docs/wiki/framework/advanced-fatigue-framework.md @@ -19,6 +19,7 @@ ACE provides four settings to tweak Advanced Fatigue. Adjust these factors depen - **Recovery factor:** Do you like looking at the landscape or think breaks are boring? Whatever the case, this influences the length of your stamina breaks. - **Load factor:** If you believe a Javelin is the perfect companion for your .50 BMG sniper rifle you probably should tweak this setting. - **Terrain factor**: Not everyone is used to mountainous terrain. Tweak this until you feel more at home. +- **Sway factor**: Influences the amount of weapon sway. Higher means more sway. Note that while there currently is no restriction on the value of these settings, it's generally recommended to keep them between 0 and 2. From d64a0c6728ee2e026c2537346c82f1e337d102b5 Mon Sep 17 00:00:00 2001 From: John Lillis Date: Sun, 18 Feb 2018 11:09:49 -0500 Subject: [PATCH 3/3] Remove SwayFactor ACE setting and module addition --- addons/advanced_fatigue/ACE_Settings.hpp | 7 ------- addons/advanced_fatigue/CfgVehicles.hpp | 6 ------ addons/advanced_fatigue/functions/fnc_moduleSettings.sqf | 1 - 3 files changed, 14 deletions(-) diff --git a/addons/advanced_fatigue/ACE_Settings.hpp b/addons/advanced_fatigue/ACE_Settings.hpp index 4a7efcbaadb..8abdcc5865b 100644 --- a/addons/advanced_fatigue/ACE_Settings.hpp +++ b/addons/advanced_fatigue/ACE_Settings.hpp @@ -42,11 +42,4 @@ class ACE_Settings { typeName = "SCALAR"; value = 1; }; - class GVAR(swayFactor) { - category = CSTRING(DisplayName); - displayName = CSTRING(SwayFactor); - description = CSTRING(SwayFactor_Description); - typeName = "SCALAR"; - value = 1; - }; }; diff --git a/addons/advanced_fatigue/CfgVehicles.hpp b/addons/advanced_fatigue/CfgVehicles.hpp index 0f4065ba07c..f6cead81e1b 100644 --- a/addons/advanced_fatigue/CfgVehicles.hpp +++ b/addons/advanced_fatigue/CfgVehicles.hpp @@ -40,12 +40,6 @@ class CfgVehicles { typeName = "NUMBER"; defaultValue = 1; }; - class SwayFactor { - displayName = CSTRING(SwayFactor); - description = CSTRING(SwayFactor_Description); - typeName = "NUMBER"; - defaultValue = 1; - }; }; }; }; diff --git a/addons/advanced_fatigue/functions/fnc_moduleSettings.sqf b/addons/advanced_fatigue/functions/fnc_moduleSettings.sqf index d9037601823..9d1a0a6ab6e 100644 --- a/addons/advanced_fatigue/functions/fnc_moduleSettings.sqf +++ b/addons/advanced_fatigue/functions/fnc_moduleSettings.sqf @@ -21,4 +21,3 @@ params ["_logic"]; [_logic, QGVAR(recoveryFactor), "RecoveryFactor"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(loadFactor), "LoadFactor"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(terrainGradientFactor), "TerrainGradientFactor"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(swayFactor), "SwayFactor"] call EFUNC(common,readSettingFromModule);