/*%FSM*/ /*%FSM*/ /* item0[] = {"init",0,250,50.000000,-400.000000,150.000000,-350.000000,0.000000,"init"}; item1[] = {"End",1,250,175.000000,-250.000000,275.000000,-200.000000,0.000000,"End"}; item2[] = {"wait",4,218,-75.000000,-50.000000,25.000000,0.000000,0.000000,"wait"}; item3[] = {"Looking_for_Targ",2,250,-75.000000,25.000000,25.000000,75.000000,0.000000,"Looking for" \n "Target"}; item4[] = {"Not_Alive",4,218,25.000000,375.000000,125.000000,425.000000,5.000000,"Not" \n "Alive"}; item5[] = {"Nobody_Near",4,218,25.000000,525.000000,125.000000,575.000000,6.000000,"Nobody" \n "Near"}; item6[] = {"loiter",4,218,-1225.000000,0.000000,-1125.000000,50.000000,0.000000,"loiter"}; item7[] = {"Loiter",2,250,-1225.000000,75.000000,-1125.000000,125.000000,0.000000,"Loiter"}; item8[] = {"",7,210,-29.000042,396.000000,-20.999958,404.000000,0.000000,""}; item9[] = {"",7,210,-29.000040,470.999939,-20.999960,479.000061,0.000000,""}; item10[] = {"true",8,218,-75.000000,-400.000000,25.000000,-350.000000,0.000000,"true"}; item11[] = {"Begin",2,250,-75.000000,-150.000000,25.000000,-100.000000,0.000000,"Begin"}; item12[] = {"",7,210,-1179.000122,-29.000004,-1170.999878,-20.999996,0.000000,""}; item13[] = {"",7,210,-354.000031,121.000000,-346.000000,129.000000,0.000000,""}; item14[] = {"UnitReady",4,4314,-275.000000,275.000000,-175.000000,325.000000,5.000000,"UnitReady"}; item15[] = {"Chase",2,250,-150.000000,375.000000,-50.000000,425.000000,0.000000,"Chase"}; item16[] = {"Time_Check",4,218,50.000000,25.000000,150.000000,75.000000,1.000000,"Time" \n "Check"}; item17[] = {"",7,210,-29.000006,121.000000,-20.999994,129.000000,0.000000,""}; item18[] = {"",7,210,-29.000008,221.000000,-20.999992,229.000015,0.000000,""}; item19[] = {"Time_Check",4,218,-1100.000000,75.000000,-1000.000000,125.000000,0.000000,"Time" \n "Check"}; item20[] = {"No_Target",4,218,-400.000000,450.000000,-300.000000,500.000000,3.000000,"No" \n "Target"}; item21[] = {"",7,210,-479.000000,471.000000,-471.000000,479.000000,0.000000,""}; item22[] = {"",7,210,-729.000000,346.000000,-721.000000,354.000000,0.000000,""}; item23[] = {"",7,210,221.000000,396.000000,229.000000,404.000000,0.000000,""}; item24[] = {"",7,210,221.000000,471.000000,229.000000,479.000000,0.000000,""}; item25[] = {"Cleanup_",2,250,175.000000,200.000000,275.000000,250.000000,0.000000,"Cleanup?"}; item26[] = {"nobody_around",4,218,175.000000,-25.000000,275.000000,25.000000,0.000000,"nobody" \n "around"}; item27[] = {"",7,210,-104.000023,471.000000,-95.999985,479.000000,0.000000,""}; item28[] = {"cant_see",4,218,-275.000000,575.000000,-175.000000,625.000000,2.000000,"cant" \n "see"}; item29[] = {"Finish_Move",2,250,-275.000000,650.000000,-175.000000,700.000000,0.000000,"Finish" \n "Move"}; item30[] = {"finished",4,218,-425.000000,650.000000,-325.000000,700.000000,1.000000,"finished"}; item31[] = {"",7,210,-479.000000,671.000000,-471.000000,679.000000,0.000000,""}; item32[] = {"",7,210,-29.000002,671.000000,-20.999998,679.000000,0.000000,""}; item33[] = {"Move",2,250,-650.000000,50.000000,-550.000000,100.000000,0.000000,"Move"}; item34[] = {"someone_here",4,218,300.000000,200.000000,400.000000,250.000000,0.000000,"someone" \n "here"}; item35[] = {"wait",2,250,300.000000,125.000000,400.000000,175.000000,0.000000,"wait"}; item36[] = {"time_up",4,218,300.000000,-25.000000,400.000000,25.000000,0.000000,"time" \n "up"}; item37[] = {"",7,210,346.000000,95.999992,354.000000,104.000000,0.000000,""}; item38[] = {"",7,210,221.000000,96.000008,229.000000,103.999977,0.000000,""}; item39[] = {"Time_Check",4,218,425.000000,125.000000,525.000000,175.000000,0.000000,"Time" \n "Check"}; item40[] = {"",7,210,346.000000,-79.000000,354.000000,-71.000000,0.000000,""}; item41[] = {"",7,210,221.000000,-79.000000,229.000000,-71.000000,0.000000,""}; item42[] = {"too_long",4,218,-425.000000,725.000000,-325.000000,775.000000,0.000000,"too long"}; item43[] = {"",7,210,-229.000000,746.000000,-221.000000,754.000000,0.000000,""}; item44[] = {"",7,210,-479.000000,746.000000,-471.000000,754.000000,0.000000,""}; item45[] = {"Reset_Targeting",2,250,-525.000000,325.000000,-425.000000,375.000000,0.000000,"Reset" \n "Targeting"}; item46[] = {"true",8,218,-1050.000000,275.000000,-950.000000,325.000000,0.000000,"true"}; item47[] = {"deleted",4,218,425.000000,-25.000000,525.000000,25.000000,0.000000,"deleted"}; item48[] = {"",7,210,471.000000,-79.000000,479.000000,-71.000000,0.000000,""}; item49[] = {"",7,210,471.000000,95.999977,479.000000,104.000023,0.000000,""}; item50[] = {"",7,210,-104.000000,596.000000,-95.999992,604.000000,0.000000,""}; item51[] = {"player_check",4,218,-1350.000000,75.000000,-1250.000000,125.000000,2.000000,"player" \n "check"}; item52[] = {"player_check",4,218,50.000000,-50.000000,150.000000,0.000000,2.000000,"player" \n "check"}; item53[] = {"is_Dedicated",4,218,50.000000,-250.000000,150.000000,-200.000000,5.000000,"is" \n "Dedicated"}; item54[] = {"MoveCompleted_",4,218,-1250.000000,-325.000000,-1150.000000,-275.000000,3.000000,"MoveCompleted "}; item55[] = {"Failed_Move",4,218,-1425.000000,-375.000000,-1325.000000,-325.000000,3.000000,"Failed Move"}; item56[] = {"Target_Dead",4,218,-275.000000,500.000000,-175.000000,550.000000,3.000000,"Target Dead"}; item57[] = {"",7,210,-479.000000,521.000000,-471.000000,529.000000,0.000000,""}; item58[] = {"Start_Attack",4,218,-1475.000000,-100.000000,-1375.000000,-50.000000,0.000000,"Start Attack"}; item59[] = {"End_Attack",4,218,-1475.000000,-175.000000,-1375.000000,-125.000000,0.000000,"End Attack"}; item60[] = {"TargetMoved",4,218,-1350.000000,-275.000000,-1250.000000,-225.000000,3.000000,"TargetMoved"}; item61[] = {"Not_moving",4,218,-1450.000000,-275.000000,-1350.000000,-225.000000,1.000000,"Not moving"}; item62[] = {"TimeCheck",4,218,-150.000000,275.000000,-50.000000,325.000000,2.000000,"TimeCheck"}; item63[] = {"No_Agent",4,218,25.000000,450.000000,125.000000,500.000000,5.000000,"No Agent"}; item64[] = {"",7,210,221.000015,546.000061,229.000000,553.999939,0.000000,""}; item65[] = {"",7,210,-29.000042,545.999939,-20.999958,554.000061,0.000000,""}; item66[] = {"loiter",4,218,-400.000000,-50.000000,-300.000000,0.000000,0.000000,"loiter"}; item67[] = {"Loiter_1",2,250,-400.000000,25.000000,-300.000000,75.000000,0.000000,"Loiter"}; item68[] = {"Time_Check",4,218,-275.000000,50.000000,-175.000000,100.000000,0.000000,"Time" \n "Check"}; item69[] = {"MoveCompleted_",4,218,-525.000000,50.000000,-425.000000,100.000000,3.000000,"MoveCompleted "}; item70[] = {"Failed_Move",4,218,-525.000000,100.000000,-425.000000,150.000000,3.000000,"Failed Move"}; item71[] = {"Not_moving",4,218,-525.000000,0.000000,-425.000000,50.000000,1.000000,"Not moving"}; item72[] = {"",7,210,-604.000000,-29.000000,-596.000000,-21.000000,0.000000,""}; item73[] = {"player_check",4,218,-275.000000,0.000000,-175.000000,50.000000,2.000000,"player" \n "check"}; item74[] = {"True",8,218,-525.000000,-50.000000,-425.000000,0.000000,0.000000,"True"}; item75[] = {"",7,210,-729.000000,-129.000000,-721.000000,-121.000000,0.000000,""}; item76[] = {"",7,210,-354.000000,-129.000000,-346.000000,-121.000000,0.000000,""}; item77[] = {"InRange",4,218,-275.000000,400.000000,-175.000000,450.000000,1.000000,"InRange"}; item78[] = {"Attacking_Wait",2,250,-400.000000,375.000000,-300.000000,425.000000,0.000000,"Attacking Wait"}; item79[] = {"NotInRange",4,218,-275.000000,350.000000,-175.000000,400.000000,1.000000,"NotInRange"}; item80[] = {"TimeCheck",4,218,-400.000000,275.000000,-300.000000,325.000000,0.000000,"TimeCheck"}; item81[] = {"Has_Target",4,218,-150.000000,200.000000,-50.000000,250.000000,0.000000,"Has" \n "Target"}; item82[] = {"Reset_MoveTo",2,250,-275.000000,200.000000,-175.000000,250.000000,0.000000,"Reset MoveTo"}; item83[] = {"____FAKE____",9,0,0.000000,0.000000,0.000000,0.000000,0.000000,"____FAKE____"}; link0[] = {0,10}; link1[] = {0,53}; link2[] = {2,3}; link3[] = {3,16}; link4[] = {3,17}; link5[] = {3,52}; link6[] = {4,23}; link7[] = {5,64}; link8[] = {6,7}; link9[] = {7,19}; link10[] = {7,51}; link11[] = {8,4}; link12[] = {8,9}; link13[] = {9,63}; link14[] = {9,65}; link15[] = {10,11}; link16[] = {11,2}; link17[] = {11,76}; link18[] = {12,6}; link19[] = {13,17}; link20[] = {14,15}; link21[] = {15,8}; link22[] = {15,27}; link23[] = {15,62}; link24[] = {15,77}; link25[] = {16,3}; link26[] = {17,18}; link27[] = {18,8}; link28[] = {18,81}; link29[] = {19,7}; link30[] = {20,21}; link31[] = {21,45}; link32[] = {22,75}; link33[] = {23,25}; link34[] = {24,23}; link35[] = {25,34}; link36[] = {25,38}; link37[] = {26,41}; link38[] = {27,20}; link39[] = {27,50}; link40[] = {27,56}; link41[] = {28,29}; link42[] = {29,30}; link43[] = {29,32}; link44[] = {29,43}; link45[] = {30,31}; link46[] = {31,57}; link47[] = {32,65}; link48[] = {33,72}; link49[] = {34,35}; link50[] = {35,37}; link51[] = {35,39}; link52[] = {36,40}; link53[] = {37,36}; link54[] = {37,38}; link55[] = {37,49}; link56[] = {38,26}; link57[] = {39,35}; link58[] = {40,41}; link59[] = {41,1}; link60[] = {42,44}; link61[] = {43,42}; link62[] = {44,31}; link63[] = {45,22}; link64[] = {47,48}; link65[] = {48,40}; link66[] = {49,47}; link67[] = {50,28}; link68[] = {51,7}; link69[] = {52,3}; link70[] = {53,1}; link71[] = {56,57}; link72[] = {57,21}; link73[] = {62,15}; link74[] = {63,24}; link75[] = {64,24}; link76[] = {65,5}; link77[] = {66,67}; link78[] = {67,13}; link79[] = {67,68}; link80[] = {67,69}; link81[] = {67,70}; link82[] = {67,71}; link83[] = {67,73}; link84[] = {68,67}; link85[] = {69,33}; link86[] = {70,33}; link87[] = {71,33}; link88[] = {72,74}; link89[] = {73,67}; link90[] = {74,67}; link91[] = {75,76}; link92[] = {76,66}; link93[] = {77,78}; link94[] = {78,79}; link95[] = {78,80}; link96[] = {79,15}; link97[] = {80,78}; link98[] = {81,82}; link99[] = {82,14}; link100[] = {83,6}; link101[] = {46,83}; link102[] = {83,46}; link103[] = {54,83}; link104[] = {83,54}; link105[] = {55,83}; link106[] = {83,55}; link107[] = {58,83}; link108[] = {83,58}; link109[] = {59,83}; link110[] = {83,59}; link111[] = {60,83}; link112[] = {83,60}; link113[] = {61,83}; link114[] = {83,61}; globals[] = {0.000000,0,0,0,0,640,480,1,189,6316128,1,-497.896179,342.204590,880.103882,-416.531311,806,1244,1}; window[] = {2,-1,-1,-32000,-32000,1039,338,1546,338,3,824}; *//*%FSM*/ class FSM { fsmName = "DayZ Zombie Agent"; class States { /*%FSM*/ class init { name = "init"; itemno = 0; init = /*%FSM*/"_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 > 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 { itemno = 53; priority = 5.000000; to="End"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"isDedicated"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class true { itemno = 10; priority = 0.000000; to="Begin"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(!isNil 'dayz_clientPreload' && {dayz_clientPreload}) && !(isNull _agent)"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class End { name = "End"; itemno = 1; init = /*%FSM*/"if (!isDedicated) then {" \n " if (!isNull _agent) then {" \n " deleteVehicle _agent;" \n " //dayz_spawnZombies = dayz_spawnZombies - 1;" \n " };" \n "} else {" \n " [_agent] call zombie_findOwner;" \n "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { }; }; /*%FSM*/ /*%FSM*/ class Looking_for_Targ { name = "Looking_for_Targ"; itemno = 3; init = /*%FSM*/"_isAlive = alive _agent;" \n "_target = _agent call zombie_findTargetAgent;" \n "_timeN = diag_tickTime;" \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 "//diag_log (""Zombie "" + str(_agent) + "" Wait "");"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Nobody_Near { itemno = 5; priority = 6.000000; to="Cleanup_"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_isSomeone"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Not_Alive { itemno = 4; priority = 5.000000; to="Cleanup_"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_isAlive"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class No_Agent { itemno = 63; priority = 5.000000; to="Cleanup_"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(isNull _agent)"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class player_check { itemno = 52; priority = 2.000000; to="Looking_for_Targ"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(diag_tickTime - _entityTime) > 30"/*%FSM*/; action=/*%FSM*/"_entityTime = diag_tickTime;" \n "" \n "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n "_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Time_Check { itemno = 16; priority = 1.000000; to="Looking_for_Targ"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(diag_tickTime - _timeN) > 1"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Has_Target { itemno = 81; priority = 0.000000; to="Reset_MoveTo"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!(isNull _target)"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Loiter { name = "Loiter"; itemno = 7; init = /*%FSM*/"_isAlive = alive _agent;" \n "_timeN = diag_tickTime;" \n "" \n "//Look for target" \n "_target = _agent call zombie_findTargetAgent;" \n "" \n "//Check for alert var" \n "_newDest = _agent getVariable [""myDest"",nil];" \n "" \n "if ((moveToCompleted _agent) or (moveToFailed _agent) or (Speed _agent == 0)) then { " \n " _myDest = [_agent,_position] call zombie_loiter;" \n "};" \n "" \n "" \n "//Change location to alert" \n "if (!isNil ""_newDest"") then {" \n " if (_newDest distance _myDest > 0) then {" \n " _myDest = _newDest;" \n " };" \n "};" \n "" \n "" \n "//Move to location" \n "" \n "if (_myDest distance (getposATL _agent) > 3) then {" \n " //diag_log format[""Loiter - %1 - [%2,%3] - Range %4"",(typeof _agent),_myDest,_movingTo,(_myDest distance _movingTo)];" \n "" \n " _agent moveTo _myDest;" \n "};" \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 player_check { itemno = 51; priority = 2.000000; to="Loiter"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(diag_tickTime - _entityTime) > 30"/*%FSM*/; action=/*%FSM*/"_entityTime = diag_tickTime;" \n "" \n "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n "_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Time_Check { itemno = 19; priority = 0.000000; to="Loiter"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(diag_tickTime - _timeN) > 1"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Begin { name = "Begin"; itemno = 11; init = /*%FSM*/"_hasMoved = _agent getVariable[""doLoiter"",true];" \n "" \n "_myDest = [_agent,_position] call zombie_loiter;" \n "_newDest = nil;" \n "_movingTo = _myDest;" \n "_array = [];" \n "_waypoint = [];" \n "" \n "_agentReset = false;" \n "" \n "_bodyStay = 60;" \n "" \n "_agent disableAI ""FSM"";" \n "_timeN = diag_tickTime;" \n "" \n "_agent setBehaviour ""CARELESS"";" \n "_agent setSpeedMode ""FULL"";" \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 = diag_tickTime;" \n "" \n "_isCarrier = false;" \n "_chance = round(random 12);" \n "if ((_chance % 4) == 0) then {" \n " _isCarrier = true;" \n "};" \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 { itemno = 66; priority = 0.000000; to="Loiter_1"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_hasMoved"/*%FSM*/; action=/*%FSM*/"" \n "_agent forceSpeed 2;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class wait { itemno = 2; priority = 0.000000; to="Looking_for_Targ"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_hasMoved"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Chase { name = "Chase"; itemno = 15; init = /*%FSM*/"_timeN = diag_tickTime;" \n "" \n "_target = _agent call zombie_findTargetAgent;" \n "_targetPos = _target modelToWorld [0,-1,0];" \n "_isAlive = alive _agent;" \n "_isTargetAlive = alive _target;" \n "" \n "" \n "//Move to location" \n "if (_movingTo distance _targetPos > .5) then {" \n " _agent moveTo _targetPos;" \n " _agent setSpeedMode ""FULL"";" \n "};" \n "" \n "" \n "//Check if LOS" \n "if ((_agroCheck % 8) == 0) then {" \n " _agroCheck = 0;" \n " _cantSee = [_target,_agent] call dayz_losCheck;" \n "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Nobody_Near { itemno = 5; priority = 6.000000; to="Cleanup_"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_isSomeone"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Not_Alive { itemno = 4; priority = 5.000000; to="Cleanup_"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_isAlive"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class No_Agent { itemno = 63; priority = 5.000000; to="Cleanup_"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(isNull _agent)"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class No_Target { itemno = 20; priority = 3.000000; to="Reset_Targeting"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(isNull _target) && ((diag_tickTime - _timeN) > 5)"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Target_Dead { itemno = 56; priority = 3.000000; to="Reset_Targeting"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_isTargetAlive"/*%FSM*/; action=/*%FSM*/"_timeN = diag_tickTime;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class cant_see { itemno = 28; priority = 2.000000; to="Finish_Move"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_cantSee"/*%FSM*/; action=/*%FSM*/"//diag_log (""Cant See"");"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class TimeCheck { itemno = 62; priority = 2.000000; to="Chase"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(diag_tickTime - _timeN) > 2" \n ""/*%FSM*/; action=/*%FSM*/"_agroCheck= _agroCheck + 1;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class InRange { itemno = 77; priority = 1.000000; to="Attacking_Wait"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_agent distance _targetPos < 3.1"/*%FSM*/; action=/*%FSM*/"_agent stop true;" \n "" \n "_myDest = [ _agent modelToWorld [0,0,0]];" \n "" \n "_agent setVariable [""myDest"",(_agent modelToWorld [0,0,0])];" \n "" \n "_agroCheck= 0;"/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Cleanup_ { name = "Cleanup_"; itemno = 25; init = /*%FSM*/"_waitStart = diag_tickTime;" \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_around { itemno = 26; priority = 0.000000; to="End"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_isSomeone"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class someone_here { itemno = 34; priority = 0.000000; to="wait"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_isSomeone"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Finish_Move { name = "Finish_Move"; itemno = 29; init = /*%FSM*/"_timeN = diag_tickTime;" \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 { itemno = 5; priority = 6.000000; to="Cleanup_"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_isSomeone"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class finished { itemno = 30; priority = 1.000000; to="Reset_Targeting"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_agent distance _targetPos < 3"/*%FSM*/; action=/*%FSM*/"//diag_log (""Finished"");"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class too_long { itemno = 42; priority = 0.000000; to="Reset_Targeting"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(diag_tickTime - _timeN) > 20"/*%FSM*/; action=/*%FSM*/"//diag_log (""Timeout"");"/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Move { name = "Move"; itemno = 33; init = /*%FSM*/"_myDest = [_agent,_position] call zombie_loiter;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class True { itemno = 74; priority = 0.000000; to="Loiter_1"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/""/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class wait { name = "wait"; itemno = 35; init = /*%FSM*/"_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n "_isSomeone = ({isPlayer _x} count _list) > 0;" \n "" \n "_timeN = diag_tickTime;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class time_up { itemno = 36; priority = 0.000000; to="End"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(diag_tickTime - _waitStart) > 300"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class nobody_around { itemno = 26; priority = 0.000000; to="End"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_isSomeone"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class deleted { itemno = 47; priority = 0.000000; to="End"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"isNull _agent;"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Time_Check { itemno = 39; priority = 0.000000; to="wait"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(diag_tickTime - _timeN) > 30"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Reset_Targeting { name = "Reset_Targeting"; itemno = 45; init = /*%FSM*/"// reset stance to favorite one" \n "_agent setUnitPos (_agent getVariable [""stance"", ""UP""]);" \n "" \n "//Lets move" \n "_myDest = [_agent,_position] call zombie_loiter;" \n "" \n "//Local" \n "_agent setVariable [""localtargets"",[],false];" \n "" \n "//Remote" \n "_remotetargets = [];" \n "_remotetargets = _agent getVariable [""remotetargets"",[]];" \n "" \n "//Clear remote on reset" \n "if (isNull _agent) then {_remotetargets = [];};" \n "if (count _remotetargets > 0) then {" \n " _agent setVariable [""remotetargets"",[],true];" \n "};" \n "" \n "//Clear Target" \n "_target = objNull;" \n "" \n "//force Speed" \n "_agent forceSpeed 2;" \n "" \n "" \n "//diag_log (""Agent reset"");" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class loiter { itemno = 66; priority = 0.000000; to="Loiter_1"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_hasMoved"/*%FSM*/; action=/*%FSM*/"" \n "_agent forceSpeed 2;"/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Loiter_1 { name = "Loiter_1"; itemno = 67; init = /*%FSM*/"_isAlive = alive _agent;" \n "_timeN = diag_tickTime;" \n "" \n "//Look for target" \n "_target = _agent call zombie_findTargetAgent;" \n "" \n "if (_myDest distance (getposATL _agent) > 3) then {" \n " _agent moveTo _myDest;" \n "};" \n "" \n "//diag_log (""loitering..."" + str(_agent distance (_agent getVariable [""myDest"",_myDest])));"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Nobody_Near { itemno = 5; priority = 6.000000; to="Cleanup_"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_isSomeone"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class No_Agent { itemno = 63; priority = 5.000000; to="Cleanup_"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(isNull _agent)"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Not_Alive { itemno = 4; priority = 5.000000; to="Cleanup_"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_isAlive"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Failed_Move { itemno = 70; priority = 3.000000; to="Move"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"moveToFailed _agent;"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class MoveCompleted_ { itemno = 69; priority = 3.000000; to="Move"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"moveToCompleted _agent;" \n "//_agent distance (_agent getVariable [""myDest"",getposATL _agent]) < 3"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class player_check { itemno = 73; priority = 2.000000; to="Loiter_1"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(diag_tickTime - _entityTime) > 30"/*%FSM*/; action=/*%FSM*/"_entityTime = diag_tickTime;" \n "" \n "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n "_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Not_moving { itemno = 71; priority = 1.000000; to="Move"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(Speed _agent == 0)" \n ""/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Time_Check { itemno = 68; priority = 0.000000; to="Loiter_1"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(diag_tickTime - _timeN) > 1"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Has_Target { itemno = 81; priority = 0.000000; to="Reset_MoveTo"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!(isNull _target)"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Attacking_Wait { name = "Attacking_Wait"; itemno = 78; init = /*%FSM*/"_targetPos = _target modelToWorld [0,-1,0];" \n "" \n "_timeN = diag_tickTime;" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class NotInRange { itemno = 79; priority = 1.000000; to="Chase"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_agent distance _targetPos > 3.1"/*%FSM*/; action=/*%FSM*/"_agent stop false;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class TimeCheck { itemno = 80; priority = 0.000000; to="Attacking_Wait"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"((diag_tickTime - _timeN) > 1)"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Reset_MoveTo { name = "Reset_MoveTo"; itemno = 82; init = /*%FSM*/"_agent moveTo (_agent modelToWorld [0,0,0]);"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class UnitReady { itemno = 14; priority = 5.000000; to="Chase"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"unitReady _agent"/*%FSM*/; action=/*%FSM*/"//Leader cries out" \n "if (_isSomeone) then {" \n " [_agent,""spotted"",0,false] call dayz_zombieSpeak;" \n "};" \n "" \n "if (!_hasMoved) then {" \n " _agent setVariable[""doLoiter"",true,true];" \n "};" \n "" \n "_myDest = [ _agent modelToWorld [0,0,0]];" \n "_agent setVariable [""myDest"",(_agent modelToWorld [0,0,0])];" \n "" \n "_speedMin = DZE_ZombieSpeed select 0;" \n "_speedMax = DZE_ZombieSpeed select 1;" \n "_adjustSpeed = if (_speedMin == _speedMax && ((_speedMin > 0) && (_speedMax > 0))) then {_speedMin} else {_agent getVariable [""speedLimit"", 3]};" \n "" \n "_agent forceSpeed _adjustSpeed;" \n "" \n "//Lets see if we can get the AI to stop running away before heading to the player" \n "_agent moveTo (_agent modelToWorld [0,0,0]);" \n "" \n "_countr = 0;" \n "_losCheck = 0;" \n "_agroCheck = 0;" \n "_cantSee = false;" \n "_cantSeeAnything = false;" \n "" \n "" \n "//diag_log (""Has Target"");"/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class ____FAKE____ { name = "____FAKE____"; itemno = 83; init = /*%FSM*/""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class TargetMoved { itemno = 60; priority = 3.000000; to="____FAKE____"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(((_agent distance _target) >= 3) and ((diag_tickTime - _timeN) > 1))" \n ""/*%FSM*/; action=/*%FSM*/"diag_log (""TargetMoved"");"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class MoveCompleted_ { itemno = 54; priority = 3.000000; to="____FAKE____"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"moveToCompleted _agent;" \n "//_agent distance (_agent getVariable [""myDest"",getposATL _agent]) < 3"/*%FSM*/; action=/*%FSM*/"_myDest = [_agent,_position] call zombie_loiter;" \n "//_myDest = _agent getVariable [""myDest"",getposATL _agent];"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Failed_Move { itemno = 55; priority = 3.000000; to="____FAKE____"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"moveToFailed _agent;"/*%FSM*/; action=/*%FSM*/"_myDest = [_agent,_position] call zombie_loiter;" \n "//_myDest = _agent getVariable [""myDest"",getposATL _agent];" \n ""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Not_moving { itemno = 61; priority = 1.000000; to="____FAKE____"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(Speed _agent == 0)" \n ""/*%FSM*/; action=/*%FSM*/"_myDest = [_agent,_position] call zombie_loiter;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class End_Attack { itemno = 59; priority = 0.000000; to="____FAKE____"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(diag_tickTime - _timeAttack) > 0.3"/*%FSM*/; action=/*%FSM*/"[_agent, ""zombie""] spawn player_zombieAttack;" \n "_agent setVariable[""lastAttack"", diag_tickTime];"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Start_Attack { itemno = 58; priority = 0.000000; to="____FAKE____"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"((local _target) and (_agent distance _target <= 3.3) and ((diag_tickTime - _last) > 2) and (_delta < 1.5) and (_delta > -1.5) and (alive _target))"/*%FSM*/; action=/*%FSM*/"[_agent, ""zombie""] spawn player_attackdelay;" \n "_agent setVariable[""lastAttack"", diag_tickTime];" \n "" \n "_timeAttack = diag_ticktime;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class true { itemno = 46; priority = 0.000000; to="____FAKE____"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"true"/*%FSM*/; action=/*%FSM*/"//diag_log (""Reset"");" \n "" \n ""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class loiter { itemno = 6; priority = 0.000000; to="Loiter"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_hasMoved"/*%FSM*/; action=/*%FSM*/"_myDest = [_agent,_position] call zombie_loiter;" \n "_agent forceSpeed 2;"/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ }; initState="init"; finalStates[] = { "End", }; }; /*%FSM*/