From 0511dcdb421fee670de608fc19c0b9a5b80513e7 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Sun, 24 Apr 2016 18:18:39 -0400 Subject: [PATCH] Change R3F overburden to force slow move Better solution than knock out or break legs. See issue #1145 --- CHANGE LOG 1.0.6.txt | 2 +- .../R3F_Realism/R3F_Tired/R3F_DoTired.sqf | 6 ++-- .../R3F_Realism/R3F_Tired/R3F_Tired_Fnct.sqf | 32 ++++++++++++++----- .../R3F_Realism/R3F_Tired/R3F_Tired_Init.sqf | 1 - 4 files changed, 27 insertions(+), 14 deletions(-) diff --git a/CHANGE LOG 1.0.6.txt b/CHANGE LOG 1.0.6.txt index eab3a5018..5162d25f6 100644 --- a/CHANGE LOG 1.0.6.txt +++ b/CHANGE LOG 1.0.6.txt @@ -42,7 +42,7 @@ [CHANGED] Several getPosATL changed to call FNC_GetPos for water compatibility @icomrade [CHANGED] Trader city objects are now spawned locally on each machine with simulation disabled for better performance. Admins can still override with custom cities in init.sqf. @ebaydayz [CHANGED] Player zombies are no longer attacked by other zombies. The respawn button is now enabled for them if they wish to suicide. @ebaydayz -[CHANGED] When R3Fweight is enabled overburdened players now get their legs broken instead of being knocked out. The scream was also removed. #1145 @ebaydayz +[CHANGED] With R3Fweight on overburdened players are now forced to move slowly instead of being knocked out. The scream was also removed. #1145 @icomrade @ebaydayz [FIXED] Zombies now target and attack players correctly with 1.8.7 code [FIXED] Server position sync bug after falling unconscious #1522 @ebaydayz diff --git a/SQF/dayz_code/external/R3F_Realism/R3F_Tired/R3F_DoTired.sqf b/SQF/dayz_code/external/R3F_Realism/R3F_Tired/R3F_DoTired.sqf index 8f22350cb..53ccaf894 100644 --- a/SQF/dayz_code/external/R3F_Realism/R3F_Tired/R3F_DoTired.sqf +++ b/SQF/dayz_code/external/R3F_Realism/R3F_Tired/R3F_DoTired.sqf @@ -87,10 +87,8 @@ while {true} do { #endif [_level] call R3F_TIRED_FNCT_Voile_Noir; - - if (R3F_TIRED_Accumulator > R3F_TIRED_BLACKOUT_LEVEL && scriptDone R3F_TIRED_Handle_Blur_Effect) then { - call R3F_TIRED_FNCT_DoBlackVanish; - }; + if (R3F_Weight < 150) then {R3F_TIRED_Accumulator = 0;}; // Reset if player drops most of their gear, so overburden doesn't get stuck on for several minutes after carrying way too much weight. + if (R3F_TIRED_Accumulator > R3F_TIRED_BLACKOUT_LEVEL) then { call R3F_TIRED_FNCT_Overburdened; }; } else { R3F_TIRED_Accumulator = 0; }; diff --git a/SQF/dayz_code/external/R3F_Realism/R3F_Tired/R3F_Tired_Fnct.sqf b/SQF/dayz_code/external/R3F_Realism/R3F_Tired/R3F_Tired_Fnct.sqf index 4528f34b3..d9baaa9bc 100644 --- a/SQF/dayz_code/external/R3F_Realism/R3F_Tired/R3F_Tired_Fnct.sqf +++ b/SQF/dayz_code/external/R3F_Realism/R3F_Tired/R3F_Tired_Fnct.sqf @@ -20,13 +20,29 @@ R3F_TIRED_FNCT_Voile_Noir = { playSound "heartbeat_1"; addCamShake [2, 1, 25]; }; - -}; -R3F_TIRED_FNCT_DoBlackVanish = { - if (!r_fracture_legs) then { - player setHit["legs",1]; - r_fracture_legs = true; - }; - localize "STR_R3F_WEIGHT_Overburdened" call dayz_rollingMessages; }; +R3F_TIRED_ForceWalk = false; + +R3F_TIRED_FNCT_Overburdened = { + localize "STR_R3F_WEIGHT_Overburdened" call dayz_rollingMessages; + + if (!R3F_TIRED_ForceWalk) then { + R3F_TIRED_ForceWalk = true; + [] spawn { + private "_vel"; + while {R3F_TIRED_Accumulator > R3F_TIRED_BLACKOUT_LEVEL} do { + if (vehicle player == player) then { + _vel = velocity player; + //walk 6.7, slow walk 3.98, run 19.8, backwards run -13.16, sprint 23.15, fast swim 3.78, fast crouch 13.14, slow crouch 4.69, fast crawl 3.25, slow crawl 1.8, side strafe 9.8 + if (speed player > 6.8) then { + player setVelocity [-(_vel select 0),-(_vel select 1),_vel select 2]; + }; + }; + uiSleep 0.001; + }; + R3F_TIRED_ForceWalk = false; + cutText ["","PLAIN DOWN"]; // Clear overburdened message + }; + }; +}; \ No newline at end of file diff --git a/SQF/dayz_code/external/R3F_Realism/R3F_Tired/R3F_Tired_Init.sqf b/SQF/dayz_code/external/R3F_Realism/R3F_Tired/R3F_Tired_Init.sqf index aada5dbdc..81d957d88 100644 --- a/SQF/dayz_code/external/R3F_Realism/R3F_Tired/R3F_Tired_Init.sqf +++ b/SQF/dayz_code/external/R3F_Realism/R3F_Tired/R3F_Tired_Init.sqf @@ -16,7 +16,6 @@ R3F_Weight = 0; R3F_TIRED_Ratio_Position = 0; R3F_TIRED_Accumulator = 0; -R3F_TIRED_Handle_Blur_Effect = [] spawn {}; R3F_TIRED_Counter_Time = 0; R3F_TIRED_Ratio_Recovery = R3F_TIRED_RATIO_RECOVERING; R3F_TIRED_Ratio_Overweight = 1;