Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*%FSM<COMPILE "C:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Zombie Agent">*/
- /*%FSM<HEAD>*/
- /*
- item0[] = {"init",0,250,-150.000000,-250.000000,-50.000000,-200.000000,0.000000,"init"};
- item1[] = {"End",1,250,200.000000,-250.000000,300.000000,-200.000000,0.000000,"End"};
- item2[] = {"wait",4,218,-150.000000,0.000000,-50.000000,50.000000,0.000000,"wait"};
- item3[] = {"Target_Player_or",2,4346,-150.000000,75.000000,-50.000000,125.000000,0.000000,"Target Player or" \n "Sleep"};
- item4[] = {"Not_Alive",4,218,125.000000,0.000000,225.000000,50.000000,5.000000,"Not" \n "Alive"};
- item5[] = {"Nobody_Near",4,218,275.000000,0.000000,375.000000,50.000000,4.000000,"Nobody" \n "Near"};
- item6[] = {"true",8,218,-150.000000,-175.000000,-50.000000,-125.000000,0.000000,"true"};
- item7[] = {"Begin",2,250,-150.000000,-100.000000,-50.000000,-50.000000,0.000000,"Begin"};
- item8[] = {"",7,210,-104.000008,-16.500004,-95.999992,-8.499997,0.000000,""};
- item9[] = {"Has_Target",4,218,-150.000000,175.000000,-50.000000,225.000000,3.000000,"Has" \n "Target"};
- item10[] = {"Chase",2,250,-150.000000,275.000000,-50.000000,325.000000,0.000000,"Chase"};
- item11[] = {"Time_Check",4,218,-25.000000,25.000000,75.000000,75.000000,0.000000,"Time" \n "Check"};
- item12[] = {"Time_Check",4,218,-275.000000,275.000000,-175.000000,325.000000,0.000000,"Time" \n "Check"};
- item13[] = {"is_Dedicated",4,218,50.000000,-250.000000,150.000000,-200.000000,5.000000,"is" \n "Dedicated"};
- item14[] = {"target_check",4,218,-25.000000,275.000000,75.000000,325.000000,1.000000,"target" \n "check"};
- item15[] = {"waitclean",2,250,275.000000,-75.000000,375.000000,-25.000000,0.000000,"waitclean"};
- item16[] = {"waitdead",2,250,125.000000,-75.000000,225.000000,-25.000000,0.000000,"waitdead"};
- item17[] = {"waitdead_timeup",4,218,125.000000,-150.000000,225.000000,-100.000000,5.000000,"waitdead timeup"};
- item18[] = {"waitdead_timeup",4,218,275.000000,-150.000000,375.000000,-100.000000,5.000000,"waitdead timeup"};
- item19[] = {"",7,210,233.500000,146.000000,241.500000,153.999985,0.000000,""};
- link0[] = {0,6};
- link1[] = {0,13};
- link2[] = {2,3};
- link3[] = {3,9};
- link4[] = {3,11};
- link5[] = {3,19};
- link6[] = {4,16};
- link7[] = {5,15};
- link8[] = {6,7};
- link9[] = {7,8};
- link10[] = {8,2};
- link11[] = {9,10};
- link12[] = {10,12};
- link13[] = {10,14};
- link14[] = {10,19};
- link15[] = {11,3};
- link16[] = {12,10};
- link17[] = {13,1};
- link18[] = {14,10};
- link19[] = {15,18};
- link20[] = {16,17};
- link21[] = {17,1};
- link22[] = {18,1};
- link23[] = {19,4};
- link24[] = {19,5};
- globals[] = {25.000000,1,0,0,0,640,480,1,106,6316128,1,-533.898132,436.396240,557.002441,-317.154419,979,882,1};
- window[] = {2,-1,-1,-32000,-32000,810,30,1238,30,3,1001};
- *//*%FSM</HEAD>*/
- class FSM
- {
- fsmName = "DayZ Zombie Agent";
- class States
- {
- /*%FSM<STATE "init">*/
- class init
- {
- name = "init";
- init = /*%FSM<STATEINIT""">*/"_position = _this select 0;" \n
- "_agent = _this select 1;"/*%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""">*/"dayz_clientPreload and !(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
- " if (_isAlive) then {" \n
- " _mBuilding = nearestBuilding _agent;" \n
- " _numCleanup = _mBuilding getVariable [""despawnedZeds"", 0];" \n
- " if (_numCleanup < 50) then {" \n
- " _numCleanup = _numCleanup + 1;" \n
- " _mBuilding setVariable [""despawnedZeds"", _numCleanup, true];" \n
- " diag_log format [""CLEANUP YUM RESPAWN COUNT %1 | %2"",_numCleanup,_mBuilding];" \n
- " };" \n
- " };" \n
- " deleteVehicle _agent;" \n
- " };" \n
- "} else {" \n
- " [_agent] call zombie_findOwner;" \n
- "};"/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "Target_Player_or">*/
- class Target_Player_or
- {
- name = "Target_Player_or";
- init = /*%FSM<STATEINIT""">*/"_isAlive = alive _agent;" \n
- "" \n
- "if ((_agent distance player) > 250) then {" \n
- "_isSomeone = false;" \n
- "} else {" \n
- "//if ((_agent distance player) < 250) then {" \n
- "_target = player;" \n
- "_targetSet = true;" \n
- "_newDest = getPosATL _target;" \n
- "_isSomeone = true;" \n
- "};" \n
- "_timeN = time;// + _rndYumT + _rndYum;" \n
- "" \n
- "//diag_log format [""ZEDSPAWN YUM AGENT TARGETSET | AGENT %1 | TARGET %2 | SET %3"",_agent,_target,_targetSet];"/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "Not_Alive">*/
- class Not_Alive
- {
- priority = 5.000000;
- to="waitdead";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"!_isAlive"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- /*%FSM<LINK "Nobody_Near">*/
- class Nobody_Near
- {
- priority = 4.000000;
- to="waitclean";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"!_isSomeone"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- /*%FSM<LINK "Has_Target">*/
- class Has_Target
- {
- priority = 3.000000;
- to="Chase";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"_targetSet"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/"//Leader cries out" \n
- "if (_isSomeone) then {" \n
- " [_agent,""spotted"",0,false] call dayz_zombieSpeak;" \n
- "};" \n
- "//_targetLast = getPosATL _target;"/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- /*%FSM<LINK "Time_Check">*/
- class Time_Check
- {
- priority = 0.000000;
- to="Target_Player_or";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"(time - _timeN) > 30"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "Begin">*/
- class Begin
- {
- name = "Begin";
- init = /*%FSM<STATEINIT""">*/"//_doLoiter = _agent getVariable[""doLoiter"",true];" \n
- "" \n
- "_myDest = _position;" \n
- "_newDest = _position;" \n
- "_array = [];" \n
- "" \n
- "_bodyStay = 60;" \n
- "" \n
- "_agent disableAI ""FSM"";" \n
- "_agent setBehaviour ""CARELESS"";" \n
- "_agent setCombatMode ""RED"";" \n
- "_agent setSkill 0;" \n
- "" \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
- "_targetSet = false;" \n
- "_rndYum = floor(random 2);" \n
- "_rndYumT = random 3;" \n
- "_rndYum = _rndYum + 1;" \n
- "//Spawn roaming script (individual to unit)" \n
- "_entityTime = time;" \n
- "_hasMoved = false;" \n
- "_timeN = time + _rndYumT - _rndYum;" \n
- "" \n
- ""/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "wait">*/
- class wait
- {
- priority = 0.000000;
- to="Target_Player_or";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"(time - _timeN) > 15"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "Chase">*/
- class Chase
- {
- name = "Chase";
- init = /*%FSM<STATEINIT""">*/"_timeN = time + _rndYumT;" \n
- "" \n
- "_isAlive = alive _agent;" \n
- "" \n
- "" \n
- "//_myDest = getPosATL _agent;" \n
- "_newDest = getPosATL _target;" \n
- "if (!isNil ""_newDest"") then {" \n
- "// if (_newDest distance _targetLast > 0) then {" \n
- " //_myDest = _newDest;" \n
- " _agent moveTo _newDest;" \n
- " _agent forceSpeed 2;" \n
- "// };" \n
- "};" \n
- "if (!isNull _target) then {" \n
- " _agent setVariable [""myDest"",_newDest];" \n
- "};" \n
- "//_targetLast = _newDest;"/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "Not_Alive">*/
- class Not_Alive
- {
- priority = 5.000000;
- to="waitdead";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"!_isAlive"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- /*%FSM<LINK "Nobody_Near">*/
- class Nobody_Near
- {
- priority = 4.000000;
- to="waitclean";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"!_isSomeone"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- /*%FSM<LINK "target_check">*/
- class target_check
- {
- priority = 1.000000;
- to="Chase";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"(time - _entityTime) > 22"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/"_entityTime = time + _rndYum;" \n
- "" \n
- "if ((_agent distance player) > 250) then { " \n
- " _target = objNull;" \n
- "// _targetSet = false;" \n
- "// if ((_agent distance player) > 250) then {" \n
- " _isSomeone = false;" \n
- " diag_log format [""ZEDSPAWN YUM AGENT TOO FAR | %1 | TARGET %2 |"",_agent,_target];" \n
- "// };" \n
- "} else { " \n
- " _target = player;" \n
- " //diag_log format [""ZEDSPAWN YUM AGENT CHASE | %1 | TARGET %2 |"",_agent,_target];" \n
- "};"/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- /*%FSM<LINK "Time_Check">*/
- class Time_Check
- {
- priority = 0.000000;
- to="Chase";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"(time - _timeN) > 3"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "waitclean">*/
- class waitclean
- {
- name = "waitclean";
- init = /*%FSM<STATEINIT""">*/"_waitClean = time - _rndYum - _rndYumT;"/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "waitdead_timeup">*/
- class waitdead_timeup
- {
- priority = 5.000000;
- to="End";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"(time - _waitClean) > _rndYumT"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/"dayz_spawnZombies = dayz_spawnZombies - 1;" \n
- "_isAlive = alive _agent;"/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "waitdead">*/
- class waitdead
- {
- name = "waitdead";
- init = /*%FSM<STATEINIT""">*/"_waitDead = time;"/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "waitdead_timeup">*/
- class waitdead_timeup
- {
- priority = 5.000000;
- to="End";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"(time - _waitDead) > _bodyStay"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/"dayz_spawnZombies = dayz_spawnZombies - 1;"/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- };
- initState="init";
- finalStates[] =
- {
- "End",
- };
- };
- /*%FSM</COMPILE>*/
Advertisement
Add Comment
Please, Sign In to add comment