From 72abb093a3e10a54382f2650d5f1a79025907229 Mon Sep 17 00:00:00 2001 From: A Man Date: Tue, 31 Aug 2021 18:10:05 +0200 Subject: [PATCH] Re-write bloodsucker invisible animation process setVehicleInit does not work correctly. rSETOBJECTTEXTURE is the only way to sync it for all clients fast enough. Also player_zombieCheck cannot handle the invisible part to the bloodsucker attack since all other players which got not attacked interrupt that process. --- SQF/dayz_code/compile/mutant_eventKill.sqf | 4 +--- SQF/dayz_code/compile/player_zombieCheck.sqf | 16 ++++---------- SQF/dayz_code/system/REsec.hpp | 4 ++-- SQF/dayz_code/system/mutant_agent.fsm | 22 ++++++++++++------- .../BattlEye/publicvariableval.txt | 8 +++---- 5 files changed, 25 insertions(+), 29 deletions(-) diff --git a/SQF/dayz_code/compile/mutant_eventKill.sqf b/SQF/dayz_code/compile/mutant_eventKill.sqf index c8ec5e156..f2d38fdb4 100644 --- a/SQF/dayz_code/compile/mutant_eventKill.sqf +++ b/SQF/dayz_code/compile/mutant_eventKill.sqf @@ -8,9 +8,7 @@ local _mutant = _array select 0; [nil, _mutant, rSWITCHMOVE, ""] call RE; local _skin = _mutant getVariable ["mutantSkin", "act_krovosos_new1"]; local _texture = format["\dayz_epoch_c\skins\bloodsucker\%1.paa",_skin]; - -_mutant setVehicleInit "this setObjectTexture [0,_texture];"; -processInitCommands; +[nil,nil,rSETOBJECTTEXTURE,_mutant,0,_texture] call RE; local _killer = _array select 1; diff --git a/SQF/dayz_code/compile/player_zombieCheck.sqf b/SQF/dayz_code/compile/player_zombieCheck.sqf index 358b66e88..e4b020429 100644 --- a/SQF/dayz_code/compile/player_zombieCheck.sqf +++ b/SQF/dayz_code/compile/player_zombieCheck.sqf @@ -21,17 +21,6 @@ local _cantSee = false; local _remotetargets = _x getVariable ["remotetargets",[]]; local _targets = _localtargets + _remotetargets; - if (_isMutant) then { - if (_dist <= 5) then { - local _skin = _x getVariable ["mutantSkin", "act_krovosos_new1"]; // Set textures locally on each client to prevent issues with RESec - _x setObjectTexture [0, format["\dayz_epoch_c\skins\bloodsucker\%1.paa",_skin]]; - } else { - _x setObjectTexture [0, ""]; - local _sound = ["bloodgrowl0","bloodgrowl2","bloodgrowl3","bloodgrowl4","bloodforest1","bloodforest2","bloodforest3","bloodforest4"] call BIS_fnc_selectRandom; - [_x,_sound,(_chance + 4),false] call dayz_zombieSpeak; - }; - }; - if (_isZombie) then { if (_x distance _refObj >= (dayz_areaAffect*2)) then { if (speed _x < 4) then { @@ -46,7 +35,7 @@ local _cantSee = false; if (_refObj in _targets) then { if (_isZombie) then {_x setVariable ["speedLimit", 0, false];}; - if (_dist <= 3) then { + if (_dist <= 3.6) then { //Force AI to Stand _x setUnitPos "UP"; if !(animationState _x == "ZombieFeed") then { @@ -63,6 +52,9 @@ local _cantSee = false; local _noAttack = (DZE_MutantHeartProtect && {_refObj hasWeapon "ItemMutantHeart"}); if (!_noAttack && !_inVehicle) then { _x spawn player_mutantAttack; + local _skin = _x getVariable ["mutantSkin", "act_krovosos_new1"]; // Set textures locally on each client to prevent issues with RESec + local _texture = format["\dayz_epoch_c\skins\bloodsucker\%1.paa",_skin]; + [nil,nil,rSETOBJECTTEXTURE,_x,0,_texture] call RE; }; }; _x setVariable ["lastAttack", diag_tickTime]; diff --git a/SQF/dayz_code/system/REsec.hpp b/SQF/dayz_code/system/REsec.hpp index 6576281a8..bcaf1e813 100644 --- a/SQF/dayz_code/system/REsec.hpp +++ b/SQF/dayz_code/system/REsec.hpp @@ -9,14 +9,14 @@ "hideObject", "hint", "hintC", "kbAddTopic", "kbreact", "kbRemoveTopic", "kbtell", "land", "move", "moveIn", \ "playAction", "playActionnow", "playmovenow", "playMusic", "playsound", "removeAction", \ "removeAllWeapons", "setCaptive", "setCurrentTask", "setCurrentTaskArrays", "setDate", "setDir", "setGroupID", \ -"setMarkerPosLocal", "setObjectTexture", "setSimpleTaskDescription", "setTaskState", "setWPdesc", "setWPtype", \ +"setMarkerPosLocal", "setSimpleTaskDescription", "setTaskState", "setWPdesc", "setWPtype", \ "showCommandingMenu", "sideChat", "sideRadio", "skiptime", "spawn", "switchAction", "switchCamera", "taskHint", \ "titleCut", "Hangender"] #endif // Allowed commands #ifndef TRACED_LIB -#define TRACED_LIB [ "execVM", "JIPexec", "JIPrequest", "say", "playmove", "switchmove", "titleText" ] +#define TRACED_LIB [ "execVM", "JIPexec", "JIPrequest", "say", "playmove", "switchmove", "titleText","setObjectTexture" ] // uncomment following line to log all incoming allowed RE #define RESEC_VERBOSE #endif diff --git a/SQF/dayz_code/system/mutant_agent.fsm b/SQF/dayz_code/system/mutant_agent.fsm index 87a530298..8150c8cd2 100644 --- a/SQF/dayz_code/system/mutant_agent.fsm +++ b/SQF/dayz_code/system/mutant_agent.fsm @@ -1,4 +1,4 @@ -/*%FSM*/ +/*%FSM*/ /*%FSM*/ /* item0[] = {"init",0,250,-400.000000,-250.000000,-300.000000,-200.000000,0.000000,"init"}; @@ -34,7 +34,7 @@ item29[] = {"",7,210,221.000000,96.000008,229.000000,103.999977,0.000000,""}; item30[] = {"Time_Check",4,218,425.000000,125.000000,525.000000,175.000000,0.000000,"Time" \n "Check"}; item31[] = {"",7,210,346.000000,-79.000000,354.000000,-71.000000,0.000000,""}; item32[] = {"",7,210,221.000000,-79.000000,229.000000,-71.000000,0.000000,""}; -item33[] = {"too_long",4,4314,-425.000000,725.000000,-325.000000,775.000000,0.000000,"too long"}; +item33[] = {"too_long",4,218,-425.000000,725.000000,-325.000000,775.000000,0.000000,"too long"}; item34[] = {"",7,210,-229.000000,746.000000,-221.000000,754.000000,0.000000,""}; item35[] = {"",7,210,-479.000000,746.000000,-471.000000,754.000000,0.000000,""}; item36[] = {"Reset_Targeting",2,250,-525.000000,325.000000,-425.000000,375.000000,0.000000,"Reset" \n "Targeting"}; @@ -48,7 +48,7 @@ item43[] = {"TimeCheck",4,218,-150.000000,275.000000,-50.000000,325.000000,2.000 item44[] = {"No_Agent",4,218,25.000000,450.000000,125.000000,500.000000,5.000000,"No Agent"}; item45[] = {"",7,210,221.000015,546.000061,229.000000,553.999939,0.000000,""}; item46[] = {"",7,210,-29.000042,545.999939,-20.999958,554.000061,0.000000,""}; -item47[] = {"Ready",4,218,-400.000000,-125.000000,-300.000000,-75.000000,0.000000,"Ready"}; +item47[] = {"Ready",4,4314,-400.000000,-125.000000,-300.000000,-75.000000,0.000000,"Ready"}; item48[] = {"Loiter",2,250,-400.000000,25.000000,-300.000000,75.000000,0.000000,"Loiter"}; item49[] = {"Time_Check",4,218,-275.000000,50.000000,-175.000000,100.000000,0.000000,"Time" \n "Check"}; item50[] = {"MoveCompleted_",4,218,-525.000000,50.000000,-425.000000,100.000000,3.000000,"MoveCompleted "}; @@ -151,8 +151,8 @@ link81[] = {61,62}; link82[] = {62,7}; link83[] = {63,55}; link84[] = {64,1}; -globals[] = {25.000000,1,0,0,0,640,480,1,193,6316128,1,-736.296082,268.705750,907.675354,265.884705,1425,910,1}; -window[] = {2,-1,-1,-1,-1,883,182,1390,182,3,1443}; +globals[] = {25.000000,1,0,0,0,640,480,1,193,6316128,1,-1193.257202,482.412689,820.253479,-249.823410,1425,910,1}; +window[] = {2,-1,-1,-1,-1,909,208,1416,208,3,1443}; *//*%FSM*/ class FSM { @@ -208,7 +208,8 @@ class FSM "" \n "// Select skin" \n "_skin = [""act_krovosos_new1"",""act_krovosos_8"",""act_krovosos_7"",""act_krovosos_6"",""act_krovosos_5"",""act_krovosos_4"",""act_krovosos_3"",""act_krovosos_2""] call BIS_fnc_selectRandom;" \n - "_agent setVariable [""mutantSkin"",_skin, false];" \n + "_agent setVariable [""mutantSkin"",_skin,true];" \n + "[nil,nil,rSETOBJECTTEXTURE,_agent,0,""""] call RE;" \n "" \n "// Announce presence" \n "[_agent,""bloodgrowl1"",0,false] call dayz_zombieSpeak;"/*%FSM*/; @@ -252,6 +253,12 @@ class FSM "if ((_agroCheck % 8) == 0) then {" \n " _agroCheck = 0;" \n " _cantSee = [_target,_agent] call dayz_losCheck;" \n + "};" \n + "" \n + "_sound = [""bloodgrowl0"",""bloodgrowl2"",""bloodgrowl3"",""bloodgrowl4"",""bloodforest1"",""bloodforest2"",""bloodforest3"",""bloodforest4""] call BIS_fnc_selectRandom;" \n + "[_agent,_sound,5,false] call dayz_zombieSpeak;" \n + "if (alive _agent) then {" \n + " [nil,nil,rSETOBJECTTEXTURE,_agent,0,""""] call RE;" \n "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links @@ -653,8 +660,7 @@ class FSM name = "Attacking_Wait"; init = /*%FSM*/"_targetPos = _target modelToWorld [0,-1,0];" \n "" \n - "_timeN = diag_tickTime;" \n - ""/*%FSM*/; + "_timeN = diag_tickTime;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { diff --git a/Server Files/DZE_Server_Config/BattlEye/publicvariableval.txt b/Server Files/DZE_Server_Config/BattlEye/publicvariableval.txt index 43c05c35e..6bfc7a361 100644 --- a/Server Files/DZE_Server_Config/BattlEye/publicvariableval.txt +++ b/Server Files/DZE_Server_Config/BattlEye/publicvariableval.txt @@ -6,14 +6,14 @@ 5 \+ !e\+0 5 (commandRadio|directSay|globalRadio|groupRadio|sideRadio|vehicleRadio) 1 "wrong side" // group hack, ban the first in a row -1 "\"\w*?(init|set|add|action|all|attach|ATL|ASL|eye|exec|group|unit|clear|create|menu|ctrl|display|text|hint|drop)\w*?\"" !"\"(SetFuel|dayzSetDate|titleText|(|with )MeleeBaseball(|Bat(|Barbed|Nails))|StashSmall|smallboat_[12])\"" !Attachment_ !fall !ItemWoodWall +1 "\"\w*?(init|set|add|action|all|attach|ATL|ASL|eye|exec|group|unit|clear|create|menu|ctrl|display|text|hint|drop)\w*?\"" !"\"(SetFuel|dayzSetDate|titleText|(|with )MeleeBaseball(|Bat(|Barbed|Nails))|StashSmall|smallboat_[12])\"" !Attachment_ !fall !ItemWoodWall !setObjectTexture 1 "(entit|exit|able|find|fuel|join|frame|move|team|throw)" !"\"(switchmove|ItemFuelcan(|Empty)|ItemFuelBarrel(|Empty)|PartFueltank|SetFuel|z_refuel_0|ItemSodaRocketFuel|cable_tie)\"" !Zombie(Feed|StandingAttack) !mtvr_fuel\.p3d !RemoveObject !fuel_pump_kit !ural_refuel\.p3d !UralRefuel_TK_EP1_DZ 1 "\"say\"" !"say\",\[\"z_" 1 "\"titleText\"" 1 "draw" 1 "delete" 1 "copy" -1 "switch" !="\"switchmove\"" !="\"remExField\" = \[,,\"switchmove\",\"ActsPercMrunSlowWrflDf_FlipFlopPara\"\]" !="\[,,\"switchmove\",\"amovpercmstpsnonwnondnon_zevl\"\]" !="\[,,\"switchmove\",\"amovpercmstpslowwrfldnon_gear\"\]" !="\[,,\"switchmove\",\"aidlpercmstpsnonwnondnon_player_idlesteady03\"\]" !="\[,,\"switchmove\",\"aidlpercmstpsraswpstdnon_player_idlesteady02\"\]" !="\[,,\"switchmove\",\"aidlpercmstpsraswpstdnon_player_idlesteady03\"\]" !="\[,,\"switchmove\",\"aswmpercmstpsnonwnondnon\"\]" !="\[,,\"switchmove\",\"aidlpercmstpslowwrfldnon_player_idlesteady04\"\]" !"REMOTE,\"switchmove\",\"amovpknlmstpsraswrfldnon\"\]" !"\[,,\"switchmove\",\"amovpercmstpsnonwnondnon\"\]" !"REMOTE,\"switchmove\",\"aovrpercmstpsraswrfldf\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsraswrfldnon_idlesteady02\"\]" !"REMOTE,\"switchmove\",\"\"\]" !"REMOTE,\"switchmove\",\"AmovPpneMstpSnonWnonDnon_healed\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsraswpstdnon_player_idlesteady02\"\]" !"\[,,\"switchmove\",\"amovpercmstpslowwrfldnon\"\]" !"REMOTE,\"switchmove\",\"amovpercmrunsnonwnondf\"\]" !"REMOTE,\"switchmove\",\"amovpknlmstpsraswrfldnon_gear\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsraswrfldnon_aiming02\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsraswrfldnon_aiming01\"\]" !"REMOTE,\"switchmove\",\"amovpercmrunsraswrfldf\"\]" !"REMOTE,\"switchmove\",\"amovpercmstpsraswrfldnon_gear\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsnonwnondnon_player_idlesteady02\"\]" !"REMOTE,\"switchmove\",\"amovppnemstpsraswrfldnon\"\]" !"REMOTE,\"switchmove\",\"amovpercmstpslowwrfldnon\"\]" !"REMOTE,\"switchmove\",\"amovpknlmstpsraswrfldnon_amovppnemstpsraswrfldnon\"\]" !"REMOTE,\"switchmove\",\"amovpknlmstpsraswrfldnon_ainvpknlmstpslaywrfldnon\"\]" !"REMOTE,\"switchmove\",\"amovpercmrunsraswrfldfl\"\]" !"REMOTE,\"switchmove\",\"amovpercmrunslowwrfldf_amovppnemstpsraswrfldnon\"\]" !"REMOTE,\"switchmove\",\"aidlpknlmstpsraswpstdnon_player_idlesteady01\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsnonwnondnon_player_idlesteady03\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsraswrfldnon_idlesteady04\"\]" !"REMOTE,\"switchmove\",\"aidlpknlmstpsraswpstdnon_player_idlesteady02\"\]" !"REMOTE,\"switchmove\",\"amovpercmstpsraswpstdnon_gear\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsnonwnondnon_player_idlesteady04\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsnonwnondnon_player_idlesteady01\"\]" !"REMOTE,\"switchmove\",\"aidlpknlmstpsraswpstdnon_player_idlesteady03\"\]" !"REMOTE,\"switchmove\",\"amovppnemstpsnonwnondnon\"\]" !"REMOTE,\"switchmove\",\"amovpercmstpsnonwnondnon\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsraswrfldnon_idlesteady01\"\]" !"\"switchmove\",\"AmovPpneMstpSnonWnonDnon_healed\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsraswrfldnon_idlesteady03\"\]" !"REMOTE,\"switchmove\",\"amovpercmstpslowwrfldnon_gear\"\]" !"REMOTE,\"switchmove\",\"ainvpknlmstpsnonwnondnon_2\"\]" +1 "switch" !="\"switchmove\"" !="\"remExField\" = \[,,\"switchmove\",\"ActsPercMrunSlowWrflDf_FlipFlopPara\"\]" !="\[,,\"switchmove\",\"amovpercmstpsnonwnondnon_zevl\"\]" !="\[,,\"switchmove\",\"amovpercmstpslowwrfldnon_gear\"\]" !="\[,,\"switchmove\",\"aidlpercmstpsnonwnondnon_player_idlesteady03\"\]" !="\[,,\"switchmove\",\"aidlpercmstpsraswpstdnon_player_idlesteady02\"\]" !="\[,,\"switchmove\",\"aidlpercmstpsraswpstdnon_player_idlesteady03\"\]" !="\[,,\"switchmove\",\"aswmpercmstpsnonwnondnon\"\]" !="\[,,\"switchmove\",\"aidlpercmstpslowwrfldnon_player_idlesteady04\"\]" !"REMOTE,\"switchmove\",\"amovpknlmstpsraswrfldnon\"\]" !"\[,,\"switchmove\",\"amovpercmstpsnonwnondnon\"\]" !"REMOTE,\"switchmove\",\"aovrpercmstpsraswrfldf\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsraswrfldnon_idlesteady02\"\]" !"REMOTE,\"switchmove\",\"\"\]" !"REMOTE,\"switchmove\",\"AmovPpneMstpSnonWnonDnon_healed\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsraswpstdnon_player_idlesteady02\"\]" !"\[,,\"switchmove\",\"amovpercmstpslowwrfldnon\"\]" !"REMOTE,\"switchmove\",\"amovpercmrunsnonwnondf\"\]" !"REMOTE,\"switchmove\",\"amovpknlmstpsraswrfldnon_gear\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsraswrfldnon_aiming02\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsraswrfldnon_aiming01\"\]" !"REMOTE,\"switchmove\",\"amovpercmrunsraswrfldf\"\]" !"REMOTE,\"switchmove\",\"amovpercmstpsraswrfldnon_gear\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsnonwnondnon_player_idlesteady02\"\]" !"REMOTE,\"switchmove\",\"amovppnemstpsraswrfldnon\"\]" !"REMOTE,\"switchmove\",\"amovpercmstpslowwrfldnon\"\]" !"REMOTE,\"switchmove\",\"amovpknlmstpsraswrfldnon_amovppnemstpsraswrfldnon\"\]" !"REMOTE,\"switchmove\",\"amovpknlmstpsraswrfldnon_ainvpknlmstpslaywrfldnon\"\]" !"REMOTE,\"switchmove\",\"amovpercmrunsraswrfldfl\"\]" !"REMOTE,\"switchmove\",\"amovpercmrunslowwrfldf_amovppnemstpsraswrfldnon\"\]" !"REMOTE,\"switchmove\",\"aidlpknlmstpsraswpstdnon_player_idlesteady01\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsnonwnondnon_player_idlesteady03\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsraswrfldnon_idlesteady04\"\]" !"REMOTE,\"switchmove\",\"aidlpknlmstpsraswpstdnon_player_idlesteady02\"\]" !"REMOTE,\"switchmove\",\"amovpercmstpsraswpstdnon_gear\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsnonwnondnon_player_idlesteady04\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsnonwnondnon_player_idlesteady01\"\]" !"REMOTE,\"switchmove\",\"aidlpknlmstpsraswpstdnon_player_idlesteady03\"\]" !"REMOTE,\"switchmove\",\"amovppnemstpsnonwnondnon\"\]" !"REMOTE,\"switchmove\",\"amovpercmstpsnonwnondnon\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsraswrfldnon_idlesteady01\"\]" !"\"switchmove\",\"AmovPpneMstpSnonWnonDnon_healed\"\]" !"REMOTE,\"switchmove\",\"aidlpercmstpsraswrfldnon_idlesteady03\"\]" !"REMOTE,\"switchmove\",\"amovpercmstpslowwrfldnon_gear\"\]" !"REMOTE,\"switchmove\",\"ainvpknlmstpsnonwnondnon_2\"\]" !",\"switchmove\",\"\"\]" 1 "icon" 1 "marker" 1 "server" @@ -102,7 +102,7 @@ 5 "setG" 5 "setH" 5 "setM" -5 "setObj" +1 "setObj" !"\[any,any,\"setObjectTexture" 5 "setOver" 5 "setP" 5 "setR" @@ -214,7 +214,7 @@ 5 "'" 5 actionmonitor 5 bis_ -5 dayz !"dayzSetDate" +1 dayz !dayzSetDate !dayz_epoch_c 5 drn_ 5 eh_localcleanup 5 fnc_