mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Make zombie_agent.fsm customizable for admins #1877
Also fixed HandleDamage EH was added twice. We moved it to the configs
and forgot to take it out of the FSM in 6853263.
This commit is contained in:
@@ -22,9 +22,8 @@ class Swarm_Base : Citizen1 {
|
||||
forcedSpeed = 6;
|
||||
|
||||
class Eventhandlers {
|
||||
init = "_this execFSM ""\z\AddOns\dayz_code\system\zombie_agent.fsm""";
|
||||
//local = "if(_this select 1) then {[(position (_this select 0)),(_this select 0),true] execFSM '\z\AddOns\dayz_code\system\fn_swarmagent.fsm'};";
|
||||
local = "_z = _this select 0; if (!(_this select 1)) exitWith {}; if (isServer) exitWith { _z call sched_co_deleteVehicle; }; [_z,true] execFSM '\z\AddOns\dayz_code\system\zombie_agent.fsm';";
|
||||
init = "_this call zombie_initialize;";
|
||||
local = "_z = _this select 0; if (!(_this select 1)) exitWith {}; if (isServer) exitWith { _z call sched_co_deleteVehicle; }; [_z,true] call zombie_initialize;";
|
||||
HandleDamage = "_this call local_zombieDamage;";
|
||||
Killed = "[_this,'zombieKills'] call local_eventKill;";
|
||||
};
|
||||
|
||||
@@ -52,8 +52,8 @@ class zZombie_Base : Zed_Base {
|
||||
|
||||
class Eventhandlers
|
||||
{
|
||||
init = "_this 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; }; [_z,true] execFSM '\z\AddOns\dayz_code\system\zombie_agent.fsm';";
|
||||
init = "_this call zombie_initialize;";
|
||||
local = "_z = _this select 0; if (!(_this select 1)) exitWith {}; if (isServer) exitWith { _z call sched_co_deleteVehicle; }; [_z,true] call zombie_initialize;";
|
||||
HandleDamage = "_this call local_zombieDamage;";
|
||||
Killed = "[_this,'zombieKills'] call local_eventKill;";
|
||||
};
|
||||
|
||||
10
SQF/dayz_code/compile/zombie_initialize.sqf
Normal file
10
SQF/dayz_code/compile/zombie_initialize.sqf
Normal file
@@ -0,0 +1,10 @@
|
||||
// Moved from config to allow admins to modify
|
||||
// Put agent second for compatibility with old configs like Namalsk custom zombies.
|
||||
|
||||
if (count _this == 1) then {
|
||||
//Called from init EH
|
||||
["", (_this select 0)] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
|
||||
} else {
|
||||
//Called from local EH
|
||||
["", (_this select 0), true] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
// EPOCH CONFIG VARIABLES //
|
||||
|
||||
// To change a variable copy it to your mission init.sqf in the Epoch Config Variables section
|
||||
// Standard DayZ variables are found in dayz_code\init\variables.sqf
|
||||
// To change a variable copy paste it in the mission init.sqf below the #include line.
|
||||
// Standard DayZ variables are found in dayz_code\init\variables.sqf.
|
||||
|
||||
dayz_knifeDulling = false; // Enable knife dulling. Knives need to be sharpened after so many uses.
|
||||
dayz_matchboxCount = false; // Enable match stick count. After five uses matches run out and must be replaced.
|
||||
|
||||
@@ -663,6 +663,7 @@ fnc_Obj_FenceHandleDam = compile preprocessFileLineNumbers "\z\addons\dayz_code\
|
||||
object_roadFlare = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_roadFlare.sqf";
|
||||
DZ_KeyDown_EH = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\keyboard.sqf";
|
||||
fn_shuffleArray = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_shuffleArray.sqf";
|
||||
zombie_initialize = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_initialize.sqf";
|
||||
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_code\traps\init.sqf";
|
||||
if (dayz_townGenerator) then {
|
||||
|
||||
@@ -140,9 +140,6 @@ class FSM
|
||||
"_bodyStay = 60;" \n
|
||||
"" \n
|
||||
"_timeN = time;" \n
|
||||
"" \n
|
||||
" _id = _agent addeventhandler [""HandleDamage"",{_this call local_zombieDamage}];" \n
|
||||
"" \n
|
||||
"//hint ""run local zombie"";" \n
|
||||
"_isSomeone = true;" \n
|
||||
"" \n
|
||||
|
||||
@@ -211,11 +211,11 @@ class FSM
|
||||
class init
|
||||
{
|
||||
name = "init";
|
||||
init = /*%FSM<STATEINIT""">*/"_agent = _this select 0;" \n
|
||||
init = /*%FSM<STATEINIT""">*/"_agent = _this select 1; //Compatible with old configs like Namalsk's custom zombies" \n
|
||||
"_position = _agent modelToWorld [0,0,0];" \n
|
||||
"_secondHand = false;" \n
|
||||
"" \n
|
||||
"if (count _this > 1) then {" \n
|
||||
"if (count _this > 2) then {" \n
|
||||
" _secondHand = true;" \n
|
||||
" diag_log (""Second Hand Zombie Initialized: "" + str(_this));" \n
|
||||
"};"/*%FSM</STATEINIT""">*/;
|
||||
@@ -475,9 +475,6 @@ class FSM
|
||||
"_timeN = diag_tickTime;" \n
|
||||
"" \n
|
||||
"_agent setBehaviour ""CARELESS"";" \n
|
||||
"" \n
|
||||
" _id = _agent addeventhandler [""HandleDamage"",{_this call local_zombieDamage}];" \n
|
||||
"" \n
|
||||
"//hint ""run local zombie"";" \n
|
||||
"_isSomeone = true;" \n
|
||||
"" \n
|
||||
|
||||
@@ -282,9 +282,6 @@ class FSM
|
||||
"_agent disableAI ""FSM"";" \n
|
||||
"_newDest = getPosATL _agent;" \n
|
||||
"_timeN = time;" \n
|
||||
"" \n
|
||||
" _id = _agent addeventhandler [""HandleDamage"",{_this call local_zombieDamage}];" \n
|
||||
"" \n
|
||||
"_target = objNull;" \n
|
||||
"_targetPos = [];" \n
|
||||
"_countr = 0;" \n
|
||||
|
||||
Reference in New Issue
Block a user