diff --git a/SQF/dayz_code/Configs/CfgVehicles/Zeds/Zeds.hpp b/SQF/dayz_code/Configs/CfgVehicles/Zeds/Zeds.hpp index d79ee2514..a5f2db03f 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/Zeds/Zeds.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/Zeds/Zeds.hpp @@ -52,9 +52,11 @@ class zZombie_Base : Zed_Base { class Eventhandlers { - init = "_this call zombie_initialize;"; + init = "_this execFSM ""\z\AddOns\dayz_code\system\zombie_agent.fsm"""; //local = "_z = _this select 0; if ((!isServer and !isNull _z) and {(side _z != civilian)}) exitWith { PVDZ_sec_atp = [ 'wrong side', player ]; publicVariableServer 'PVDZ_sec_atp'; deleteVehicle _z; }; if (!(_this select 1)) exitWith {}; if (isServer) exitWith { _z call sched_co_deleteVehicle; }; [(position _z), _z, true] execFSM '\z\AddOns\dayz_code\system\zombie_agent.fsm';"; local = "_z = _this select 0; if (!(_this select 1)) exitWith {}; if (isServer) exitWith { _z call sched_co_deleteVehicle; }; [(position _z), _z, true] execFSM '\z\AddOns\dayz_code\system\zombie_agent.fsm';"; + HandleDamage = "_this call local_zombieDamage;"; + Killed = "[_this,'zombieKills'] call local_eventKill;"; }; class UserActions diff --git a/SQF/dayz_code/compile/zombie_generate.sqf b/SQF/dayz_code/compile/zombie_generate.sqf index 3668536d7..3379b5027 100644 --- a/SQF/dayz_code/compile/zombie_generate.sqf +++ b/SQF/dayz_code/compile/zombie_generate.sqf @@ -62,10 +62,6 @@ _cantSee = { _skipFOV = false; if ((_maxlocalspawned < _maxControlledZombies) && (dayz_CurrentNearByZombies < dayz_maxNearByZombies) && (dayz_currentGlobalZombies < dayz_maxGlobalZeds)) then { - //if (_wildSpawns) then { - // _skipFOV = true; - // _position = [_position,150,200] call dayz_RandomLocation; - //}; if (_bypass) then { _skipFOV = true; _position = [_position,3,20,1] call fn_selectRandomLocation; @@ -122,17 +118,6 @@ if ((_maxlocalspawned < _maxControlledZombies) && (dayz_CurrentNearByZombies < d _agent setVariable ["stance", _favStance]; _agent setVariable ["BaseLocation", _position]; _agent setVariable ["doLoiter", _doLoiter]; // true: Z will be wandering, false: stay still - //_agent setVariable ["myDest", _position]; - //_agent setVariable ["newDest", _position]; - //[_agent, _position] call zombie_loiter; }; - - //Disable simulation - //PVDZ_Server_Simulation = [_agent, false]; - //publicVariableServer "PVDZ_Server_Simulation"; - - //Start behavior - _id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm"; }; - -}; \ No newline at end of file +}; diff --git a/SQF/dayz_code/compile/zombie_initialize.sqf b/SQF/dayz_code/compile/zombie_initialize.sqf deleted file mode 100644 index 23f7c2d42..000000000 --- a/SQF/dayz_code/compile/zombie_initialize.sqf +++ /dev/null @@ -1,3 +0,0 @@ -_unit = _this select 0; -_id = _unit addeventhandler ["HandleDamage",{_this call local_zombieDamage}]; -_id = _unit addeventhandler ["Killed",{[_this,"zombieKills"] call local_eventKill}]; \ No newline at end of file diff --git a/SQF/dayz_code/compile/zombie_loiter.sqf b/SQF/dayz_code/compile/zombie_loiter.sqf index 73e8f1ab7..e9d0791d9 100644 --- a/SQF/dayz_code/compile/zombie_loiter.sqf +++ b/SQF/dayz_code/compile/zombie_loiter.sqf @@ -6,20 +6,7 @@ _pos = getPosATL _unit; if (count _this > 2) then { _pos = _this select 2; } else { - //_unit enableAI "MOVE"; - //_unit enableAI "ANIM"; - //_pos = [_originalPos,10,90,4,0,5,0] call BIS_fnc_findSafePos; _pos = [_originalPos,10,(10 - (random (90 * 2))),0] call fn_selectRandomLocation; }; -/* -if(isNull group _unit) then { - _unit moveTo _pos; -} else { - _unit domove _pos; -}; -_unit forceSpeed 2; -_unit setVariable ["myDest",_pos]; -*/ - _pos diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf index 278cec3f4..4297af3b3 100644 --- a/SQF/dayz_code/init/compiles.sqf +++ b/SQF/dayz_code/init/compiles.sqf @@ -641,7 +641,6 @@ BIS_fnc_findNestedElement = compile preprocessFileLineNumbers "\z\addons\dayz_co BIS_fnc_param = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_param.sqf"; BIS_fnc_relativeDirTo = compile("private '_dir';_dir=_this call{" + (preprocessFileLineNumbers "ca\modules\Functions\geometry\fn_relativeDirTo.sqf")+"};if(_dir>180)then{_dir=_dir-360;};if(_dir<-180)then{_dir=_dir+360;};_dir"); fnc_buildWeightedArray = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildWeightedArray.sqf"; //Checks which actions for nearby casualty -zombie_initialize = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_initialize.sqf"; object_getHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_getHit.sqf"; //gets the hit value for a HitPoint (i.e. HitLegs) against the selection (i.e. "legs"), returns the value object_setHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHit.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles) object_processHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_processHit.sqf"; //process the hit in the REVO damage system (records and sets hit) diff --git a/SQF/dayz_code/system/zombie_agent.fsm b/SQF/dayz_code/system/zombie_agent.fsm index 8ed1cff9e..88707f8b0 100644 --- a/SQF/dayz_code/system/zombie_agent.fsm +++ b/SQF/dayz_code/system/zombie_agent.fsm @@ -178,8 +178,8 @@ class FSM class init { name = "init"; - init = /*%FSM*/"_position = _this select 0;" \n - "_agent = _this select 1;" \n + init = /*%FSM*/"_agent = _this select 0;" \n + "_position = _agent modelToWorld [0,0,0];" \n "_secondHand = false;" \n "" \n "if (count _this > 2) then {" \n