mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
Variable _hasMoved needs to be set to true for internal zombies after initial aggro. Internal zombies become loiterers once they have moved from their original positions. Variable "doLoiter" can be destroyed after initial aggro. It is not used anymore.
1129 lines
44 KiB
Plaintext
1129 lines
44 KiB
Plaintext
/*%FSM<COMPILE "C:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Zombie Agent">*/
|
|
/*%FSM<HEAD>*/
|
|
/*
|
|
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,218,-275.000000,275.000000,-175.000000,325.000000,5.000000,"UnitReady"};
|
|
item15[] = {"Chase",2,4346,-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,3320,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[] = {25.000000,1,0,0,0,640,480,1,189,6316128,1,-713.213928,288.267639,611.326172,-131.708481,806,598,1};
|
|
window[] = {2,-1,-1,-32000,-32000,831,130,1338,130,3,824};
|
|
*//*%FSM</HEAD>*/
|
|
class FSM
|
|
{
|
|
fsmName = "DayZ Zombie Agent";
|
|
class States
|
|
{
|
|
/*%FSM<STATE "init">*/
|
|
class init
|
|
{
|
|
name = "init";
|
|
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 > 2) then {" \n
|
|
" _secondHand = true;" \n
|
|
" diag_log (""Second Hand Zombie Initialized: "" + str(_this));" \n
|
|
"};"/*%FSM</STATEINIT""">*/;
|
|
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
|
class Links
|
|
{
|
|
/*%FSM<LINK "is_Dedicated">*/
|
|
class is_Dedicated
|
|
{
|
|
priority = 5.000000;
|
|
to="End";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"isDedicated"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "true">*/
|
|
class true
|
|
{
|
|
priority = 0.000000;
|
|
to="Begin";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(!isNil 'dayz_clientPreload' && {dayz_clientPreload}) && !(isNull _agent)"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
};
|
|
};
|
|
/*%FSM</STATE>*/
|
|
/*%FSM<STATE "End">*/
|
|
class End
|
|
{
|
|
name = "End";
|
|
init = /*%FSM<STATEINIT""">*/"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</STATEINIT""">*/;
|
|
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
|
class Links
|
|
{
|
|
};
|
|
};
|
|
/*%FSM</STATE>*/
|
|
/*%FSM<STATE "Looking_for_Targ">*/
|
|
class Looking_for_Targ
|
|
{
|
|
name = "Looking_for_Targ";
|
|
init = /*%FSM<STATEINIT""">*/"_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</STATEINIT""">*/;
|
|
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
|
class Links
|
|
{
|
|
/*%FSM<LINK "Nobody_Near">*/
|
|
class Nobody_Near
|
|
{
|
|
priority = 6.000000;
|
|
to="Cleanup_";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"!_isSomeone"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "Not_Alive">*/
|
|
class Not_Alive
|
|
{
|
|
priority = 5.000000;
|
|
to="Cleanup_";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"!_isAlive"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "No_Agent">*/
|
|
class No_Agent
|
|
{
|
|
priority = 5.000000;
|
|
to="Cleanup_";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(isNull _agent)"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "player_check">*/
|
|
class player_check
|
|
{
|
|
priority = 2.000000;
|
|
to="Looking_for_Targ";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _entityTime) > 30"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"_entityTime = diag_tickTime;" \n
|
|
"" \n
|
|
"_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n
|
|
"_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "Time_Check">*/
|
|
class Time_Check
|
|
{
|
|
priority = 1.000000;
|
|
to="Looking_for_Targ";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _timeN) > 1"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "Has_Target">*/
|
|
class Has_Target
|
|
{
|
|
priority = 0.000000;
|
|
to="Reset_MoveTo";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"!(isNull _target)"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
};
|
|
};
|
|
/*%FSM</STATE>*/
|
|
/*%FSM<STATE "Loiter">*/
|
|
class Loiter
|
|
{
|
|
name = "Loiter";
|
|
init = /*%FSM<STATEINIT""">*/"_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</STATEINIT""">*/;
|
|
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
|
class Links
|
|
{
|
|
/*%FSM<LINK "player_check">*/
|
|
class player_check
|
|
{
|
|
priority = 2.000000;
|
|
to="Loiter";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _entityTime) > 30"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"_entityTime = diag_tickTime;" \n
|
|
"" \n
|
|
"_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n
|
|
"_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "Time_Check">*/
|
|
class Time_Check
|
|
{
|
|
priority = 0.000000;
|
|
to="Loiter";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _timeN) > 1"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
};
|
|
};
|
|
/*%FSM</STATE>*/
|
|
/*%FSM<STATE "Begin">*/
|
|
class Begin
|
|
{
|
|
name = "Begin";
|
|
init = /*%FSM<STATEINIT""">*/"_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</STATEINIT""">*/;
|
|
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
|
class Links
|
|
{
|
|
/*%FSM<LINK "loiter">*/
|
|
class loiter
|
|
{
|
|
priority = 0.000000;
|
|
to="Loiter_1";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"_hasMoved"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"" \n
|
|
"_agent forceSpeed 2;"/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "wait">*/
|
|
class wait
|
|
{
|
|
priority = 0.000000;
|
|
to="Looking_for_Targ";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"!_hasMoved"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
};
|
|
};
|
|
/*%FSM</STATE>*/
|
|
/*%FSM<STATE "Chase">*/
|
|
class Chase
|
|
{
|
|
name = "Chase";
|
|
init = /*%FSM<STATEINIT""">*/"_timeN = diag_tickTime;" \n
|
|
"" \n
|
|
"_target = _agent call zombie_findTargetAgent;" \n
|
|
"//_targetPos = _target modelToWorld [0,-1,0];" \n
|
|
"_targetPos = getPosATL _target;" \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</STATEINIT""">*/;
|
|
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
|
class Links
|
|
{
|
|
/*%FSM<LINK "Nobody_Near">*/
|
|
class Nobody_Near
|
|
{
|
|
priority = 6.000000;
|
|
to="Cleanup_";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"!_isSomeone"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "Not_Alive">*/
|
|
class Not_Alive
|
|
{
|
|
priority = 5.000000;
|
|
to="Cleanup_";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"!_isAlive"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "No_Agent">*/
|
|
class No_Agent
|
|
{
|
|
priority = 5.000000;
|
|
to="Cleanup_";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(isNull _agent)"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "No_Target">*/
|
|
class No_Target
|
|
{
|
|
priority = 3.000000;
|
|
to="Reset_Targeting";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(isNull _target) && ((diag_tickTime - _timeN) > 5)"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "Target_Dead">*/
|
|
class Target_Dead
|
|
{
|
|
priority = 3.000000;
|
|
to="Reset_Targeting";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"!_isTargetAlive"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"_timeN = diag_tickTime;"/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "cant_see">*/
|
|
class cant_see
|
|
{
|
|
priority = 2.000000;
|
|
to="Finish_Move";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"_cantSee"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"//diag_log (""Cant See"");"/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "TimeCheck">*/
|
|
class TimeCheck
|
|
{
|
|
priority = 2.000000;
|
|
to="Chase";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _timeN) > 2" \n
|
|
""/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"_agroCheck= _agroCheck + 1;"/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "InRange">*/
|
|
class InRange
|
|
{
|
|
priority = 1.000000;
|
|
to="Attacking_Wait";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"_agent distance _targetPos < 3.1"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"_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</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
};
|
|
};
|
|
/*%FSM</STATE>*/
|
|
/*%FSM<STATE "Cleanup_">*/
|
|
class Cleanup_
|
|
{
|
|
name = "Cleanup_";
|
|
init = /*%FSM<STATEINIT""">*/"_waitStart = diag_tickTime;" \n
|
|
"" \n
|
|
"_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n
|
|
"_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM</STATEINIT""">*/;
|
|
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
|
class Links
|
|
{
|
|
/*%FSM<LINK "nobody_around">*/
|
|
class nobody_around
|
|
{
|
|
priority = 0.000000;
|
|
to="End";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"!_isSomeone"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "someone_here">*/
|
|
class someone_here
|
|
{
|
|
priority = 0.000000;
|
|
to="wait";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"_isSomeone"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
};
|
|
};
|
|
/*%FSM</STATE>*/
|
|
/*%FSM<STATE "Finish_Move">*/
|
|
class Finish_Move
|
|
{
|
|
name = "Finish_Move";
|
|
init = /*%FSM<STATEINIT""">*/"_timeN = diag_tickTime;" \n
|
|
"" \n
|
|
"_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n
|
|
"_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM</STATEINIT""">*/;
|
|
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
|
class Links
|
|
{
|
|
/*%FSM<LINK "Nobody_Near">*/
|
|
class Nobody_Near
|
|
{
|
|
priority = 6.000000;
|
|
to="Cleanup_";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"!_isSomeone"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "finished">*/
|
|
class finished
|
|
{
|
|
priority = 1.000000;
|
|
to="Reset_Targeting";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"_agent distance _targetPos < 3"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"//diag_log (""Finished"");"/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "too_long">*/
|
|
class too_long
|
|
{
|
|
priority = 0.000000;
|
|
to="Reset_Targeting";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _timeN) > 20"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"//diag_log (""Timeout"");"/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
};
|
|
};
|
|
/*%FSM</STATE>*/
|
|
/*%FSM<STATE "Move">*/
|
|
class Move
|
|
{
|
|
name = "Move";
|
|
init = /*%FSM<STATEINIT""">*/"_myDest = [_agent,_position] call zombie_loiter;"/*%FSM</STATEINIT""">*/;
|
|
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
|
class Links
|
|
{
|
|
/*%FSM<LINK "True">*/
|
|
class True
|
|
{
|
|
priority = 0.000000;
|
|
to="Loiter_1";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/""/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
};
|
|
};
|
|
/*%FSM</STATE>*/
|
|
/*%FSM<STATE "wait">*/
|
|
class wait
|
|
{
|
|
name = "wait";
|
|
init = /*%FSM<STATEINIT""">*/"_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n
|
|
"_isSomeone = ({isPlayer _x} count _list) > 0;" \n
|
|
"" \n
|
|
"_timeN = diag_tickTime;"/*%FSM</STATEINIT""">*/;
|
|
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
|
class Links
|
|
{
|
|
/*%FSM<LINK "time_up">*/
|
|
class time_up
|
|
{
|
|
priority = 0.000000;
|
|
to="End";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _waitStart) > 300"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "nobody_around">*/
|
|
class nobody_around
|
|
{
|
|
priority = 0.000000;
|
|
to="End";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"!_isSomeone"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "deleted">*/
|
|
class deleted
|
|
{
|
|
priority = 0.000000;
|
|
to="End";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"isNull _agent;"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "Time_Check">*/
|
|
class Time_Check
|
|
{
|
|
priority = 0.000000;
|
|
to="wait";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _timeN) > 30"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
};
|
|
};
|
|
/*%FSM</STATE>*/
|
|
/*%FSM<STATE "Reset_Targeting">*/
|
|
class Reset_Targeting
|
|
{
|
|
name = "Reset_Targeting";
|
|
init = /*%FSM<STATEINIT""">*/"// 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</STATEINIT""">*/;
|
|
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
|
class Links
|
|
{
|
|
/*%FSM<LINK "loiter">*/
|
|
class loiter
|
|
{
|
|
priority = 0.000000;
|
|
to="Loiter_1";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"_hasMoved"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"" \n
|
|
"_agent forceSpeed 2;"/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
};
|
|
};
|
|
/*%FSM</STATE>*/
|
|
/*%FSM<STATE "Loiter_1">*/
|
|
class Loiter_1
|
|
{
|
|
name = "Loiter_1";
|
|
init = /*%FSM<STATEINIT""">*/"_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</STATEINIT""">*/;
|
|
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
|
class Links
|
|
{
|
|
/*%FSM<LINK "Nobody_Near">*/
|
|
class Nobody_Near
|
|
{
|
|
priority = 6.000000;
|
|
to="Cleanup_";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"!_isSomeone"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "No_Agent">*/
|
|
class No_Agent
|
|
{
|
|
priority = 5.000000;
|
|
to="Cleanup_";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(isNull _agent)"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "Not_Alive">*/
|
|
class Not_Alive
|
|
{
|
|
priority = 5.000000;
|
|
to="Cleanup_";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"!_isAlive"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "Failed_Move">*/
|
|
class Failed_Move
|
|
{
|
|
priority = 3.000000;
|
|
to="Move";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"moveToFailed _agent;"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "MoveCompleted_">*/
|
|
class MoveCompleted_
|
|
{
|
|
priority = 3.000000;
|
|
to="Move";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"moveToCompleted _agent;" \n
|
|
"//_agent distance (_agent getVariable [""myDest"",getposATL _agent]) < 3"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "player_check">*/
|
|
class player_check
|
|
{
|
|
priority = 2.000000;
|
|
to="Loiter_1";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _entityTime) > 30"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"_entityTime = diag_tickTime;" \n
|
|
"" \n
|
|
"_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n
|
|
"_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "Not_moving">*/
|
|
class Not_moving
|
|
{
|
|
priority = 1.000000;
|
|
to="Move";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(Speed _agent == 0)" \n
|
|
""/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "Time_Check">*/
|
|
class Time_Check
|
|
{
|
|
priority = 0.000000;
|
|
to="Loiter_1";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _timeN) > 1"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "Has_Target">*/
|
|
class Has_Target
|
|
{
|
|
priority = 0.000000;
|
|
to="Reset_MoveTo";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"!(isNull _target)"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
};
|
|
};
|
|
/*%FSM</STATE>*/
|
|
/*%FSM<STATE "Attacking_Wait">*/
|
|
class Attacking_Wait
|
|
{
|
|
name = "Attacking_Wait";
|
|
init = /*%FSM<STATEINIT""">*/"_targetPos = _target modelToWorld [0,-1,0];" \n
|
|
"" \n
|
|
"_timeN = diag_tickTime;" \n
|
|
""/*%FSM</STATEINIT""">*/;
|
|
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
|
class Links
|
|
{
|
|
/*%FSM<LINK "NotInRange">*/
|
|
class NotInRange
|
|
{
|
|
priority = 1.000000;
|
|
to="Chase";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"_agent distance _targetPos > 3.1"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"_agent stop false;"/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "TimeCheck">*/
|
|
class TimeCheck
|
|
{
|
|
priority = 0.000000;
|
|
to="Attacking_Wait";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _timeN) > 1)"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
};
|
|
};
|
|
/*%FSM</STATE>*/
|
|
/*%FSM<STATE "Reset_MoveTo">*/
|
|
class Reset_MoveTo
|
|
{
|
|
name = "Reset_MoveTo";
|
|
init = /*%FSM<STATEINIT""">*/"_agent moveTo (_agent modelToWorld [0,0,0]);"/*%FSM</STATEINIT""">*/;
|
|
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
|
class Links
|
|
{
|
|
/*%FSM<LINK "UnitReady">*/
|
|
class UnitReady
|
|
{
|
|
priority = 5.000000;
|
|
to="Chase";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"unitReady _agent"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"//Leader cries out" \n
|
|
"if (_isSomeone) then {" \n
|
|
" [_agent,""spotted"",0,false] call dayz_zombieSpeak;" \n
|
|
"};" \n
|
|
"" \n
|
|
"// _hasMoved needs to be set to true for all zombies." \n
|
|
"_hasMoved = true;" \n
|
|
"" \n
|
|
"// doLoiter variable can be destroyed. It is not used anymore." \n
|
|
"_agent setVariable[""doLoiter"",nil];" \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</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
};
|
|
};
|
|
/*%FSM</STATE>*/
|
|
/*%FSM<STATE "____FAKE____">*/
|
|
class ____FAKE____
|
|
{
|
|
name = "____FAKE____";
|
|
init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
|
|
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
|
class Links
|
|
{
|
|
/*%FSM<LINK "TargetMoved">*/
|
|
class TargetMoved
|
|
{
|
|
priority = 3.000000;
|
|
to="____FAKE____";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(((_agent distance _target) >= 3) and ((diag_tickTime - _timeN) > 1))" \n
|
|
""/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"diag_log (""TargetMoved"");"/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "MoveCompleted_">*/
|
|
class MoveCompleted_
|
|
{
|
|
priority = 3.000000;
|
|
to="____FAKE____";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"moveToCompleted _agent;" \n
|
|
"//_agent distance (_agent getVariable [""myDest"",getposATL _agent]) < 3"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"_myDest = [_agent,_position] call zombie_loiter;" \n
|
|
"//_myDest = _agent getVariable [""myDest"",getposATL _agent];"/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "Failed_Move">*/
|
|
class Failed_Move
|
|
{
|
|
priority = 3.000000;
|
|
to="____FAKE____";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"moveToFailed _agent;"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"_myDest = [_agent,_position] call zombie_loiter;" \n
|
|
"//_myDest = _agent getVariable [""myDest"",getposATL _agent];" \n
|
|
""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "Not_moving">*/
|
|
class Not_moving
|
|
{
|
|
priority = 1.000000;
|
|
to="____FAKE____";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(Speed _agent == 0)" \n
|
|
""/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"_myDest = [_agent,_position] call zombie_loiter;"/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "End_Attack">*/
|
|
class End_Attack
|
|
{
|
|
priority = 0.000000;
|
|
to="____FAKE____";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _timeAttack) > 0.3"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"[_agent, ""zombie""] spawn player_zombieAttack;" \n
|
|
"_agent setVariable[""lastAttack"", diag_tickTime];"/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "Start_Attack">*/
|
|
class Start_Attack
|
|
{
|
|
priority = 0.000000;
|
|
to="____FAKE____";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"((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</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"[_agent, ""zombie""] spawn player_attackdelay;" \n
|
|
"_agent setVariable[""lastAttack"", diag_tickTime];" \n
|
|
"" \n
|
|
"_timeAttack = diag_ticktime;"/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "true">*/
|
|
class true
|
|
{
|
|
priority = 0.000000;
|
|
to="____FAKE____";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"//diag_log (""Reset"");" \n
|
|
"" \n
|
|
""/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
/*%FSM<LINK "loiter">*/
|
|
class loiter
|
|
{
|
|
priority = 0.000000;
|
|
to="Loiter";
|
|
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
|
condition=/*%FSM<CONDITION""">*/"_hasMoved"/*%FSM</CONDITION""">*/;
|
|
action=/*%FSM<ACTION""">*/"_myDest = [_agent,_position] call zombie_loiter;" \n
|
|
"_agent forceSpeed 2;"/*%FSM</ACTION""">*/;
|
|
};
|
|
/*%FSM</LINK>*/
|
|
};
|
|
};
|
|
/*%FSM</STATE>*/
|
|
};
|
|
initState="init";
|
|
finalStates[] =
|
|
{
|
|
"End",
|
|
};
|
|
};
|
|
/*%FSM</COMPILE>*/
|