From 65acac036e32a387d8972e63365b2c01cda796c5 Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Sat, 7 Sep 2024 20:31:44 +0200 Subject: [PATCH 01/23] New Function: updatePerFrameHandlerDelay --- addons/common/CfgFunctions.hpp | 1 + .../common/fnc_updatePerFrameHandlerDelay.sqf | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 addons/common/fnc_updatePerFrameHandlerDelay.sqf diff --git a/addons/common/CfgFunctions.hpp b/addons/common/CfgFunctions.hpp index 0f4043466..04aca6137 100644 --- a/addons/common/CfgFunctions.hpp +++ b/addons/common/CfgFunctions.hpp @@ -121,6 +121,7 @@ class CfgFunctions { class Misc { PATHTO_FNC(addPerFrameHandler); PATHTO_FNC(removePerFrameHandler); + PATHTO_FNC(updatePerFrameHandlerDelay); PATHTO_FNC(createPerFrameHandlerObject); PATHTO_FNC(deletePerFrameHandlerObject); PATHTO_FNC(addPlayerAction); diff --git a/addons/common/fnc_updatePerFrameHandlerDelay.sqf b/addons/common/fnc_updatePerFrameHandlerDelay.sqf new file mode 100644 index 000000000..9c0977497 --- /dev/null +++ b/addons/common/fnc_updatePerFrameHandlerDelay.sqf @@ -0,0 +1,30 @@ +#include "script_component.hpp" +/* ---------------------------------------------------------------------------- +Function: CBA_fnc_updatePerFrameHandlerDelay + +Description: + Updates the delay of an existing perFrameHandler. + +Parameters: + _handle - The function you wish to execute. + _delay - The amount of time in seconds between executions, 0 for every frame. (optional, default: 0) + +Returns: + true if removed successful, false otherwise + +Examples: + (begin example) + _wasSuccessful = [_handle, _newDelay] call CBA_fnc_updatePerFrameHandlerDelay; + (end) + +Author: + Mokka, OverlordZorn +---------------------------------------------------------------------------- */ + +params [["_handle", -1, [0]], ["_newDelay", 0, [0]]]; + +private _idx = cba_common_PFHhandles param [_handle]; +if (isNil "_idx") exitWith {false}; +(cba_common_perFrameHandlerArray select _idx) set [1, _newDelay]; + +true \ No newline at end of file From d69b24920524468e6a57d2529ff1a8dcc8fc05da Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Sat, 7 Sep 2024 20:45:41 +0200 Subject: [PATCH 02/23] update header --- addons/common/fnc_updatePerFrameHandlerDelay.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/common/fnc_updatePerFrameHandlerDelay.sqf b/addons/common/fnc_updatePerFrameHandlerDelay.sqf index 9c0977497..0f9249049 100644 --- a/addons/common/fnc_updatePerFrameHandlerDelay.sqf +++ b/addons/common/fnc_updatePerFrameHandlerDelay.sqf @@ -6,11 +6,11 @@ Description: Updates the delay of an existing perFrameHandler. Parameters: - _handle - The function you wish to execute. + _handle - The existing perFrameHandler's handle. _delay - The amount of time in seconds between executions, 0 for every frame. (optional, default: 0) Returns: - true if removed successful, false otherwise + true if successful, false otherwise Examples: (begin example) From d7c0d007f54e165cb45a350c77b1544a5f467c6a Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Sat, 7 Sep 2024 20:47:01 +0200 Subject: [PATCH 03/23] macro'fied --- addons/common/fnc_updatePerFrameHandlerDelay.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/common/fnc_updatePerFrameHandlerDelay.sqf b/addons/common/fnc_updatePerFrameHandlerDelay.sqf index 0f9249049..385e8b47f 100644 --- a/addons/common/fnc_updatePerFrameHandlerDelay.sqf +++ b/addons/common/fnc_updatePerFrameHandlerDelay.sqf @@ -23,8 +23,8 @@ Author: params [["_handle", -1, [0]], ["_newDelay", 0, [0]]]; -private _idx = cba_common_PFHhandles param [_handle]; +private _idx = GVAR(PFHhandles) param [_handle]; if (isNil "_idx") exitWith {false}; -(cba_common_perFrameHandlerArray select _idx) set [1, _newDelay]; +(GVAR(perFrameHandlerArray) select _idx) set [1, _newDelay]; true \ No newline at end of file From 40d67edf71401765f675dec5ecfe5786015b0812 Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Sat, 7 Sep 2024 20:59:30 +0200 Subject: [PATCH 04/23] param -> select --- addons/common/fnc_updatePerFrameHandlerDelay.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/fnc_updatePerFrameHandlerDelay.sqf b/addons/common/fnc_updatePerFrameHandlerDelay.sqf index 385e8b47f..51b65c91b 100644 --- a/addons/common/fnc_updatePerFrameHandlerDelay.sqf +++ b/addons/common/fnc_updatePerFrameHandlerDelay.sqf @@ -23,7 +23,7 @@ Author: params [["_handle", -1, [0]], ["_newDelay", 0, [0]]]; -private _idx = GVAR(PFHhandles) param [_handle]; +private _idx = GVAR(PFHhandles) select _handle; if (isNil "_idx") exitWith {false}; (GVAR(perFrameHandlerArray) select _idx) set [1, _newDelay]; From 1eff683e2ce4ddc073c1060bbda8b5b12114a763 Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Sat, 7 Sep 2024 21:00:44 +0200 Subject: [PATCH 05/23] Revert "param -> select" This reverts commit 40d67edf71401765f675dec5ecfe5786015b0812. --- addons/common/fnc_updatePerFrameHandlerDelay.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/fnc_updatePerFrameHandlerDelay.sqf b/addons/common/fnc_updatePerFrameHandlerDelay.sqf index 51b65c91b..385e8b47f 100644 --- a/addons/common/fnc_updatePerFrameHandlerDelay.sqf +++ b/addons/common/fnc_updatePerFrameHandlerDelay.sqf @@ -23,7 +23,7 @@ Author: params [["_handle", -1, [0]], ["_newDelay", 0, [0]]]; -private _idx = GVAR(PFHhandles) select _handle; +private _idx = GVAR(PFHhandles) param [_handle]; if (isNil "_idx") exitWith {false}; (GVAR(perFrameHandlerArray) select _idx) set [1, _newDelay]; From 709a41abf8f3a1a1baeba4f494830f15a9701b43 Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Sat, 7 Sep 2024 21:14:18 +0200 Subject: [PATCH 06/23] preperation for updateExectuionTime --- addons/common/fnc_updatePerFrameHandlerDelay.sqf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/common/fnc_updatePerFrameHandlerDelay.sqf b/addons/common/fnc_updatePerFrameHandlerDelay.sqf index 385e8b47f..09bcf5673 100644 --- a/addons/common/fnc_updatePerFrameHandlerDelay.sqf +++ b/addons/common/fnc_updatePerFrameHandlerDelay.sqf @@ -21,10 +21,14 @@ Author: Mokka, OverlordZorn ---------------------------------------------------------------------------- */ -params [["_handle", -1, [0]], ["_newDelay", 0, [0]]]; +params [["_handle", -1, [0]], ["_newDelay", 0, [0]], ["_updateExectionTime", false, [false]]]; private _idx = GVAR(PFHhandles) param [_handle]; if (isNil "_idx") exitWith {false}; (GVAR(perFrameHandlerArray) select _idx) set [1, _newDelay]; +if (_updateExectionTime) then { + // Add code here +}; + true \ No newline at end of file From 920e85a1041cc29bebd02d1c49983c32e3b7767b Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Sat, 7 Sep 2024 23:55:40 +0200 Subject: [PATCH 07/23] fnc_directCall and type --- addons/common/fnc_removePerFrameHandler.sqf | 2 +- .../common/fnc_updatePerFrameHandlerDelay.sqf | 26 +++++++++++++------ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/addons/common/fnc_removePerFrameHandler.sqf b/addons/common/fnc_removePerFrameHandler.sqf index bfc548da1..c6bebbc14 100644 --- a/addons/common/fnc_removePerFrameHandler.sqf +++ b/addons/common/fnc_removePerFrameHandler.sqf @@ -51,4 +51,4 @@ params [["_handle", -1, [0]]]; GVAR(perFrameHandlersToRemove) pushBackUnique _index; true -}, _handle] call CBA_fnc_directCall; +}, _handle] call CBA_fnc_directCall; \ No newline at end of file diff --git a/addons/common/fnc_updatePerFrameHandlerDelay.sqf b/addons/common/fnc_updatePerFrameHandlerDelay.sqf index 09bcf5673..a2e556ca9 100644 --- a/addons/common/fnc_updatePerFrameHandlerDelay.sqf +++ b/addons/common/fnc_updatePerFrameHandlerDelay.sqf @@ -8,6 +8,7 @@ Description: Parameters: _handle - The existing perFrameHandler's handle. _delay - The amount of time in seconds between executions, 0 for every frame. (optional, default: 0) + _updateExecutionTime - When true, adjusts the nextExecution time. Returns: true if successful, false otherwise @@ -21,14 +22,23 @@ Author: Mokka, OverlordZorn ---------------------------------------------------------------------------- */ -params [["_handle", -1, [0]], ["_newDelay", 0, [0]], ["_updateExectionTime", false, [false]]]; +params [["_handle", -1, [0]], ["_newDelay", 0, [0]], ["_updateExecutionTime", false, [false]]]; -private _idx = GVAR(PFHhandles) param [_handle]; -if (isNil "_idx") exitWith {false}; -(GVAR(perFrameHandlerArray) select _idx) set [1, _newDelay]; +[{ + params ["_handle", "_newDelay", "_updateExecutionTime"]; -if (_updateExectionTime) then { - // Add code here -}; + private _idx = GVAR(PFHhandles) param [_handle]; + if (isNil "_idx") exitWith {false}; + (GVAR(perFrameHandlerArray) select _idx) set [1, _newDelay]; -true \ No newline at end of file + if (_updateExecutionTime) then { + // Add code here + + + + + }; + + true + +}, [_handle, _newDelay, _updateExecutionTime]] call CBA_fnc_directCall; \ No newline at end of file From 469d975034a8fdf55720f383304fc333a12d7814 Mon Sep 17 00:00:00 2001 From: OverlordZorn <56258612+OverlordZorn@users.noreply.github.com> Date: Sun, 8 Sep 2024 00:24:37 +0200 Subject: [PATCH 08/23] Update fnc_removePerFrameHandler.sqf --- addons/common/fnc_removePerFrameHandler.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/fnc_removePerFrameHandler.sqf b/addons/common/fnc_removePerFrameHandler.sqf index c6bebbc14..bfc548da1 100644 --- a/addons/common/fnc_removePerFrameHandler.sqf +++ b/addons/common/fnc_removePerFrameHandler.sqf @@ -51,4 +51,4 @@ params [["_handle", -1, [0]]]; GVAR(perFrameHandlersToRemove) pushBackUnique _index; true -}, _handle] call CBA_fnc_directCall; \ No newline at end of file +}, _handle] call CBA_fnc_directCall; From 38a60cf8f88005e1eb97c487b32d26e0f0d4c6c3 Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Mon, 9 Sep 2024 15:23:51 +0200 Subject: [PATCH 09/23] _idx -> _index like fn_removePFH --- .hemtt/launch.toml | 18 +++ .hemtt/missions/Test.VR/mission.sqm | 106 ++++++++++++++++++ .hemtt/missions/~test.vr/mission.sqm | 106 ++++++++++++++++++ .../common/fnc_updatePerFrameHandlerDelay.sqf | 7 +- 4 files changed, 234 insertions(+), 3 deletions(-) create mode 100644 .hemtt/launch.toml create mode 100644 .hemtt/missions/Test.VR/mission.sqm create mode 100644 .hemtt/missions/~test.vr/mission.sqm diff --git a/.hemtt/launch.toml b/.hemtt/launch.toml new file mode 100644 index 000000000..b1bf1e06c --- /dev/null +++ b/.hemtt/launch.toml @@ -0,0 +1,18 @@ +[default] + +dlc = [] +optionals = [] + +parameters = [ + "-window", + "-noPause", + "-noPauseAudio", +] + +[VR] +extends = "default" +mission = "Test.VR" + +workshop = [ + "2369477168", # Advanced Developer Tools +] diff --git a/.hemtt/missions/Test.VR/mission.sqm b/.hemtt/missions/Test.VR/mission.sqm new file mode 100644 index 000000000..e23ee4b67 --- /dev/null +++ b/.hemtt/missions/Test.VR/mission.sqm @@ -0,0 +1,106 @@ +version=54; +class EditorData +{ + moveGridStep=1; + angleGridStep=0.2617994; + scaleGridStep=1; + autoGroupingDist=10; + toggles=1; + class ItemIDProvider + { + nextID=2; + }; + class Camera + { + pos[]={3452.834,15,5173.7622}; + dir[]={0.87962955,-0.45655856,-0.13348252}; + up[]={0.4513942,0.88969225,-0.068498358}; + aside[]={-0.15003183,5.2357791e-008,-0.98868757}; + }; +}; +binarizationWanted=0; +sourceName="test"; +addons[]= +{ + "A3_Characters_F", + "A3_Characters_F_Exp_Civil" +}; +class AddonsMetaData +{ + class List + { + items=2; + class Item0 + { + className="A3_Characters_F"; + name="Arma 3 Alpha - Characters and Clothing"; + author="Bohemia Interactive"; + url="https://www.arma3.com"; + }; + class Item1 + { + className="A3_Characters_F_Exp"; + name="Arma 3 Apex - Characters and Clothing"; + author="Bohemia Interactive"; + url="https://www.arma3.com"; + }; + }; +}; +randomSeed=424025; +class ScenarioData +{ + author="Overlord Zorn"; +}; +class Mission +{ + class Intel + { + timeOfChanges=1800.0002; + startWeather=0; + startWind=0.1; + startWaves=0.1; + forecastWeather=0; + forecastWind=0.1; + forecastWaves=0.1; + forecastLightnings=0.1; + year=2035; + day=28; + hour=13; + minute=37; + startFogDecay=0.014; + forecastFogDecay=0.014; + }; + class Entities + { + items=1; + class Item0 + { + dataType="Group"; + side="Civilian"; + class Entities + { + items=1; + class Item0 + { + dataType="Object"; + class PositionInfo + { + position[]={3471.9478,5.0014391,5168.0557}; + }; + side="Civilian"; + flags=7; + class Attributes + { + isPlayer=1; + }; + id=1; + type="C_man_1"; + }; + }; + class Attributes + { + }; + id=0; + }; + }; +}; diff --git a/.hemtt/missions/~test.vr/mission.sqm b/.hemtt/missions/~test.vr/mission.sqm new file mode 100644 index 000000000..8c4c2358a --- /dev/null +++ b/.hemtt/missions/~test.vr/mission.sqm @@ -0,0 +1,106 @@ +version=54; +class EditorData +{ + moveGridStep=1; + angleGridStep=0.2617994; + scaleGridStep=1; + autoGroupingDist=10; + toggles=1; + class ItemIDProvider + { + nextID=2; + }; + class Camera + { + pos[]={3452.834,15,5173.7622}; + dir[]={0.87962955,-0.45655856,-0.13348252}; + up[]={0.4513942,0.88969225,-0.068498358}; + aside[]={-0.15003183,5.2357791e-008,-0.98868757}; + }; +}; +binarizationWanted=0; +sourceName="~test"; +addons[]= +{ + "A3_Characters_F", + "A3_Characters_F_Exp_Civil" +}; +class AddonsMetaData +{ + class List + { + items=2; + class Item0 + { + className="A3_Characters_F"; + name="Arma 3 Alpha - Characters and Clothing"; + author="Bohemia Interactive"; + url="https://www.arma3.com"; + }; + class Item1 + { + className="A3_Characters_F_Exp"; + name="Arma 3 Apex - Characters and Clothing"; + author="Bohemia Interactive"; + url="https://www.arma3.com"; + }; + }; +}; +randomSeed=424025; +class ScenarioData +{ + author="Overlord Zorn"; +}; +class Mission +{ + class Intel + { + timeOfChanges=1800.0002; + startWeather=0; + startWind=0.1; + startWaves=0.1; + forecastWeather=0; + forecastWind=0.1; + forecastWaves=0.1; + forecastLightnings=0.1; + year=2035; + day=28; + hour=13; + minute=37; + startFogDecay=0.014; + forecastFogDecay=0.014; + }; + class Entities + { + items=1; + class Item0 + { + dataType="Group"; + side="Civilian"; + class Entities + { + items=1; + class Item0 + { + dataType="Object"; + class PositionInfo + { + position[]={3471.9478,5.0014391,5168.0557}; + }; + side="Civilian"; + flags=7; + class Attributes + { + isPlayer=1; + }; + id=1; + type="C_man_1"; + }; + }; + class Attributes + { + }; + id=0; + }; + }; +}; diff --git a/addons/common/fnc_updatePerFrameHandlerDelay.sqf b/addons/common/fnc_updatePerFrameHandlerDelay.sqf index a2e556ca9..8d416f93c 100644 --- a/addons/common/fnc_updatePerFrameHandlerDelay.sqf +++ b/addons/common/fnc_updatePerFrameHandlerDelay.sqf @@ -27,12 +27,13 @@ params [["_handle", -1, [0]], ["_newDelay", 0, [0]], ["_updateExecutionTime", fa [{ params ["_handle", "_newDelay", "_updateExecutionTime"]; - private _idx = GVAR(PFHhandles) param [_handle]; - if (isNil "_idx") exitWith {false}; - (GVAR(perFrameHandlerArray) select _idx) set [1, _newDelay]; + private _index = GVAR(PFHhandles) param [_handle]; + if (isNil "_index") exitWith {false}; + (GVAR(perFrameHandlerArray) select _index) set [1, _newDelay]; if (_updateExecutionTime) then { // Add code here + (GVAR(perFrameHandlerArray) select _index) set [1, _newDelay]; From e9648401ee6e4239c2e55a5b2acb827927720f83 Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Mon, 9 Sep 2024 15:24:04 +0200 Subject: [PATCH 10/23] Revert "_idx -> _index like fn_removePFH" This reverts commit 38a60cf8f88005e1eb97c487b32d26e0f0d4c6c3. --- .hemtt/launch.toml | 18 --- .hemtt/missions/Test.VR/mission.sqm | 106 ------------------ .hemtt/missions/~test.vr/mission.sqm | 106 ------------------ .../common/fnc_updatePerFrameHandlerDelay.sqf | 7 +- 4 files changed, 3 insertions(+), 234 deletions(-) delete mode 100644 .hemtt/launch.toml delete mode 100644 .hemtt/missions/Test.VR/mission.sqm delete mode 100644 .hemtt/missions/~test.vr/mission.sqm diff --git a/.hemtt/launch.toml b/.hemtt/launch.toml deleted file mode 100644 index b1bf1e06c..000000000 --- a/.hemtt/launch.toml +++ /dev/null @@ -1,18 +0,0 @@ -[default] - -dlc = [] -optionals = [] - -parameters = [ - "-window", - "-noPause", - "-noPauseAudio", -] - -[VR] -extends = "default" -mission = "Test.VR" - -workshop = [ - "2369477168", # Advanced Developer Tools -] diff --git a/.hemtt/missions/Test.VR/mission.sqm b/.hemtt/missions/Test.VR/mission.sqm deleted file mode 100644 index e23ee4b67..000000000 --- a/.hemtt/missions/Test.VR/mission.sqm +++ /dev/null @@ -1,106 +0,0 @@ -version=54; -class EditorData -{ - moveGridStep=1; - angleGridStep=0.2617994; - scaleGridStep=1; - autoGroupingDist=10; - toggles=1; - class ItemIDProvider - { - nextID=2; - }; - class Camera - { - pos[]={3452.834,15,5173.7622}; - dir[]={0.87962955,-0.45655856,-0.13348252}; - up[]={0.4513942,0.88969225,-0.068498358}; - aside[]={-0.15003183,5.2357791e-008,-0.98868757}; - }; -}; -binarizationWanted=0; -sourceName="test"; -addons[]= -{ - "A3_Characters_F", - "A3_Characters_F_Exp_Civil" -}; -class AddonsMetaData -{ - class List - { - items=2; - class Item0 - { - className="A3_Characters_F"; - name="Arma 3 Alpha - Characters and Clothing"; - author="Bohemia Interactive"; - url="https://www.arma3.com"; - }; - class Item1 - { - className="A3_Characters_F_Exp"; - name="Arma 3 Apex - Characters and Clothing"; - author="Bohemia Interactive"; - url="https://www.arma3.com"; - }; - }; -}; -randomSeed=424025; -class ScenarioData -{ - author="Overlord Zorn"; -}; -class Mission -{ - class Intel - { - timeOfChanges=1800.0002; - startWeather=0; - startWind=0.1; - startWaves=0.1; - forecastWeather=0; - forecastWind=0.1; - forecastWaves=0.1; - forecastLightnings=0.1; - year=2035; - day=28; - hour=13; - minute=37; - startFogDecay=0.014; - forecastFogDecay=0.014; - }; - class Entities - { - items=1; - class Item0 - { - dataType="Group"; - side="Civilian"; - class Entities - { - items=1; - class Item0 - { - dataType="Object"; - class PositionInfo - { - position[]={3471.9478,5.0014391,5168.0557}; - }; - side="Civilian"; - flags=7; - class Attributes - { - isPlayer=1; - }; - id=1; - type="C_man_1"; - }; - }; - class Attributes - { - }; - id=0; - }; - }; -}; diff --git a/.hemtt/missions/~test.vr/mission.sqm b/.hemtt/missions/~test.vr/mission.sqm deleted file mode 100644 index 8c4c2358a..000000000 --- a/.hemtt/missions/~test.vr/mission.sqm +++ /dev/null @@ -1,106 +0,0 @@ -version=54; -class EditorData -{ - moveGridStep=1; - angleGridStep=0.2617994; - scaleGridStep=1; - autoGroupingDist=10; - toggles=1; - class ItemIDProvider - { - nextID=2; - }; - class Camera - { - pos[]={3452.834,15,5173.7622}; - dir[]={0.87962955,-0.45655856,-0.13348252}; - up[]={0.4513942,0.88969225,-0.068498358}; - aside[]={-0.15003183,5.2357791e-008,-0.98868757}; - }; -}; -binarizationWanted=0; -sourceName="~test"; -addons[]= -{ - "A3_Characters_F", - "A3_Characters_F_Exp_Civil" -}; -class AddonsMetaData -{ - class List - { - items=2; - class Item0 - { - className="A3_Characters_F"; - name="Arma 3 Alpha - Characters and Clothing"; - author="Bohemia Interactive"; - url="https://www.arma3.com"; - }; - class Item1 - { - className="A3_Characters_F_Exp"; - name="Arma 3 Apex - Characters and Clothing"; - author="Bohemia Interactive"; - url="https://www.arma3.com"; - }; - }; -}; -randomSeed=424025; -class ScenarioData -{ - author="Overlord Zorn"; -}; -class Mission -{ - class Intel - { - timeOfChanges=1800.0002; - startWeather=0; - startWind=0.1; - startWaves=0.1; - forecastWeather=0; - forecastWind=0.1; - forecastWaves=0.1; - forecastLightnings=0.1; - year=2035; - day=28; - hour=13; - minute=37; - startFogDecay=0.014; - forecastFogDecay=0.014; - }; - class Entities - { - items=1; - class Item0 - { - dataType="Group"; - side="Civilian"; - class Entities - { - items=1; - class Item0 - { - dataType="Object"; - class PositionInfo - { - position[]={3471.9478,5.0014391,5168.0557}; - }; - side="Civilian"; - flags=7; - class Attributes - { - isPlayer=1; - }; - id=1; - type="C_man_1"; - }; - }; - class Attributes - { - }; - id=0; - }; - }; -}; diff --git a/addons/common/fnc_updatePerFrameHandlerDelay.sqf b/addons/common/fnc_updatePerFrameHandlerDelay.sqf index 8d416f93c..a2e556ca9 100644 --- a/addons/common/fnc_updatePerFrameHandlerDelay.sqf +++ b/addons/common/fnc_updatePerFrameHandlerDelay.sqf @@ -27,13 +27,12 @@ params [["_handle", -1, [0]], ["_newDelay", 0, [0]], ["_updateExecutionTime", fa [{ params ["_handle", "_newDelay", "_updateExecutionTime"]; - private _index = GVAR(PFHhandles) param [_handle]; - if (isNil "_index") exitWith {false}; - (GVAR(perFrameHandlerArray) select _index) set [1, _newDelay]; + private _idx = GVAR(PFHhandles) param [_handle]; + if (isNil "_idx") exitWith {false}; + (GVAR(perFrameHandlerArray) select _idx) set [1, _newDelay]; if (_updateExecutionTime) then { // Add code here - (GVAR(perFrameHandlerArray) select _index) set [1, _newDelay]; From dd89444e7052c95662f98defea4b61bbba1b8011 Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Mon, 9 Sep 2024 15:26:31 +0200 Subject: [PATCH 11/23] idx -> index alike removePFH.sqf --- addons/common/fnc_updatePerFrameHandlerDelay.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/common/fnc_updatePerFrameHandlerDelay.sqf b/addons/common/fnc_updatePerFrameHandlerDelay.sqf index a2e556ca9..133f53501 100644 --- a/addons/common/fnc_updatePerFrameHandlerDelay.sqf +++ b/addons/common/fnc_updatePerFrameHandlerDelay.sqf @@ -27,9 +27,9 @@ params [["_handle", -1, [0]], ["_newDelay", 0, [0]], ["_updateExecutionTime", fa [{ params ["_handle", "_newDelay", "_updateExecutionTime"]; - private _idx = GVAR(PFHhandles) param [_handle]; - if (isNil "_idx") exitWith {false}; - (GVAR(perFrameHandlerArray) select _idx) set [1, _newDelay]; + private _index = GVAR(PFHhandles) param [_handle]; + if (isNil "_index") exitWith {false}; + (GVAR(perFrameHandlerArray) select _index) set [1, _newDelay]; if (_updateExecutionTime) then { // Add code here From 42d0f5f5d6bec3a4a9da1aaf0ad821dea8e3557a Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Mon, 9 Sep 2024 15:42:07 +0200 Subject: [PATCH 12/23] updates the current executionTime --- addons/common/fnc_updatePerFrameHandlerDelay.sqf | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/addons/common/fnc_updatePerFrameHandlerDelay.sqf b/addons/common/fnc_updatePerFrameHandlerDelay.sqf index 133f53501..e8f0520f9 100644 --- a/addons/common/fnc_updatePerFrameHandlerDelay.sqf +++ b/addons/common/fnc_updatePerFrameHandlerDelay.sqf @@ -29,14 +29,12 @@ params [["_handle", -1, [0]], ["_newDelay", 0, [0]], ["_updateExecutionTime", fa private _index = GVAR(PFHhandles) param [_handle]; if (isNil "_index") exitWith {false}; - (GVAR(perFrameHandlerArray) select _index) set [1, _newDelay]; + private _entry = GVAR(perFrameHandlerArray) select _index; + private _prevDelay = _entry select 1; + _entry set [1, _newDelay]; if (_updateExecutionTime) then { - // Add code here - - - - + _entry set [2, _entry#2 - prevDelay + _newDelay]; }; true From bf87d7ac8bcadde86689a37bcfb6078495d5d0d0 Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Mon, 9 Sep 2024 16:42:39 +0200 Subject: [PATCH 13/23] testmisison --- .hemtt/launch.toml | 18 +++++ .hemtt/missions/Test.VR/init.sqf | 23 ++++++ .hemtt/missions/Test.VR/mission.sqm | 106 ++++++++++++++++++++++++++++ 3 files changed, 147 insertions(+) create mode 100644 .hemtt/launch.toml create mode 100644 .hemtt/missions/Test.VR/init.sqf create mode 100644 .hemtt/missions/Test.VR/mission.sqm diff --git a/.hemtt/launch.toml b/.hemtt/launch.toml new file mode 100644 index 000000000..e81dfb16a --- /dev/null +++ b/.hemtt/launch.toml @@ -0,0 +1,18 @@ +[default] + +dlc = [] +optionals = [] + +parameters = [ + "-window", + "-noPause", + "-noPauseAudio", +] + +[VR] +extends = "default" +mission = "Test.VR" + +workshop = [ + "2369477168", # Advanced Developer Tools +] \ No newline at end of file diff --git a/.hemtt/missions/Test.VR/init.sqf b/.hemtt/missions/Test.VR/init.sqf new file mode 100644 index 000000000..12ef55532 --- /dev/null +++ b/.hemtt/missions/Test.VR/init.sqf @@ -0,0 +1,23 @@ +[ { + private _delay = 1; + private _codeToRun = { diag_log format ["Loop: %1", diag_tickTime] }; + + diag_log format ['[CVO](debug)(TEST Start) _delay %2 - diag_tickTime: %1', diag_tickTime, _delay]; + + private _handle = [_codeToRun, _delay, []] call CBA_fnc_addPerFrameHandler; + + [ { + [_this#0, 10, true] call CBA_fnc_updatePerFrameHandlerDelay; + } , [_handle], 7] call CBA_fnc_waitAndExecute; + + + [ { + [_this#0, 2, true] call CBA_fnc_updatePerFrameHandlerDelay; + } , [_handle], 30] call CBA_fnc_waitAndExecute; + + [ { + [_this#0] call CBA_fnc_removePerFrameHandler; + diag_log format ['[CVO](debug)(Test Stopped)diag_tickTime: %1', diag_tickTime]; + } , [_handle], 45] call CBA_fnc_waitAndExecute; + +} , [], 5] call CBA_fnc_waitAndExecute; \ No newline at end of file diff --git a/.hemtt/missions/Test.VR/mission.sqm b/.hemtt/missions/Test.VR/mission.sqm new file mode 100644 index 000000000..6208eb5ef --- /dev/null +++ b/.hemtt/missions/Test.VR/mission.sqm @@ -0,0 +1,106 @@ +version=54; +class EditorData +{ + moveGridStep=1; + angleGridStep=0.2617994; + scaleGridStep=1; + autoGroupingDist=10; + toggles=1; + class ItemIDProvider + { + nextID=2; + }; + class Camera + { + pos[]={3452.834,15,5173.7622}; + dir[]={0.87962955,-0.45655856,-0.13348252}; + up[]={0.4513942,0.88969225,-0.068498358}; + aside[]={-0.15003183,5.2357791e-008,-0.98868757}; + }; +}; +binarizationWanted=0; +sourceName="test"; +addons[]= +{ + "A3_Characters_F", + "A3_Characters_F_Exp_Civil" +}; +class AddonsMetaData +{ + class List + { + items=2; + class Item0 + { + className="A3_Characters_F"; + name="Arma 3 Alpha - Characters and Clothing"; + author="Bohemia Interactive"; + url="https://www.arma3.com"; + }; + class Item1 + { + className="A3_Characters_F_Exp"; + name="Arma 3 Apex - Characters and Clothing"; + author="Bohemia Interactive"; + url="https://www.arma3.com"; + }; + }; +}; +randomSeed=424025; +class ScenarioData +{ + author="Overlord Zorn"; +}; +class Mission +{ + class Intel + { + timeOfChanges=1800.0002; + startWeather=0; + startWind=0.1; + startWaves=0.1; + forecastWeather=0; + forecastWind=0.1; + forecastWaves=0.1; + forecastLightnings=0.1; + year=2035; + day=28; + hour=13; + minute=37; + startFogDecay=0.014; + forecastFogDecay=0.014; + }; + class Entities + { + items=1; + class Item0 + { + dataType="Group"; + side="Civilian"; + class Entities + { + items=1; + class Item0 + { + dataType="Object"; + class PositionInfo + { + position[]={3471.9478,5.0014391,5168.0557}; + }; + side="Civilian"; + flags=7; + class Attributes + { + isPlayer=1; + }; + id=1; + type="C_man_1"; + }; + }; + class Attributes + { + }; + id=0; + }; + }; +}; \ No newline at end of file From a43ed7e24b1a3bef664ebdc7b4b5f198bd25ebdd Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Mon, 9 Sep 2024 16:42:47 +0200 Subject: [PATCH 14/23] Update fnc_updatePerFrameHandlerDelay.sqf --- .../common/fnc_updatePerFrameHandlerDelay.sqf | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/addons/common/fnc_updatePerFrameHandlerDelay.sqf b/addons/common/fnc_updatePerFrameHandlerDelay.sqf index e8f0520f9..64b8657da 100644 --- a/addons/common/fnc_updatePerFrameHandlerDelay.sqf +++ b/addons/common/fnc_updatePerFrameHandlerDelay.sqf @@ -8,7 +8,7 @@ Description: Parameters: _handle - The existing perFrameHandler's handle. _delay - The amount of time in seconds between executions, 0 for every frame. (optional, default: 0) - _updateExecutionTime - When true, adjusts the nextExecution time. + _updateExecutionTime - When true, adjusts the nextExecution time. (optional, default: true) Returns: true if successful, false otherwise @@ -22,7 +22,7 @@ Author: Mokka, OverlordZorn ---------------------------------------------------------------------------- */ -params [["_handle", -1, [0]], ["_newDelay", 0, [0]], ["_updateExecutionTime", false, [false]]]; +params [["_handle", -1, [0]], ["_newDelay", 0, [0]], ["_updateExecutionTime", true, [false]]]; [{ params ["_handle", "_newDelay", "_updateExecutionTime"]; @@ -30,13 +30,21 @@ params [["_handle", -1, [0]], ["_newDelay", 0, [0]], ["_updateExecutionTime", fa private _index = GVAR(PFHhandles) param [_handle]; if (isNil "_index") exitWith {false}; private _entry = GVAR(perFrameHandlerArray) select _index; - private _prevDelay = _entry select 1; + private _prvDelay = _entry#1; _entry set [1, _newDelay]; if (_updateExecutionTime) then { - _entry set [2, _entry#2 - prevDelay + _newDelay]; - }; + _newDelta = _entry#2 - _prvDelay + _newDelay; + + private _tickTime = diag_tickTime; + + if (_newDelta < _tickTime) then { _newDelta = _tickTime; }; + _prvDelta = _entry#2; + _entry set [2, _newDelta]; + + diag_log format ['[CVO](debug)(fnc_updatePerFrameHandlerDelay) _prvDelay: %1 - _newDelay: %2 - _prvDelta: %5 - _newDelta: %3 - _tickTime: %4', _prvDelay , _newDelay , _newDelta , _tickTime, _prvDelta]; + }; true }, [_handle, _newDelay, _updateExecutionTime]] call CBA_fnc_directCall; \ No newline at end of file From 61f257af2476a43917d0b011a513b3e8ed90326a Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Mon, 9 Sep 2024 16:48:53 +0200 Subject: [PATCH 15/23] removed Debug Lines --- addons/common/fnc_updatePerFrameHandlerDelay.sqf | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/addons/common/fnc_updatePerFrameHandlerDelay.sqf b/addons/common/fnc_updatePerFrameHandlerDelay.sqf index 64b8657da..e4382443a 100644 --- a/addons/common/fnc_updatePerFrameHandlerDelay.sqf +++ b/addons/common/fnc_updatePerFrameHandlerDelay.sqf @@ -34,16 +34,12 @@ params [["_handle", -1, [0]], ["_newDelay", 0, [0]], ["_updateExecutionTime", tr _entry set [1, _newDelay]; if (_updateExecutionTime) then { - _newDelta = _entry#2 - _prvDelay + _newDelay; - + private _newDelta = _entry#2 - _prvDelay + _newDelay; private _tickTime = diag_tickTime; + // if the next iteration Time with the updated delay would have been in the past, next iteration will be set to "now" so the following iteration will respect the new delay between iterations if (_newDelta < _tickTime) then { _newDelta = _tickTime; }; - - _prvDelta = _entry#2; _entry set [2, _newDelta]; - - diag_log format ['[CVO](debug)(fnc_updatePerFrameHandlerDelay) _prvDelay: %1 - _newDelay: %2 - _prvDelta: %5 - _newDelta: %3 - _tickTime: %4', _prvDelay , _newDelay , _newDelta , _tickTime, _prvDelta]; }; true From 0fd482d0df93879ba1554af5d3d350f85a5129d1 Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Mon, 9 Sep 2024 16:49:24 +0200 Subject: [PATCH 16/23] remove test environment --- .hemtt/launch.toml | 18 ----- .hemtt/missions/Test.VR/init.sqf | 23 ------ .hemtt/missions/Test.VR/mission.sqm | 106 ---------------------------- 3 files changed, 147 deletions(-) delete mode 100644 .hemtt/launch.toml delete mode 100644 .hemtt/missions/Test.VR/init.sqf delete mode 100644 .hemtt/missions/Test.VR/mission.sqm diff --git a/.hemtt/launch.toml b/.hemtt/launch.toml deleted file mode 100644 index e81dfb16a..000000000 --- a/.hemtt/launch.toml +++ /dev/null @@ -1,18 +0,0 @@ -[default] - -dlc = [] -optionals = [] - -parameters = [ - "-window", - "-noPause", - "-noPauseAudio", -] - -[VR] -extends = "default" -mission = "Test.VR" - -workshop = [ - "2369477168", # Advanced Developer Tools -] \ No newline at end of file diff --git a/.hemtt/missions/Test.VR/init.sqf b/.hemtt/missions/Test.VR/init.sqf deleted file mode 100644 index 12ef55532..000000000 --- a/.hemtt/missions/Test.VR/init.sqf +++ /dev/null @@ -1,23 +0,0 @@ -[ { - private _delay = 1; - private _codeToRun = { diag_log format ["Loop: %1", diag_tickTime] }; - - diag_log format ['[CVO](debug)(TEST Start) _delay %2 - diag_tickTime: %1', diag_tickTime, _delay]; - - private _handle = [_codeToRun, _delay, []] call CBA_fnc_addPerFrameHandler; - - [ { - [_this#0, 10, true] call CBA_fnc_updatePerFrameHandlerDelay; - } , [_handle], 7] call CBA_fnc_waitAndExecute; - - - [ { - [_this#0, 2, true] call CBA_fnc_updatePerFrameHandlerDelay; - } , [_handle], 30] call CBA_fnc_waitAndExecute; - - [ { - [_this#0] call CBA_fnc_removePerFrameHandler; - diag_log format ['[CVO](debug)(Test Stopped)diag_tickTime: %1', diag_tickTime]; - } , [_handle], 45] call CBA_fnc_waitAndExecute; - -} , [], 5] call CBA_fnc_waitAndExecute; \ No newline at end of file diff --git a/.hemtt/missions/Test.VR/mission.sqm b/.hemtt/missions/Test.VR/mission.sqm deleted file mode 100644 index 6208eb5ef..000000000 --- a/.hemtt/missions/Test.VR/mission.sqm +++ /dev/null @@ -1,106 +0,0 @@ -version=54; -class EditorData -{ - moveGridStep=1; - angleGridStep=0.2617994; - scaleGridStep=1; - autoGroupingDist=10; - toggles=1; - class ItemIDProvider - { - nextID=2; - }; - class Camera - { - pos[]={3452.834,15,5173.7622}; - dir[]={0.87962955,-0.45655856,-0.13348252}; - up[]={0.4513942,0.88969225,-0.068498358}; - aside[]={-0.15003183,5.2357791e-008,-0.98868757}; - }; -}; -binarizationWanted=0; -sourceName="test"; -addons[]= -{ - "A3_Characters_F", - "A3_Characters_F_Exp_Civil" -}; -class AddonsMetaData -{ - class List - { - items=2; - class Item0 - { - className="A3_Characters_F"; - name="Arma 3 Alpha - Characters and Clothing"; - author="Bohemia Interactive"; - url="https://www.arma3.com"; - }; - class Item1 - { - className="A3_Characters_F_Exp"; - name="Arma 3 Apex - Characters and Clothing"; - author="Bohemia Interactive"; - url="https://www.arma3.com"; - }; - }; -}; -randomSeed=424025; -class ScenarioData -{ - author="Overlord Zorn"; -}; -class Mission -{ - class Intel - { - timeOfChanges=1800.0002; - startWeather=0; - startWind=0.1; - startWaves=0.1; - forecastWeather=0; - forecastWind=0.1; - forecastWaves=0.1; - forecastLightnings=0.1; - year=2035; - day=28; - hour=13; - minute=37; - startFogDecay=0.014; - forecastFogDecay=0.014; - }; - class Entities - { - items=1; - class Item0 - { - dataType="Group"; - side="Civilian"; - class Entities - { - items=1; - class Item0 - { - dataType="Object"; - class PositionInfo - { - position[]={3471.9478,5.0014391,5168.0557}; - }; - side="Civilian"; - flags=7; - class Attributes - { - isPlayer=1; - }; - id=1; - type="C_man_1"; - }; - }; - class Attributes - { - }; - id=0; - }; - }; -}; \ No newline at end of file From 6627b5e4f419c8646bcc1df5daf88853b9b57fa3 Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Mon, 9 Sep 2024 17:07:18 +0200 Subject: [PATCH 17/23] remove _updateExecutionTime param having this as an optional parameter doesnt seem neccessary anymore --- addons/common/fnc_updatePerFrameHandlerDelay.sqf | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/addons/common/fnc_updatePerFrameHandlerDelay.sqf b/addons/common/fnc_updatePerFrameHandlerDelay.sqf index e4382443a..10489cba7 100644 --- a/addons/common/fnc_updatePerFrameHandlerDelay.sqf +++ b/addons/common/fnc_updatePerFrameHandlerDelay.sqf @@ -8,7 +8,6 @@ Description: Parameters: _handle - The existing perFrameHandler's handle. _delay - The amount of time in seconds between executions, 0 for every frame. (optional, default: 0) - _updateExecutionTime - When true, adjusts the nextExecution time. (optional, default: true) Returns: true if successful, false otherwise @@ -22,7 +21,7 @@ Author: Mokka, OverlordZorn ---------------------------------------------------------------------------- */ -params [["_handle", -1, [0]], ["_newDelay", 0, [0]], ["_updateExecutionTime", true, [false]]]; +params [["_handle", -1, [0]], ["_newDelay", 0, [0]]]; [{ params ["_handle", "_newDelay", "_updateExecutionTime"]; @@ -33,14 +32,13 @@ params [["_handle", -1, [0]], ["_newDelay", 0, [0]], ["_updateExecutionTime", tr private _prvDelay = _entry#1; _entry set [1, _newDelay]; - if (_updateExecutionTime) then { - private _newDelta = _entry#2 - _prvDelay + _newDelay; - private _tickTime = diag_tickTime; + private _newDelta = _entry#2 - _prvDelay + _newDelay; + private _tickTime = diag_tickTime; + + // if the next iteration Time with the updated delay would have been in the past, next iteration will be set to "now" so the following iteration will respect the new delay between iterations + if (_newDelta < _tickTime) then { _newDelta = _tickTime; }; + _entry set [2, _newDelta]; - // if the next iteration Time with the updated delay would have been in the past, next iteration will be set to "now" so the following iteration will respect the new delay between iterations - if (_newDelta < _tickTime) then { _newDelta = _tickTime; }; - _entry set [2, _newDelta]; - }; true }, [_handle, _newDelay, _updateExecutionTime]] call CBA_fnc_directCall; \ No newline at end of file From d3ff94fd12234475b5c995c103a0191b6ec507dd Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Mon, 9 Sep 2024 17:13:06 +0200 Subject: [PATCH 18/23] missed a _updateExecutionTime - removed --- addons/common/fnc_updatePerFrameHandlerDelay.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/fnc_updatePerFrameHandlerDelay.sqf b/addons/common/fnc_updatePerFrameHandlerDelay.sqf index 10489cba7..d401a8137 100644 --- a/addons/common/fnc_updatePerFrameHandlerDelay.sqf +++ b/addons/common/fnc_updatePerFrameHandlerDelay.sqf @@ -24,7 +24,7 @@ Author: params [["_handle", -1, [0]], ["_newDelay", 0, [0]]]; [{ - params ["_handle", "_newDelay", "_updateExecutionTime"]; + params ["_handle", "_newDelay"]; private _index = GVAR(PFHhandles) param [_handle]; if (isNil "_index") exitWith {false}; From 0e1ed4aa970778e244e1a633a9817c8c198c3194 Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Mon, 9 Sep 2024 17:37:00 +0200 Subject: [PATCH 19/23] Update CfgFunctions.hpp --- addons/common/CfgFunctions.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/common/CfgFunctions.hpp b/addons/common/CfgFunctions.hpp index 04aca6137..9a39402a7 100644 --- a/addons/common/CfgFunctions.hpp +++ b/addons/common/CfgFunctions.hpp @@ -122,6 +122,7 @@ class CfgFunctions { PATHTO_FNC(addPerFrameHandler); PATHTO_FNC(removePerFrameHandler); PATHTO_FNC(updatePerFrameHandlerDelay); + PATHTO_FNC(getPerFrameHandlerDelay); PATHTO_FNC(createPerFrameHandlerObject); PATHTO_FNC(deletePerFrameHandlerObject); PATHTO_FNC(addPlayerAction); From 8c80b94bd73cbd81255cf5ba4386f5f465d2e75a Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Mon, 9 Sep 2024 17:37:06 +0200 Subject: [PATCH 20/23] Create fnc_getPerFrameHandlerDelay.sqf --- addons/common/fnc_getPerFrameHandlerDelay.sqf | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 addons/common/fnc_getPerFrameHandlerDelay.sqf diff --git a/addons/common/fnc_getPerFrameHandlerDelay.sqf b/addons/common/fnc_getPerFrameHandlerDelay.sqf new file mode 100644 index 000000000..467d8e187 --- /dev/null +++ b/addons/common/fnc_getPerFrameHandlerDelay.sqf @@ -0,0 +1,33 @@ +#include "script_component.hpp" +/* ---------------------------------------------------------------------------- +Function: CBA_fnc_getPerFrameHandlerDelay + +Description: + Returns the current delay of an existing perFrameHandler. + +Parameters: + _handle - The existing perFrameHandler's handle. + +Returns: + _return current Delay of perFrameHandler. Will return -1 if failed. + +Examples: + (begin example) + _currentDelay = [_handle] call CBA_fnc_getPerFrameHandlerDelay; + (end) + +Author: + Mokka, OverlordZorn +---------------------------------------------------------------------------- */ + +params [["_handle", -1, [0]]]; + +[{ + params ["_handle"]; + + private _index = GVAR(PFHhandles) param [_handle]; + if (isNil "_index") exitWith {-1}; + private _entry = GVAR(perFrameHandlerArray) select _index; + _entry#1 + +}, [_handle]] call CBA_fnc_directCall; \ No newline at end of file From 163056a24c0e1918c1e144a37511d47eafe76850 Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Mon, 9 Sep 2024 17:38:45 +0200 Subject: [PATCH 21/23] another overlooked _updateExecutionTime --- addons/common/fnc_updatePerFrameHandlerDelay.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/fnc_updatePerFrameHandlerDelay.sqf b/addons/common/fnc_updatePerFrameHandlerDelay.sqf index d401a8137..b101212ff 100644 --- a/addons/common/fnc_updatePerFrameHandlerDelay.sqf +++ b/addons/common/fnc_updatePerFrameHandlerDelay.sqf @@ -41,4 +41,4 @@ params [["_handle", -1, [0]], ["_newDelay", 0, [0]]]; true -}, [_handle, _newDelay, _updateExecutionTime]] call CBA_fnc_directCall; \ No newline at end of file +}, [_handle, _newDelay]] call CBA_fnc_directCall; \ No newline at end of file From f32d8c320c85f06e3037d79362459b11d567d77b Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" Date: Mon, 9 Sep 2024 23:46:46 +0200 Subject: [PATCH 22/23] Update fnc_getPerFrameHandlerDelay.sqf --- addons/common/fnc_getPerFrameHandlerDelay.sqf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/common/fnc_getPerFrameHandlerDelay.sqf b/addons/common/fnc_getPerFrameHandlerDelay.sqf index 467d8e187..3e5cbaa16 100644 --- a/addons/common/fnc_getPerFrameHandlerDelay.sqf +++ b/addons/common/fnc_getPerFrameHandlerDelay.sqf @@ -27,7 +27,6 @@ params [["_handle", -1, [0]]]; private _index = GVAR(PFHhandles) param [_handle]; if (isNil "_index") exitWith {-1}; - private _entry = GVAR(perFrameHandlerArray) select _index; - _entry#1 + GVAR(perFrameHandlerArray) select _index select 1 }, [_handle]] call CBA_fnc_directCall; \ No newline at end of file From 6a305bd21324a397c66ad9c4a3040dfef95c2413 Mon Sep 17 00:00:00 2001 From: OverlordZorn <56258612+OverlordZorn@users.noreply.github.com> Date: Mon, 16 Sep 2024 18:26:52 +0200 Subject: [PATCH 23/23] updated description in header --- addons/common/fnc_updatePerFrameHandlerDelay.sqf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/common/fnc_updatePerFrameHandlerDelay.sqf b/addons/common/fnc_updatePerFrameHandlerDelay.sqf index b101212ff..0bc756e88 100644 --- a/addons/common/fnc_updatePerFrameHandlerDelay.sqf +++ b/addons/common/fnc_updatePerFrameHandlerDelay.sqf @@ -5,6 +5,8 @@ Function: CBA_fnc_updatePerFrameHandlerDelay Description: Updates the delay of an existing perFrameHandler. + If the new delay is shorter then the previous delay and the next iteration would have happend in the past, it will execute now and the following iteration will be executed based on current time + new delay. + Parameters: _handle - The existing perFrameHandler's handle. _delay - The amount of time in seconds between executions, 0 for every frame. (optional, default: 0)