/*%FSM*/ /*%FSM*/ /* item0[] = {"init",0,250,-300.000000,-250.000000,-200.000000,-200.000000,0.000000,"init"}; item1[] = {"End",1,250,50.000000,-250.000000,150.000000,-200.000000,0.000000,"End"}; item2[] = {"Not_Alive",4,218,0.000000,300.000000,100.000000,350.000000,5.000000,"Not" \n "Alive"}; item3[] = {"Nobody_Near",4,218,0.000000,375.000000,100.000000,425.000000,4.000000,"Nobody" \n "Near"}; item4[] = {"loiter",4,218,-300.000000,0.000000,-200.000000,50.000000,0.000000,"loiter"}; item5[] = {"Loiter",2,250,-300.000000,75.000000,-200.000000,125.000000,0.000000,"Loiter"}; item6[] = {"In_Position",4,218,-175.000000,75.000000,-75.000000,125.000000,1.000000,"In Position"}; item7[] = {"",7,210,-29.000042,321.000000,-20.999958,329.000000,0.000000,""}; item8[] = {"",7,210,-29.000042,395.999939,-20.999958,404.000061,0.000000,""}; item9[] = {"true",8,218,-300.000000,-175.000000,-200.000000,-125.000000,0.000000,"true"}; item10[] = {"Begin",2,250,-300.000000,-100.000000,-200.000000,-50.000000,0.000000,"Begin"}; item11[] = {"",7,210,-254.000046,-29.000004,-245.999954,-20.999996,0.000000,""}; item12[] = {"",7,210,-204.000046,146.000000,-195.999954,154.000000,0.000000,""}; item13[] = {"Has_Target",4,218,-150.000000,225.000000,-50.000000,275.000000,1.000000,"Has" \n "Target"}; item14[] = {"Chase",2,250,-150.000000,300.000000,-50.000000,350.000000,0.000000,"Chase"}; item15[] = {"",7,210,-29.000006,146.000000,-20.999996,154.000000,0.000000,""}; item16[] = {"",7,210,-29.000006,196.000000,-20.999996,204.000000,0.000000,""}; item17[] = {"",7,210,-104.000000,196.000000,-95.999992,204.000000,0.000000,""}; item18[] = {"Time_Check",4,218,-425.000000,75.000000,-325.000000,125.000000,0.000000,"Time" \n "Check"}; item19[] = {"Time_Check",4,218,-275.000000,300.000000,-175.000000,350.000000,0.000000,"Time" \n "Check"}; item20[] = {"No_Target",4,218,-275.000000,375.000000,-175.000000,425.000000,3.000000,"No" \n "Target"}; item21[] = {"",7,210,-479.000000,396.000000,-471.000000,404.000000,0.000000,""}; item22[] = {"",7,210,-479.000000,146.000000,-471.000000,154.000000,0.000000,""}; item23[] = {"",7,210,133.499985,321.000000,141.500000,329.000000,0.000000,""}; item24[] = {"",7,210,133.500000,396.000000,141.500000,404.000000,0.000000,""}; item25[] = {"Cleanup_",2,250,-25.000000,50.000000,75.000000,100.000000,0.000000,"Cleanup?"}; item26[] = {"nobody_around",4,218,50.000000,-50.000000,150.000000,0.000000,0.000000,"nobody" \n "around"}; item27[] = {"",7,210,-104.000023,396.000000,-95.999992,404.000000,0.000000,""}; item28[] = {"cant_see",4,218,-275.000000,450.000000,-175.000000,500.000000,2.000000,"cant" \n "see"}; item29[] = {"Finish_Move",2,250,-275.000000,525.000000,-175.000000,575.000000,0.000000,"Finish" \n "Move"}; item30[] = {"finished",4,218,-425.000000,525.000000,-325.000000,575.000000,1.000000,"finished"}; item31[] = {"",7,210,-479.000000,546.000000,-471.000000,554.000000,0.000000,""}; item32[] = {"",7,210,-29.000002,546.000000,-20.999998,554.000000,0.000000,""}; item33[] = {"",7,210,-304.000000,146.000000,-296.000000,154.000000,0.000000,""}; item34[] = {"someone_here",4,218,-200.000000,-50.000000,-100.000000,0.000000,0.000000,"someone" \n "here"}; item35[] = {"too_long",4,218,-425.000000,600.000000,-325.000000,650.000000,0.000000,"too long"}; item36[] = {"",7,210,-229.000000,621.000000,-221.000000,629.000000,0.000000,""}; item37[] = {"",7,210,-479.000000,621.000000,-471.000000,629.000000,0.000000,""}; item38[] = {"Reset_Targeting",2,250,-525.000000,325.000000,-425.000000,375.000000,0.000000,"Reset" \n "Targeting"}; item39[] = {"No_target",4,218,-525.000000,250.000000,-425.000000,300.000000,0.000000,"No target"}; item40[] = {"",7,210,-104.000000,471.000000,-95.999992,479.000000,0.000000,""}; item41[] = {"player_check",4,218,-425.000000,0.000000,-325.000000,50.000000,0.000000,"player" \n "check"}; item42[] = {"is_Dedicated",4,218,-125.000000,-250.000000,-25.000000,-200.000000,5.000000,"is" \n "Dedicated"}; item43[] = {"Not_Alive",4,4314,-75.000000,-50.000000,25.000000,0.000000,0.000000,"Not" \n "Alive"}; link0[] = {0,9}; link1[] = {0,42}; link2[] = {2,23}; link3[] = {3,24}; link4[] = {4,5}; link5[] = {5,6}; link6[] = {5,12}; link7[] = {5,18}; link8[] = {5,41}; link9[] = {6,5}; link10[] = {7,2}; link11[] = {7,8}; link12[] = {8,3}; link13[] = {9,10}; link14[] = {10,11}; link15[] = {11,4}; link16[] = {12,15}; link17[] = {12,17}; link18[] = {13,14}; link19[] = {14,7}; link20[] = {14,19}; link21[] = {14,27}; link22[] = {15,16}; link23[] = {16,7}; link24[] = {17,13}; link25[] = {18,5}; link26[] = {19,14}; link27[] = {20,21}; link28[] = {21,38}; link29[] = {22,33}; link30[] = {23,25}; link31[] = {24,23}; link32[] = {25,26}; link33[] = {25,34}; link34[] = {25,43}; link35[] = {26,1}; link36[] = {27,20}; link37[] = {27,40}; link38[] = {28,29}; link39[] = {29,30}; link40[] = {29,32}; link41[] = {29,36}; link42[] = {30,31}; link43[] = {31,21}; link44[] = {32,8}; link45[] = {33,5}; link46[] = {34,5}; link47[] = {35,37}; link48[] = {36,35}; link49[] = {37,31}; link50[] = {38,39}; link51[] = {39,22}; link52[] = {40,28}; link53[] = {41,5}; link54[] = {42,1}; link55[] = {43,25}; globals[] = {25.000000,1,0,0,0,640,480,1,102,6316128,1,-650.021484,334.182983,700.299500,-373.567780,944,1030,1}; window[] = {2,-1,-1,-32000,-32000,841,130,1338,130,3,962}; *//*%FSM*/ class FSM { fsmName = "DayZ Zombie Agent"; class States { /*%FSM*/ class init { name = "init"; init = /*%FSM*/"_position = _this select 0;" \n "_agent = _this select 1;" \n "_secondHand = false;" \n "" \n "if (count _this > 2) then {" \n " _secondHand = true;" \n " diag_log (""Second Hand Zombie Initialized: "" + str(_this));" \n "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class is_Dedicated { priority = 5.000000; to="End"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"isDedicated"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class true { priority = 0.000000; to="Begin"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"dayz_clientPreload and !(isNull _agent)"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class End { name = "End"; init = /*%FSM*/"if (!isDedicated) then {" \n " if (!isNull _agent) then {" \n " deleteVehicle _agent;" \n " };" \n "} else {" \n " [_agent] call zombie_findOwner;" \n "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { }; }; /*%FSM*/ /*%FSM*/ class Loiter { name = "Loiter"; init = /*%FSM*/"_isAlive = alive _agent;" \n "_target = _agent call zombie_findTargetAgent;" \n "" \n "_agent setBehaviour ""SAFE"";" \n "_agent setCombatMode ""BLUE"";" \n "_agent forceSpeed 2;" \n "_agent setSkill 0;" \n "" \n "_newDest = _agent getVariable [""myDest"",getposATL _agent];" \n "if (!isNil ""_newDest"") then {" \n " if (_newDest distance _myDest > 0) then {" \n " _myDest = _newDest;" \n " _agent moveTo _myDest;" \n "// _agent forceSpeed 2;" \n " };" \n "};" \n "" \n "_timeN = time;" \n "" \n "//hintSilent (""loitering..."" + str(_agent distance (_agent getVariable [""myDest"",getposATL _agent])));" \n "" \n "if (_secondHand) then {" \n " diag_log (""Zombie "" + str(_agent) + "" Loiter "" + "" distance: "" + str(_newDest distance _myDest));" \n " _agent doMove (getPosATL player);" \n " _agent moveTo (getPosATL player);" \n "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Not_Alive { priority = 5.000000; to="Cleanup_"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_isAlive"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Nobody_Near { priority = 4.000000; to="Cleanup_"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_isSomeone"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Has_Target { priority = 1.000000; to="Chase"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!(isNull _target)"/*%FSM*/; action=/*%FSM*/"//Leader cries out" \n "if (_isSomeone) then {" \n " [_agent,""spotted"",2,true] call dayz_zombieSpeak;" \n "};" \n "if (!_hasMoved) then {" \n " _agent setVariable[""doLoiter"",true,true];" \n "};" \n "" \n "//Enable combat timer." \n "//_target setVariable[""startcombattimer"", 1, true];" \n "" \n "_countr = 0;" \n "_losCheck = 0;" \n "_cantSee = false;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class In_Position { priority = 1.000000; to="Loiter"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_agent distance (_agent getVariable [""myDest"",getposATL _agent]) < 10"/*%FSM*/; action=/*%FSM*/"[_agent,_position] call zombie_loiter;" \n "_myDest = _agent getVariable [""myDest"",getposATL _agent];" \n ""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class player_check { priority = 0.000000; to="Loiter"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(time - _entityTime) > 30"/*%FSM*/; action=/*%FSM*/"_entityTime = time;" \n "" \n "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n "_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Time_Check { priority = 0.000000; to="Loiter"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(time - _timeN) > 1"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Begin { name = "Begin"; init = /*%FSM*/"_doLoiter = _agent getVariable[""doLoiter"",true];" \n "" \n "_myDest = _position;" \n "_newDest = _position;" \n "_array = [];" \n "" \n "_bodyStay = 60;" \n "" \n "_hasMoved = _doLoiter;" \n "" \n "" \n "_agent disableAI ""FSM"";" \n "_newDest = getPosATL _agent;" \n "_timeN = time;" \n "" \n " _id = _agent addeventhandler [""HandleDamage"",{_this call local_zombieDamage}];" \n "" \n "//hint ""run local zombie"";" \n "_isSomeone = true;" \n "" \n "_target = objNull;" \n "_targetPos = [];" \n "_countr = 0;" \n "" \n "//Spawn roaming script (individual to unit)" \n "_entityTime = time;" \n "" \n "//Debug" \n "if (_secondHand) then {" \n " diag_log (""Zombie Brain Initialized "" + str(_agent) + "" doLoiter: "" + str(_doLoiter));" \n " [_agent,_position] call zombie_loiter;" \n " _myDest = _agent getVariable [""myDest"",getposATL _agent];" \n "" \n "};" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class loiter { priority = 0.000000; to="Loiter"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_hasMoved"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Chase { name = "Chase"; init = /*%FSM*/"_timeN = time;" \n "_vehicle = (getPosATL vehicle player);" \n "" \n "if (speed _agent < 0.1) then {_countr = _countr + 1} else {_countr = 0};" \n "_target = _agent call zombie_findTargetAgent;" \n "_isAlive = alive _agent;" \n "_targetPos = getPosATL _target;" \n "" \n "" \n "//Move to target" \n "" \n "_agent setBehaviour ""CARELESS"";" \n "_agent setCombatMode ""RED"";" \n "_agent moveTo _targetPos;" \n "_agent forceSpeed 6;" \n "" \n "" \n "//if (_agent distance player > 15) then {" \n "// _cantSee = [_agent,_target] call dayz_losCheck;" \n "//};" \n "" \n "//Check if LOS" \n "if (_losCheck == 2) then {" \n " _losCheck = 0;" \n "_cantSee = [_agent,_target] call dayz_losCheck;" \n "};" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Not_Alive { priority = 5.000000; to="Cleanup_"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_isAlive"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Nobody_Near { priority = 4.000000; to="Cleanup_"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_isSomeone"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class No_Target { priority = 3.000000; to="Reset_Targeting"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(isNull _target)"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class cant_see { priority = 2.000000; to="Finish_Move"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_cantSee"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Time_Check { priority = 0.000000; to="Chase"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(time - _timeN) > 2"/*%FSM*/; action=/*%FSM*/"_losCheck = _losCheck + 1;"/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Cleanup_ { name = "Cleanup_"; init = /*%FSM*/"_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],400];" \n "_isSomeone = ({isPlayer _x} count _list) > 0;" \n "" \n "_waitStart = time;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class someone_here { priority = 0.000000; to="Loiter"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_isSomeone && _isAlive"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Not_Alive { priority = 0.000000; to="Cleanup_"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_isSomeone && !_isAlive && (time - _waitStart) > 60"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class nobody_around { priority = 0.000000; to="End"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_isSomeone"/*%FSM*/; action=/*%FSM*/"dayz_spawnZombies = dayz_spawnZombies - 1;"/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Finish_Move { name = "Finish_Move"; init = /*%FSM*/"_timeN = time;" \n "" \n "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n "_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Nobody_Near { priority = 4.000000; to="Cleanup_"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_isSomeone"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class finished { priority = 1.000000; to="Reset_Targeting"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_agent distance _targetPos < 3"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class too_long { priority = 0.000000; to="Reset_Targeting"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(time - _timeN) > 10"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Reset_Targeting { name = "Reset_Targeting"; init = /*%FSM*/"_isAlive = alive _agent;" \n "_target = _agent call zombie_findTargetAgent;" \n "" \n "if (!isNull _target) then {" \n " _targetPos = getPosATL _target;" \n " _agent setVariable [""myDest"",_targetPos];" \n " _agent moveTo _targetPos;" \n "};" \n "" \n "_agent setVariable [""targets"",[],true];" \n "_target = objNull;" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class No_target { priority = 0.000000; to="Loiter"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(isNull _target)"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ }; initState="init"; finalStates[] = { "End", }; }; /*%FSM*/