mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-21 02:46:29 +03:00
0.1
This commit is contained in:
169
dayz_code/system/animal_agent.fsm
Normal file
169
dayz_code/system/animal_agent.fsm
Normal file
@@ -0,0 +1,169 @@
|
||||
/*%FSM<COMPILE "C:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Animal Agent">*/
|
||||
/*%FSM<HEAD>*/
|
||||
/*
|
||||
item0[] = {"init",0,250,-150.000000,75.000000,-50.000000,125.000000,0.000000,"init"};
|
||||
item1[] = {"",7,210,-104.000000,321.000000,-96.000000,329.000000,0.000000,""};
|
||||
item2[] = {"End",1,250,100.000000,75.000000,200.000000,125.000000,0.000000,"End"};
|
||||
item3[] = {"",7,210,-104.000000,396.000000,-96.000000,404.000000,0.000000,""};
|
||||
item4[] = {"Not_Alive",4,218,-25.000000,300.000000,75.000000,350.000000,5.000000,"Not" \n "Alive"};
|
||||
item5[] = {"Nobody_Near",4,218,-25.000000,375.000000,75.000000,425.000000,4.000000,"Nobody" \n "Near"};
|
||||
item6[] = {"Loiter",2,4346,-150.000000,225.000000,-50.000000,275.000000,0.000000,"Loiter"};
|
||||
item7[] = {"In_Position",4,218,-25.000000,225.000000,75.000000,275.000000,1.000000,"In Position"};
|
||||
item8[] = {"preloaded",4,218,-150.000000,150.000000,-50.000000,200.000000,0.000000,"preloaded"};
|
||||
item9[] = {"",7,210,146.000000,321.000000,154.000000,329.000000,0.000000,""};
|
||||
item10[] = {"",7,210,146.000000,396.000000,154.000000,404.000000,0.000000,""};
|
||||
item11[] = {"Cleanup",2,250,100.000000,225.000000,200.000000,275.000000,0.000000,"Cleanup"};
|
||||
item12[] = {"time_up",4,218,100.000000,150.000000,200.000000,200.000000,0.000000,"time" \n "up"};
|
||||
item13[] = {"player_check",4,218,-250.000000,175.000000,-150.000000,225.000000,0.000000,"player" \n "check"};
|
||||
link0[] = {0,8};
|
||||
link1[] = {1,3};
|
||||
link2[] = {1,4};
|
||||
link3[] = {3,5};
|
||||
link4[] = {4,9};
|
||||
link5[] = {5,10};
|
||||
link6[] = {6,1};
|
||||
link7[] = {6,7};
|
||||
link8[] = {6,13};
|
||||
link9[] = {7,6};
|
||||
link10[] = {8,6};
|
||||
link11[] = {9,11};
|
||||
link12[] = {10,9};
|
||||
link13[] = {11,12};
|
||||
link14[] = {12,2};
|
||||
link15[] = {13,6};
|
||||
globals[] = {25.000000,1,0,0,0,640,480,1,84,6316128,1,-297.044281,256.119873,569.827881,-79.569984,776,911,1};
|
||||
window[] = {2,-1,-1,-32000,-32000,1026,25,1233,25,3,794};
|
||||
*//*%FSM</HEAD>*/
|
||||
class FSM
|
||||
{
|
||||
fsmName = "DayZ Animal Agent";
|
||||
class States
|
||||
{
|
||||
/*%FSM<STATE "init">*/
|
||||
class init
|
||||
{
|
||||
name = "init";
|
||||
init = /*%FSM<STATEINIT""">*/"_position = _this select 0;" \n
|
||||
"_agent = _this select 1;" \n
|
||||
"" \n
|
||||
"_pos = _position;" \n
|
||||
"_isSomeone = true;"/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "preloaded">*/
|
||||
class preloaded
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Loiter";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"dayz_clientPreload"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "End">*/
|
||||
class End
|
||||
{
|
||||
name = "End";
|
||||
init = /*%FSM<STATEINIT""">*/"if (!_isSomeone) then {" \n
|
||||
" deleteVehicle _agent;" \n
|
||||
"} else {" \n
|
||||
" dayz_bodyMonitor set [count dayz_bodyMonitor,_agent];" \n
|
||||
"};" \n
|
||||
""/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "Loiter">*/
|
||||
class Loiter
|
||||
{
|
||||
name = "Loiter";
|
||||
init = /*%FSM<STATEINIT""">*/"_isAlive = alive _agent;" \n
|
||||
"" \n
|
||||
"//_agent forceSpeed 2;" \n
|
||||
"_entityTime = time;"/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%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 "Nobody_Near">*/
|
||||
class Nobody_Near
|
||||
{
|
||||
priority = 4.000000;
|
||||
to="Cleanup";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"!_isSomeone"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "In_Position">*/
|
||||
class In_Position
|
||||
{
|
||||
priority = 1.000000;
|
||||
to="Loiter";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"_agent distance _pos < 3"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_pos = [_position,10,90,4,0,5,0] call BIS_fnc_findSafePos;" \n
|
||||
"_agent moveTo _pos;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "player_check">*/
|
||||
class player_check
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Loiter";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"(time - _entityTime) > 30"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_entityTime = time;" \n
|
||||
"" \n
|
||||
"_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n
|
||||
"_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "Cleanup">*/
|
||||
class Cleanup
|
||||
{
|
||||
name = "Cleanup";
|
||||
init = /*%FSM<STATEINIT""">*/"_timeA = time;"/*%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""">*/"(time - _timeA) > 120"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
};
|
||||
initState="init";
|
||||
finalStates[] =
|
||||
{
|
||||
"End",
|
||||
};
|
||||
};
|
||||
/*%FSM</COMPILE>*/
|
||||
19
dayz_code/system/building_monitor.sqf
Normal file
19
dayz_code/system/building_monitor.sqf
Normal file
@@ -0,0 +1,19 @@
|
||||
private["_building","_GroupMarker","_list","_nearby","_run"];
|
||||
_building = _this select 0;
|
||||
_GroupMarker = _this select 1;
|
||||
_items = _this select 2;
|
||||
_run = true;
|
||||
_nearby = false;
|
||||
while {_run} do {
|
||||
if (isNull _building) then {_run = false};
|
||||
_nearby = false;
|
||||
{
|
||||
if (_x distance _building < 500) then {_nearby = true};
|
||||
} forEach (call BIS_fnc_listPlayers);
|
||||
if (!_nearby) then {_run = false};
|
||||
sleep 5;
|
||||
};
|
||||
{deleteVehicle _x;} forEach _items;
|
||||
|
||||
|
||||
_building setVariable ["looted",(DateToNumber date),true];
|
||||
848
dayz_code/system/dog_agent.fsm
Normal file
848
dayz_code/system/dog_agent.fsm
Normal file
@@ -0,0 +1,848 @@
|
||||
/*%FSM<COMPILE "C:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Dog Agent">*/
|
||||
/*%FSM<HEAD>*/
|
||||
/*
|
||||
item0[] = {"init",0,250,-150.000000,-75.000000,-50.000000,-25.000000,0.000000,"init"};
|
||||
item1[] = {"idle_exceeded",4,218,0.000000,225.000000,100.000000,275.000000,0.000000,"idle" \n "exceeded"};
|
||||
item2[] = {"master_moved",4,218,-150.000000,300.000000,-50.000000,350.000000,0.000000,"master" \n "moved"};
|
||||
item3[] = {"moving",2,250,-150.000000,375.000000,-50.000000,425.000000,0.000000,"moving"};
|
||||
item4[] = {"close",4,218,-275.000000,300.000000,-175.000000,350.000000,0.000000,"close"};
|
||||
item5[] = {"",7,210,-229.000000,246.000000,-221.000000,254.000000,0.000000,""};
|
||||
item6[] = {"Waiting",2,250,-150.000000,225.000000,-50.000000,275.000000,0.000000,"Waiting"};
|
||||
item7[] = {"preloaded",4,218,-150.000000,0.000000,-50.000000,50.000000,0.000000,"preloaded"};
|
||||
item8[] = {"reorientate",4,218,-150.000000,450.000000,-50.000000,500.000000,0.000000,"reorientate"};
|
||||
item9[] = {"Sitting",2,250,125.000000,225.000000,225.000000,275.000000,0.000000,"Sitting"};
|
||||
item10[] = {"master_moved",4,218,125.000000,300.000000,225.000000,350.000000,0.000000,"master" \n "moved"};
|
||||
item11[] = {"Getting_Up",2,250,125.000000,375.000000,225.000000,425.000000,0.000000,"Getting Up"};
|
||||
item12[] = {"Up",4,218,0.000000,375.000000,100.000000,425.000000,0.000000,"Up"};
|
||||
item13[] = {"dead",4,218,0.000000,300.000000,100.000000,350.000000,0.000000,"dead"};
|
||||
item14[] = {"End",1,250,0.000000,450.000000,100.000000,500.000000,0.000000,"End"};
|
||||
item15[] = {"stay",4,218,0.000000,125.000000,100.000000,175.000000,1.000000,"stay"};
|
||||
item16[] = {"",7,210,-29.000002,245.999985,-20.999998,254.000000,0.000000,""};
|
||||
item17[] = {"",7,210,-29.000000,146.000000,-21.000000,153.999985,0.000000,""};
|
||||
item18[] = {"Staying",2,250,125.000000,125.000000,225.000000,175.000000,0.000000,"Staying"};
|
||||
item19[] = {"commanded",4,218,350.000000,175.000000,450.000000,225.000000,0.000000,"commanded"};
|
||||
item20[] = {"",7,210,396.000031,146.000000,403.999969,154.000000,0.000000,""};
|
||||
item21[] = {"",7,210,546.000000,146.000000,554.000000,154.000000,0.000000,""};
|
||||
item22[] = {"too_long",4,218,500.000000,175.000000,600.000000,225.000000,0.000000,"too long"};
|
||||
item23[] = {"",7,210,521.000000,396.000000,529.000000,404.000000,0.000000,""};
|
||||
item24[] = {"Reset",2,250,425.000000,300.000000,525.000000,350.000000,0.000000,"Reset"};
|
||||
item25[] = {"true",8,218,425.000000,375.000000,525.000000,425.000000,0.000000,"true"};
|
||||
item26[] = {"",7,210,396.000000,321.000000,404.000000,329.000000,0.000000,""};
|
||||
item27[] = {"track",4,218,0.000000,25.000000,100.000000,75.000000,0.000000,"track"};
|
||||
item28[] = {"",7,210,-29.000000,46.000008,-21.000000,53.999996,0.000000,""};
|
||||
item29[] = {"Tracking",2,250,250.000000,-50.000000,350.000000,0.000000,0.000000,"Tracking"};
|
||||
item30[] = {"commanded",4,218,400.000000,-50.000000,500.000000,0.000000,0.000000,"commanded"};
|
||||
item31[] = {"Checking",2,250,125.000000,25.000000,225.000000,75.000000,0.000000,"Checking"};
|
||||
item32[] = {"has_target",4,218,125.000000,-50.000000,225.000000,0.000000,1.000000,"has target"};
|
||||
item33[] = {"no_target",4,218,400.000000,25.000000,500.000000,75.000000,4.000000,"no target"};
|
||||
item34[] = {"Reset_1",2,250,575.000000,25.000000,675.000000,75.000000,0.000000,"Reset"};
|
||||
item35[] = {"",7,210,696.000000,46.000008,704.000000,53.999996,0.000000,""};
|
||||
item36[] = {"",7,210,371.000000,46.000008,379.000000,53.999989,0.000000,""};
|
||||
item37[] = {"",7,210,371.000000,-28.999994,379.000000,-21.000006,0.000000,""};
|
||||
item38[] = {"",7,210,371.000000,-129.000000,379.000000,-121.000008,0.000000,""};
|
||||
item39[] = {"at_target",4,218,400.000000,-150.000000,500.000000,-100.000000,0.000000,"at target"};
|
||||
item40[] = {"",7,210,546.000000,-28.999992,554.000000,-21.000008,0.000000,""};
|
||||
item41[] = {"",7,210,546.000000,46.000008,554.000000,53.999996,0.000000,""};
|
||||
item42[] = {"Chasing",2,250,525.000000,-150.000000,625.000000,-100.000000,0.000000,"Chasing"};
|
||||
item43[] = {"",7,210,696.000000,-179.000015,704.000000,-171.000000,0.000000,""};
|
||||
item44[] = {"",7,210,-229.000000,-179.000000,-221.000000,-171.000000,0.000000,""};
|
||||
item45[] = {"",7,210,-229.000000,171.000000,-221.000000,179.000000,0.000000,""};
|
||||
item46[] = {"reorientate",4,218,200.000000,-125.000000,300.000000,-75.000000,0.000000,"reorientate"};
|
||||
item47[] = {"action_init",2,250,-150.000000,75.000000,-50.000000,125.000000,0.000000,"action init"};
|
||||
item48[] = {"true",8,218,-150.000000,150.000000,-50.000000,200.000000,0.000000,"true"};
|
||||
item49[] = {"commanded",4,218,250.000000,300.000000,350.000000,350.000000,0.000000,"commanded"};
|
||||
item50[] = {"instant",4,218,-350.000000,375.000000,-250.000000,425.000000,0.000000,"instant"};
|
||||
item51[] = {"",7,210,-304.000000,246.000000,-296.000000,253.999985,0.000000,""};
|
||||
item52[] = {"",7,210,-29.000000,346.000000,-21.000000,354.000000,0.000000,""};
|
||||
item53[] = {"",7,210,171.000000,196.000000,179.000000,204.000000,0.000000,""};
|
||||
item54[] = {"",7,210,46.000000,196.000000,54.000000,204.000000,0.000000,""};
|
||||
item55[] = {"reorientate",4,218,575.000000,-75.000000,675.000000,-25.000000,0.000000,"reorientate"};
|
||||
item56[] = {"",7,210,571.000000,-78.999992,579.000000,-71.000008,0.000000,""};
|
||||
item57[] = {"",7,210,371.000000,-78.999992,379.000000,-71.000008,0.000000,""};
|
||||
item58[] = {"",7,210,370.999969,95.999992,379.000000,104.000000,0.000000,""};
|
||||
item59[] = {"",7,210,171.000000,96.000000,179.000000,104.000000,0.000000,""};
|
||||
item60[] = {"",7,210,58.500000,96.000000,66.500000,104.000000,0.000000,""};
|
||||
item61[] = {"",7,210,546.000000,321.000000,554.000000,329.000000,0.000000,""};
|
||||
link0[] = {0,7};
|
||||
link1[] = {1,9};
|
||||
link2[] = {2,3};
|
||||
link3[] = {3,4};
|
||||
link4[] = {3,8};
|
||||
link5[] = {3,50};
|
||||
link6[] = {3,52};
|
||||
link7[] = {4,5};
|
||||
link8[] = {5,6};
|
||||
link9[] = {6,2};
|
||||
link10[] = {6,13};
|
||||
link11[] = {6,16};
|
||||
link12[] = {7,47};
|
||||
link13[] = {8,3};
|
||||
link14[] = {9,10};
|
||||
link15[] = {9,13};
|
||||
link16[] = {9,49};
|
||||
link17[] = {9,53};
|
||||
link18[] = {10,11};
|
||||
link19[] = {11,12};
|
||||
link20[] = {11,13};
|
||||
link21[] = {12,3};
|
||||
link22[] = {13,14};
|
||||
link23[] = {15,18};
|
||||
link24[] = {16,1};
|
||||
link25[] = {16,17};
|
||||
link26[] = {17,15};
|
||||
link27[] = {17,28};
|
||||
link28[] = {18,20};
|
||||
link29[] = {18,59};
|
||||
link30[] = {19,26};
|
||||
link31[] = {20,19};
|
||||
link32[] = {20,21};
|
||||
link33[] = {21,22};
|
||||
link34[] = {22,61};
|
||||
link35[] = {24,25};
|
||||
link36[] = {25,11};
|
||||
link37[] = {26,24};
|
||||
link38[] = {27,31};
|
||||
link39[] = {28,27};
|
||||
link40[] = {29,37};
|
||||
link41[] = {29,38};
|
||||
link42[] = {29,46};
|
||||
link43[] = {30,40};
|
||||
link44[] = {31,32};
|
||||
link45[] = {31,36};
|
||||
link46[] = {32,29};
|
||||
link47[] = {33,41};
|
||||
link48[] = {34,35};
|
||||
link49[] = {35,43};
|
||||
link50[] = {36,33};
|
||||
link51[] = {36,58};
|
||||
link52[] = {37,30};
|
||||
link53[] = {37,36};
|
||||
link54[] = {38,39};
|
||||
link55[] = {39,42};
|
||||
link56[] = {40,41};
|
||||
link57[] = {41,34};
|
||||
link58[] = {42,55};
|
||||
link59[] = {42,56};
|
||||
link60[] = {43,44};
|
||||
link61[] = {44,45};
|
||||
link62[] = {45,48};
|
||||
link63[] = {46,29};
|
||||
link64[] = {47,48};
|
||||
link65[] = {48,6};
|
||||
link66[] = {49,11};
|
||||
link67[] = {50,51};
|
||||
link68[] = {51,5};
|
||||
link69[] = {52,13};
|
||||
link70[] = {52,16};
|
||||
link71[] = {53,54};
|
||||
link72[] = {54,15};
|
||||
link73[] = {55,42};
|
||||
link74[] = {56,57};
|
||||
link75[] = {57,37};
|
||||
link76[] = {58,59};
|
||||
link77[] = {59,60};
|
||||
link78[] = {60,13};
|
||||
link79[] = {61,24};
|
||||
globals[] = {25.000000,1,0,0,0,640,480,1,169,6316128,1,-360.074860,721.091919,670.563354,-317.706665,1094,1000,1};
|
||||
window[] = {2,-1,-1,-1,-1,1211,210,1418,210,3,1116};
|
||||
*//*%FSM</HEAD>*/
|
||||
class FSM
|
||||
{
|
||||
fsmName = "DayZ Dog Agent";
|
||||
class States
|
||||
{
|
||||
/*%FSM<STATE "init">*/
|
||||
class init
|
||||
{
|
||||
name = "init";
|
||||
init = /*%FSM<STATEINIT""">*/"_dog = _this select 0;" \n
|
||||
"_standing = true;" \n
|
||||
"_command = ""none"";" \n
|
||||
"_forceWalk = false;" \n
|
||||
"_maxSpeed = 1;" \n
|
||||
"_maxSpeedInit = _maxSpeed;" \n
|
||||
"_forceChange = false;" \n
|
||||
"_staySkill = 30;" \n
|
||||
"_senseSkill = 300; //x3 for tracking?" \n
|
||||
"_target = objNull;" \n
|
||||
"_target setVariable ['forceWalk',false];" \n
|
||||
"_lastPos = [0,0,0];" \n
|
||||
"_move = """";" \n
|
||||
"_watchDog = true;" \n
|
||||
"_idleTime = 5;" \n
|
||||
"_coolDown = 0;" \n
|
||||
"" \n
|
||||
"_hunger = 0;" \n
|
||||
"_thrist = 0;" \n
|
||||
"_actionLieDown = -1;" \n
|
||||
"" \n
|
||||
"_actionDir = ""\z\addons\dayz_code\actions\dog\"";" \n
|
||||
"" \n
|
||||
"_speedVal = [1,4,-1];"/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "preloaded">*/
|
||||
class preloaded
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="action_init";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"dayz_clientPreload and (!isNil ""_handle"")"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "moving">*/
|
||||
class moving
|
||||
{
|
||||
name = "moving";
|
||||
init = /*%FSM<STATEINIT""">*/"_pos = player modelToWorld [-1,1,0];" \n
|
||||
"if(_lastPos distance _pos > 1 or _forceChange) then {" \n
|
||||
" _lastPos = _pos;" \n
|
||||
" _dog doMove _pos;" \n
|
||||
" _dog forceSpeed (_speedVal select _maxSpeed);" \n
|
||||
" _forceChange = false;" \n
|
||||
"};" \n
|
||||
"_waitTime = time;" \n
|
||||
"" \n
|
||||
""/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "stay">*/
|
||||
class stay
|
||||
{
|
||||
priority = 1.000000;
|
||||
to="Staying";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"_command == ""stay"""/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "instant">*/
|
||||
class instant
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Waiting";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"!_waiting"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "dead">*/
|
||||
class dead
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="End";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"!(alive _dog)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "idle_exceeded">*/
|
||||
class idle_exceeded
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Sitting";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"((time - _waitTime) > _idleTime) and _standing"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_standing = false;" \n
|
||||
"if (!_watchDog) then {" \n
|
||||
" _move = ""Dog_LieDown"";" \n
|
||||
"} else {" \n
|
||||
" _move = ""Dog_SitDown"";" \n
|
||||
" _actionLieDown = _dog addAction [""Lie Down"", _actionDir + ""stay.sqf"",_handle, 0, true, true];" \n
|
||||
"};" \n
|
||||
"[objNull, _dog, rSwitchMove,_move] call RE;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "reorientate">*/
|
||||
class reorientate
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Moving";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"((time - _waitTime) > 0.5)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "track">*/
|
||||
class track
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Checking";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"_command == ""track"""/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "close">*/
|
||||
class close
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Waiting";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"player distance _dog < 2"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "Waiting">*/
|
||||
class Waiting
|
||||
{
|
||||
name = "Waiting";
|
||||
init = /*%FSM<STATEINIT""">*/"_waitTime = time;" \n
|
||||
"_waiting = true;" \n
|
||||
"_lastpos = player modelToWorld [-1,1,0];"/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "stay">*/
|
||||
class stay
|
||||
{
|
||||
priority = 1.000000;
|
||||
to="Staying";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"_command == ""stay"""/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "idle_exceeded">*/
|
||||
class idle_exceeded
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Sitting";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"((time - _waitTime) > _idleTime) and _standing"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_standing = false;" \n
|
||||
"if (!_watchDog) then {" \n
|
||||
" _move = ""Dog_LieDown"";" \n
|
||||
"} else {" \n
|
||||
" _move = ""Dog_SitDown"";" \n
|
||||
" _actionLieDown = _dog addAction [""Lie Down"", _actionDir + ""stay.sqf"",_handle, 0, true, true];" \n
|
||||
"};" \n
|
||||
"[objNull, _dog, rSwitchMove,_move] call RE;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "dead">*/
|
||||
class dead
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="End";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"!(alive _dog)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "track">*/
|
||||
class track
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Checking";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"_command == ""track"""/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "master_moved">*/
|
||||
class master_moved
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="moving";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"player distance _dog > 2"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_lastPos = position _dog;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "Sitting">*/
|
||||
class Sitting
|
||||
{
|
||||
name = "Sitting";
|
||||
init = /*%FSM<STATEINIT""">*/"_waitTime = time;" \n
|
||||
"_coolDown = (random 4) + 2;"/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "stay">*/
|
||||
class stay
|
||||
{
|
||||
priority = 1.000000;
|
||||
to="Staying";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"_command == ""stay"""/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "commanded">*/
|
||||
class commanded
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Getting_Up";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"_command != ""none"""/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "dead">*/
|
||||
class dead
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="End";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"!(alive _dog)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "master_moved">*/
|
||||
class master_moved
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Getting_Up";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"player distance _dog > 2"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "Getting_Up">*/
|
||||
class Getting_Up
|
||||
{
|
||||
name = "Getting_Up";
|
||||
init = /*%FSM<STATEINIT""">*/"_anim = animationState _dog;" \n
|
||||
"if (_anim == ""Dog_SitDown"") then {" \n
|
||||
" _move = ""Dog_SitUp"";" \n
|
||||
"} else {" \n
|
||||
" _move = ""Dog_GetUp"";" \n
|
||||
"};" \n
|
||||
"" \n
|
||||
"[objNull, _dog, rSwitchMove,_move] call RE;" \n
|
||||
"_waitTime = time;" \n
|
||||
"_standing = true;" \n
|
||||
"_dog removeAction _actionLieDown;"/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "dead">*/
|
||||
class dead
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="End";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"!(alive _dog)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "Up">*/
|
||||
class Up
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="moving";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"((time - _waitTime) > 0.5)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "End">*/
|
||||
class End
|
||||
{
|
||||
name = "End";
|
||||
init = /*%FSM<STATEINIT""">*/"//qq" \n
|
||||
"" \n
|
||||
"terminate _heartbeat;" \n
|
||||
"" \n
|
||||
"_dog removeAction _actionWarn;" \n
|
||||
"_dog removeAction _actionStay;" \n
|
||||
"_dog removeAction _actionTrack;" \n
|
||||
"_dog removeAction _actionBark;" \n
|
||||
"_dog removeAction _actionFood;" \n
|
||||
"_dog removeAction _actionWater;" \n
|
||||
"" \n
|
||||
"player removeAction _actionSpeedStealth;" \n
|
||||
"player removeAction _actionSpeedFree;" \n
|
||||
"if(!isNil ""_actionCall"") then {" \n
|
||||
" player removeAction _actionCall;" \n
|
||||
"};"/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "Staying">*/
|
||||
class Staying
|
||||
{
|
||||
name = "Staying";
|
||||
init = /*%FSM<STATEINIT""">*/"if(_standing) then {" \n
|
||||
" _standing = false;" \n
|
||||
" if (!_watchDog) then {" \n
|
||||
" _move = ""Dog_LieDown"";" \n
|
||||
" } else {" \n
|
||||
" _move = ""Dog_SitDown"";" \n
|
||||
" _actionLieDown = _dog addAction [""Lie Down"", _actionDir + ""stay.sqf"",_handle, 0, true, true];" \n
|
||||
" };" \n
|
||||
" [objNull, _dog, rSwitchMove,_move] call RE;" \n
|
||||
"};" \n
|
||||
"" \n
|
||||
"_dog removeAction _actionStay;" \n
|
||||
"_actionFollow = _dog addAction [""Follow Me"", _actionDir + ""follow.sqf"",[_handle,false], 0, true, true];" \n
|
||||
"_actionCall = player addAction [""Call Dog"", _actionDir + ""follow.sqf"",[_handle,true], 0, false, true];" \n
|
||||
"" \n
|
||||
"_waitTime = time;" \n
|
||||
""/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "too_long">*/
|
||||
class too_long
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="reset";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"((time - _waitTime) > _staySkill)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_command = ""none"";"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "dead">*/
|
||||
class dead
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="End";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"!(alive _dog)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "commanded">*/
|
||||
class commanded
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Reset";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"_command != ""stay"""/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"if (_command == ""none"") then {" \n
|
||||
" if ((player distance _dog > 5) and (_watchDog)) then {" \n
|
||||
" _dog playActionNow ""GestureBark"";" \n
|
||||
" [_dog,""dog_bark"",0,false] call dayz_zombieSpeak;" \n
|
||||
" };" \n
|
||||
"};"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "reset">*/
|
||||
class reset
|
||||
{
|
||||
name = "reset";
|
||||
init = /*%FSM<STATEINIT""">*/"_dog removeAction _actionFollow;" \n
|
||||
"_dog removeAction _actionLieDown;" \n
|
||||
"player removeAction _actionCall;" \n
|
||||
"_actionStay = _dog addAction [""Stay"",_actionDir + ""stay.sqf"",_handle, 5, true, true];" \n
|
||||
"_waiting = false;"/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "true">*/
|
||||
class true
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Getting_Up";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_forceWalk = false;" \n
|
||||
"_dog forceSpeed -1;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "Tracking">*/
|
||||
class Tracking
|
||||
{
|
||||
name = "Tracking";
|
||||
init = /*%FSM<STATEINIT""">*/"_pos = position _target;" \n
|
||||
"if(_lastPos distance _pos > 1 or _forceChange) then {" \n
|
||||
" _lastPos = _pos;" \n
|
||||
" _dog doMove _pos;" \n
|
||||
" _dog forceSpeed (_speedVal select _maxSpeed);" \n
|
||||
" _forceChange = false;" \n
|
||||
"};" \n
|
||||
"_waitTime = time;"/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "no_target">*/
|
||||
class no_target
|
||||
{
|
||||
priority = 4.000000;
|
||||
to="reset_1";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"isNull _target and ((time - _waitTime) > 2)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_command = ""none"";"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "commanded">*/
|
||||
class commanded
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="reset_1";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"_command != ""track"""/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"if (_command == ""none"") then {" \n
|
||||
" if ((player distance _dog > 5) and (_watchDog)) then {" \n
|
||||
" _dog playActionNow ""GestureBark"";" \n
|
||||
" [_dog,""dog_bark"",0,false] call dayz_zombieSpeak;" \n
|
||||
" };" \n
|
||||
"};"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "at_target">*/
|
||||
class at_target
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Chasing";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"_dog distance _target < 10"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "dead">*/
|
||||
class dead
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="End";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"!(alive _dog)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "reorientate">*/
|
||||
class reorientate
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Tracking";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"((time - _waitTime) > 0.5)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"if ((random 1) < 0.3 and (time - _coolDown > 4)) then {" \n
|
||||
" _dog playActionNow ""GestureSniff"";" \n
|
||||
" _coolDown = time;" \n
|
||||
"};"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "Checking">*/
|
||||
class Checking
|
||||
{
|
||||
name = "Checking";
|
||||
init = /*%FSM<STATEINIT""">*/"_dog removeAction _actionTrack;" \n
|
||||
"_actionCall = player addAction [""Call Dog"", _actionDir + ""follow.sqf"",[_handle,true], 0, false, true];" \n
|
||||
"_lastPos = position _dog;" \n
|
||||
"" \n
|
||||
"_list = (position _dog) nearEntities [""Animal"",(_senseSkill * 3)];" \n
|
||||
"_list = _list - [_dog];" \n
|
||||
"" \n
|
||||
"if (count _list > 0) then {" \n
|
||||
" _target = _list select 0;" \n
|
||||
"} else {" \n
|
||||
" _target = objNull;" \n
|
||||
"};" \n
|
||||
"" \n
|
||||
"_dog playActionNow ""GestureSniff"";" \n
|
||||
"_waitTime = time;"/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "no_target">*/
|
||||
class no_target
|
||||
{
|
||||
priority = 4.000000;
|
||||
to="reset_1";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"isNull _target and ((time - _waitTime) > 2)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_command = ""none"";"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "has_target">*/
|
||||
class has_target
|
||||
{
|
||||
priority = 1.000000;
|
||||
to="Tracking";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"!isNull _target and ((time - _waitTime) > 2)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_lastPos = position _dog;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "dead">*/
|
||||
class dead
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="End";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"!(alive _dog)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "reset_1">*/
|
||||
class reset_1
|
||||
{
|
||||
name = "reset_1";
|
||||
init = /*%FSM<STATEINIT""">*/"_actionTrack = _dog addAction [""Track"",_actionDir + ""track.sqf"",_handle, 4, true, true];" \n
|
||||
"player removeAction _actionCall;"/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "true">*/
|
||||
class true
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Waiting";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "Chasing">*/
|
||||
class Chasing
|
||||
{
|
||||
name = "Chasing";
|
||||
init = /*%FSM<STATEINIT""">*/"_pos = position _target;" \n
|
||||
"if(_lastPos distance _pos > 1 or _forceChange) then {" \n
|
||||
" _lastPos = _pos;" \n
|
||||
" _dog doMove _pos;" \n
|
||||
" _dog forceSpeed (_speedVal select _maxSpeed);" \n
|
||||
" _forceChange = false;" \n
|
||||
"};" \n
|
||||
"_waitTime = time;"/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "no_target">*/
|
||||
class no_target
|
||||
{
|
||||
priority = 4.000000;
|
||||
to="Reset_1";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"isNull _target and ((time - _waitTime) > 2)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_command = ""none"";"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "commanded">*/
|
||||
class commanded
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Reset_1";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"_command != ""track"""/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"if (_command == ""none"") then {" \n
|
||||
" if ((player distance _dog > 5) and (_watchDog)) then {" \n
|
||||
" _dog playActionNow ""GestureBark"";" \n
|
||||
" [_dog,""dog_bark"",0,false] call dayz_zombieSpeak;" \n
|
||||
" };" \n
|
||||
"};"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "dead">*/
|
||||
class dead
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="End";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"!(alive _dog)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "reorientate">*/
|
||||
class reorientate
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Chasing";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"((time - _waitTime) > 1)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"if (_watchDog) then {" \n
|
||||
" _dog playActionNow ""GestureBark"";" \n
|
||||
" [_dog,""dog_bark"",0,false] call dayz_zombieSpeak;" \n
|
||||
"};"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "action_init">*/
|
||||
class action_init
|
||||
{
|
||||
name = "action_init";
|
||||
init = /*%FSM<STATEINIT""">*/"_actionStay = _dog addAction [""Stay"",_actionDir + ""stay.sqf"",_handle, 5, true, true];" \n
|
||||
"_actionTrack = _dog addAction [""Track"",_actionDir + ""track.sqf"",_handle, 4, true, true];" \n
|
||||
"_actionBark = _dog addAction [""Speak"",_actionDir + ""speak.sqf"",_handle, 3, false, false];" \n
|
||||
"_actionWarn = _dog addAction [""Alert"",_actionDir + ""warn.sqf"",[_handle,true], 2, false, true];" \n
|
||||
"_actionFood = _dog addAction [""Feed"",_actionDir + ""feed.sqf"",[_handle,0], 1, false, false,"""",""'FoodSteakRaw' in magazines player;""];" \n
|
||||
"_actionWater = _dog addAction [""Water"",_actionDir + ""feed.sqf"",[_handle,1], 1, false, false,"""",""'ItemWaterbottle' in magazines player;""];" \n
|
||||
"" \n
|
||||
"_actionSpeedStealth = player addAction [""Slow Down"",_actionDir + ""speed.sqf"",[_handle,true,true], 0, false, false];" \n
|
||||
"_actionSpeedFree = player addAction [""Speed Up"",_actionDir + ""speed.sqf"",[_handle,true,false], 0, false, false];" \n
|
||||
"" \n
|
||||
"_heartbeat = [_dog,_handle] spawn {" \n
|
||||
" _dog = _this select 0;" \n
|
||||
" _handle = _this select 1;" \n
|
||||
" _handle setFSMVariable [""_thirst"",0];" \n
|
||||
" _handle setFSMVariable [""_hunger"",0];" \n
|
||||
" while {alive _dog} do {" \n
|
||||
" _vel = velocity _dog;" \n
|
||||
" _speed = [0,0,0] distance _vel;" \n
|
||||
" _thirst = _handle getFSMVariable ""_thirst"";" \n
|
||||
" _hunger = _handle getFSMVariable ""_hunger"";" \n
|
||||
" _thirst = _thirst + (0.001 * dayz_scaleLight * _speed) + 0.001;" \n
|
||||
" _hunger = _hunger + (0.001 * _speed) + 0.001;" \n
|
||||
" _handle setFSMVariable [""_thirst"",_thirst];" \n
|
||||
" _handle setFSMVariable [""_hunger"",_hunger];" \n
|
||||
" sleep 0.5;" \n
|
||||
" };" \n
|
||||
"};" \n
|
||||
"" \n
|
||||
"_script = [_dog,1,2,[_handle,true]] execVM (_actionDir + ""warn.sqf"");" \n
|
||||
""/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "true">*/
|
||||
class true
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Waiting";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
};
|
||||
initState="init";
|
||||
finalStates[] =
|
||||
{
|
||||
"End",
|
||||
};
|
||||
};
|
||||
/*%FSM</COMPILE>*/
|
||||
41
dayz_code/system/fire_monitor.sqf
Normal file
41
dayz_code/system/fire_monitor.sqf
Normal file
@@ -0,0 +1,41 @@
|
||||
private["_firePlace","_ok","_mags","_serial","_qty","_countr"];
|
||||
_firePlace = _this;
|
||||
while {alive _firePlace} do {
|
||||
while {inflamed _firePlace and alive _fireplace} do {
|
||||
//Use Wood
|
||||
_ok = false;
|
||||
_mags = getMagazineCargo _firePlace;
|
||||
clearMagazineCargoGlobal _firePlace;
|
||||
clearWeaponCargoGlobal _firePlace;
|
||||
_serial = (_mags select 0) find "PartWoodPile";
|
||||
_qty = 0;
|
||||
if (_serial >= 0) then {
|
||||
_qty = (_mags select 1) select _serial;
|
||||
};
|
||||
_ok = false;
|
||||
if (_qty > 0) then {
|
||||
_qty = _qty - 1;
|
||||
_ok = true;
|
||||
if (_qty > 0) then {
|
||||
_firePlace addMagazineCargoGlobal ["PartWoodPile",_qty];
|
||||
};
|
||||
};
|
||||
if (_ok) then {
|
||||
_countr = 0;
|
||||
while {_ok} do {
|
||||
_countr = _countr + 1;
|
||||
if (_countr > 600) then {_ok = false};
|
||||
if (!inflamed _firePlace) then {_ok = false};
|
||||
if (!alive _firePlace) then {_ok = false};
|
||||
sleep 1;
|
||||
};
|
||||
} else {
|
||||
_firePlace inflame false;
|
||||
};
|
||||
};
|
||||
while {!inflamed _firePlace and alive _fireplace} do {
|
||||
//Wait
|
||||
sleep 1;
|
||||
};
|
||||
sleep 1;
|
||||
};
|
||||
1260
dayz_code/system/player_monitor.fsm
Normal file
1260
dayz_code/system/player_monitor.fsm
Normal file
File diff suppressed because it is too large
Load Diff
4
dayz_code/system/player_monitor.sqf
Normal file
4
dayz_code/system/player_monitor.sqf
Normal file
@@ -0,0 +1,4 @@
|
||||
if (isServer) then {
|
||||
waitUntil{dayz_preloadFinished};
|
||||
};
|
||||
_id = [] execFSM "\z\addons\dayz_code\system\player_monitor.fsm";
|
||||
61
dayz_code/system/player_spawn_1.sqf
Normal file
61
dayz_code/system/player_spawn_1.sqf
Normal file
@@ -0,0 +1,61 @@
|
||||
private["_handle","_body","_cursor","_delMe"];
|
||||
while {true} do {
|
||||
_handle = [] spawn player_animalCheck;
|
||||
waitUntil{scriptDone _handle};
|
||||
/*
|
||||
//check fly objects
|
||||
{
|
||||
_body = _x getVariable["body",objNull];
|
||||
if (isNull _body) then {
|
||||
dayz_flyMonitor = dayz_flyMonitor - [_x];
|
||||
deleteVehicle _x;
|
||||
};
|
||||
} forEach dayz_flyMonitor;
|
||||
*/
|
||||
|
||||
//check monitored buildings
|
||||
_cursor = 0;
|
||||
_delMe = false;
|
||||
{
|
||||
private["_bPos","_isNoone"];
|
||||
_bPos = getPosATL _x;
|
||||
_isNoone = {isPlayer _x} count (_bPos nearEntities ["Man",200]) == 0;
|
||||
if (_isNoone) then {
|
||||
_x setVariable ["zombied",objNull,true];
|
||||
dayz_buildingMonitor set [_cursor,"DEL"];
|
||||
_delMe = true;
|
||||
};
|
||||
_cursor = _cursor + 1;
|
||||
} forEach dayz_buildingMonitor;
|
||||
if (_delMe) then {
|
||||
dayz_buildingMonitor = dayz_buildingMonitor - ["DEL"];
|
||||
};
|
||||
/*
|
||||
//check bodies
|
||||
_cursor = 0;
|
||||
_delMe = false;
|
||||
{
|
||||
private["_bPos","_isNoone"];
|
||||
_bPos = getPosATL _x;
|
||||
_isNoone = {isPlayer _x} count (_bPos nearEntities ["Man",50]) == 0;
|
||||
if (_isNoone) then {
|
||||
deleteVehicle _x;
|
||||
dayz_bodyMonitor set [_cursor,"DEL"];
|
||||
_delMe = true;
|
||||
};
|
||||
_cursor = _cursor + 1;
|
||||
} forEach dayz_bodyMonitor;
|
||||
if (_delMe) then {
|
||||
dayz_bodyMonitor = dayz_bodyMonitor - ["DEL"];
|
||||
};
|
||||
*/
|
||||
//Check if new day
|
||||
_day = round(360 * (dateToNumber date));
|
||||
if(dayz_currentDay != _day) then {
|
||||
dayz_sunRise = call world_sunRise;
|
||||
dayz_currentDay = _day;
|
||||
};
|
||||
|
||||
//wait
|
||||
sleep 5;
|
||||
};
|
||||
339
dayz_code/system/player_spawn_2.sqf
Normal file
339
dayz_code/system/player_spawn_2.sqf
Normal file
@@ -0,0 +1,339 @@
|
||||
private["_refObj","_size","_vel","_speed","_hunger","_thirst","_array","_unsaved","_timeOut","_result","_lastSave"];
|
||||
disableSerialization;
|
||||
_timeOut = 0;
|
||||
_messTimer = 0;
|
||||
_lastSave = 0;
|
||||
_lastTemp = dayz_temperatur;
|
||||
_debug = getMarkerpos "respawn_west";
|
||||
_isBandit = false;
|
||||
_isHero = false;
|
||||
|
||||
player setVariable ["temperature",dayz_temperatur,true];
|
||||
|
||||
dayz_myLoad = (((count dayz_myBackpackMags) * 0.2) + (count dayz_myBackpackWpns)) + (((count dayz_myMagazines) * 0.1) + (count dayz_myWeapons * 0.5));
|
||||
|
||||
//player addMagazine "Hatchet_swing";
|
||||
//player addWeapon "MeleeHatchet";
|
||||
|
||||
while {true} do {
|
||||
//Initialize
|
||||
_refObj = vehicle player;
|
||||
_size = (sizeOf typeOf _refObj) * 0.6;
|
||||
_vel = velocity player;
|
||||
_speed = round((_vel distance [0,0,0]) * 3.5);
|
||||
_saveTime = (playersNumber west * 2) + 10;
|
||||
|
||||
//reset position
|
||||
_randomSpot = true;
|
||||
_tempPos = getPosATL player;
|
||||
_distance = _debug distance _tempPos;
|
||||
if (_distance < 2000) then {
|
||||
_randomSpot = false;
|
||||
};
|
||||
_distance = [0,0,0] distance _tempPos;
|
||||
if (_distance < 500) then {
|
||||
_randomSpot = false;
|
||||
};
|
||||
_distance = _mylastPos distance _tempPos;
|
||||
if (_distance > 400) then {
|
||||
_randomSpot = false;
|
||||
};
|
||||
|
||||
if (_randomSpot) then {
|
||||
_mylastPos = _tempPos;
|
||||
};
|
||||
|
||||
dayz_mylastPos = _mylastPos;
|
||||
dayz_areaAffect = _size;
|
||||
|
||||
//CheckVehicle
|
||||
/*
|
||||
if (_refObj != player) then {
|
||||
_isSync =_refObj getVariable ["ObjectID",0] > 0;
|
||||
if (!_isSync) then {
|
||||
_veh allowDamage true;
|
||||
_veh setDamage 1;
|
||||
player setDamage 1;
|
||||
};
|
||||
};
|
||||
*/
|
||||
|
||||
if (_speed > 0.1) then {
|
||||
_timeOut = _timeOut + 1;
|
||||
};
|
||||
|
||||
_humanity = player getVariable ["humanity",0];
|
||||
if (_timeOut > 150) then {
|
||||
_timeOut = 0;
|
||||
if (_humanity < 2500) then {
|
||||
_humanity = _humanity + 150;
|
||||
_humanity = _humanity min 2500;
|
||||
player setVariable ["humanity",_humanity,true];
|
||||
};
|
||||
};
|
||||
|
||||
if (_humanity < -2000 and !_isBandit) then {
|
||||
_isBandit = true;
|
||||
_model = typeOf player;
|
||||
if (_model == "Survivor2_DZ") then {
|
||||
[dayz_playerUID,dayz_characterID,"Bandit1_DZ"] spawn player_humanityMorph;
|
||||
};
|
||||
if (_model == "SurvivorW2_DZ") then {
|
||||
[dayz_playerUID,dayz_characterID,"BanditW1_DZ"] spawn player_humanityMorph;
|
||||
};
|
||||
};
|
||||
|
||||
if (_humanity > 0 and _isBandit) then {
|
||||
_isBandit = false;
|
||||
_model = typeOf player;
|
||||
if (_model == "Bandit1_DZ") then {
|
||||
[dayz_playerUID,dayz_characterID,"Survivor2_DZ"] spawn player_humanityMorph;
|
||||
};
|
||||
if (_model == "BanditW1_DZ") then {
|
||||
[dayz_playerUID,dayz_characterID,"SurvivorW2_DZ"] spawn player_humanityMorph;
|
||||
};
|
||||
};
|
||||
|
||||
if (_humanity > 5000 and !_isHero) then {
|
||||
_isBandit = false;
|
||||
_model = typeOf player;
|
||||
if (_model == "Survivor2_DZ") then {
|
||||
[dayz_playerUID,dayz_characterID,"Survivor3_DZ"] spawn player_humanityMorph;
|
||||
};
|
||||
};
|
||||
|
||||
//Has infection?
|
||||
if (r_player_infected) then {
|
||||
[player,"cough",8,false] call dayz_zombieSpeak;
|
||||
};
|
||||
|
||||
//Record Check
|
||||
_lastUpdate = time - dayZ_lastPlayerUpdate;
|
||||
if (_lastUpdate > 8) then {
|
||||
//POSITION?
|
||||
_distance = dayz_myPosition distance player;
|
||||
if (_distance > 10) then {
|
||||
//Player has moved
|
||||
dayz_myPosition = getPosATL player;
|
||||
player setVariable["posForceUpdate",true,true];
|
||||
dayz_unsaved = true;
|
||||
dayZ_lastPlayerUpdate = time;
|
||||
};
|
||||
};
|
||||
|
||||
//Hunger
|
||||
_hunger = +((((r_player_bloodTotal - r_player_blood) / r_player_bloodTotal) * 5) + _speed + dayz_myLoad) * 3;
|
||||
if (time - dayz_panicCooldown < 120) then {
|
||||
_hunger = _hunger * 2;
|
||||
};
|
||||
dayz_hunger = dayz_hunger + (_hunger / 60);
|
||||
|
||||
//Thirst
|
||||
_thirst = 2;
|
||||
if (_refObj == player) then {
|
||||
_thirst = (_speed + 4) * 3;
|
||||
};
|
||||
dayz_thirst = dayz_thirst + (_thirst / 60) * (dayz_temperatur / dayz_temperaturnormal); //TeeChange Temperatur effects added Max Effects: -25% and + 16.6% waterloss
|
||||
|
||||
//Temperatur
|
||||
2 call player_temp_calculation; //2 = sleep time of this loop //TeeChange
|
||||
if ((_lastTemp - dayz_temperatur) > 0.75 or (_lastTemp - dayz_temperatur) < -0.75 ) then {
|
||||
player setVariable ["temperature",dayz_temperatur,true];
|
||||
_lastTemp = dayz_temperatur;
|
||||
};
|
||||
|
||||
//can get nearby infection
|
||||
if (!r_player_infected) then {
|
||||
// Infectionriskstart
|
||||
if (dayz_temperatur < ((80 / 100) * (dayz_temperaturnormal - dayz_temperaturmin) + dayz_temperaturmin)) then { //TeeChange
|
||||
_listTalk = _mylastPos nearEntities ["CAManBase",8];
|
||||
{
|
||||
if (_x getVariable["USEC_infected",false]) then {
|
||||
_rnd = (random 1) * (((dayz_temperaturnormal - dayz_temperatur) * (100 /(dayz_temperaturnormal - dayz_temperaturmin)))/ 50); //TeeChange
|
||||
if (_rnd < 0.1) then {
|
||||
_rnd = random 1;
|
||||
if (_rnd > 0.7) then {
|
||||
r_player_infected = true;
|
||||
player setVariable["USEC_infected",true];
|
||||
};
|
||||
};
|
||||
};
|
||||
} forEach _listTalk;
|
||||
if (dayz_temperatur < ((50 / 100) * (dayz_temperaturnormal - dayz_temperaturmin) + dayz_temperaturmin)) then { //TeeChange
|
||||
_rnd = (random 1) * (((dayz_temperaturnormal - dayz_temperatur) * (100 /(dayz_temperaturnormal - dayz_temperaturmin)))/ 25); //TeeChange
|
||||
if (_rnd < 0.05) then {
|
||||
_rnd = random 1;
|
||||
if (_rnd > 0.95) then {
|
||||
r_player_infected = true;
|
||||
player setVariable["USEC_infected",true];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//If has infection reduce blood
|
||||
if (r_player_infected) then {
|
||||
if (r_player_blood > 6000) then {
|
||||
r_player_blood = r_player_blood - 3;
|
||||
};
|
||||
};
|
||||
|
||||
//Hunger Effect
|
||||
_foodVal = dayz_statusArray select 0;
|
||||
_thirstVal = dayz_statusArray select 1;
|
||||
if (_thirstVal <= 0) then {
|
||||
_result = r_player_blood - 10;
|
||||
if (_result < 0) then {
|
||||
_id = [player,"dehyd"] spawn player_death;
|
||||
} else {
|
||||
r_player_blood = _result;
|
||||
};
|
||||
};
|
||||
if (_foodVal <= 0) then {
|
||||
_result = r_player_blood - 10;
|
||||
if (_result < 0) then {
|
||||
_id = [player,"starve"] spawn player_death;
|
||||
} else {
|
||||
r_player_blood = _result;
|
||||
};
|
||||
};
|
||||
|
||||
//Record low bloow
|
||||
_lowBlood = player getVariable ["USEC_lowBlood", false];
|
||||
if ((r_player_blood < r_player_bloodTotal) and !_lowBlood) then {
|
||||
player setVariable["USEC_lowBlood",true,true];
|
||||
};
|
||||
|
||||
//Broadcast Hunger/Thirst
|
||||
_messTimer = _messTimer + 1;
|
||||
if (_messTimer > 15) then {
|
||||
_messTimer = 0;
|
||||
player setVariable ["messing",[dayz_hunger,dayz_thirst],true];
|
||||
};
|
||||
|
||||
//check if can disconnect
|
||||
if (!dayz_canDisconnect) then {
|
||||
if ((time - dayz_damageCounter) > 180) then {
|
||||
if (!r_player_unconscious) then {
|
||||
dayz_canDisconnect = true;
|
||||
dayzDiscoRem = getPlayerUID player;
|
||||
publicVariableServer "dayzDiscoRem";
|
||||
|
||||
//Ensure Control is hidden
|
||||
_display = uiNamespace getVariable 'DAYZ_GUI_display';
|
||||
_control = _display displayCtrl 1204;
|
||||
_control ctrlShow false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//Save Checker
|
||||
if (dayz_unsaved) then {
|
||||
if ((time - dayz_lastSave) > _saveTime) then {
|
||||
dayzPlayerSave = [player,dayz_Magazines,false];
|
||||
publicVariableServer "dayzPlayerSave";
|
||||
if (isServer) then {
|
||||
dayzPlayerSave call server_playerSync;
|
||||
};
|
||||
dayz_lastSave = time;
|
||||
dayz_Magazines = [];
|
||||
};
|
||||
_lastSave = _lastSave + 2;
|
||||
} else {
|
||||
dayz_lastSave = time;
|
||||
_lastSave = 0;
|
||||
};
|
||||
|
||||
if (!dayz_unsaved) then {
|
||||
dayz_lastSave = time;
|
||||
};
|
||||
|
||||
//Attach Trigger Current Object
|
||||
//dayz_playerTrigger attachTo [_refObj,[0,0,0]];
|
||||
//dayz_playerTrigger setTriggerArea [_size,_size,0,false];
|
||||
|
||||
if (dayzDebug) then {
|
||||
//Debug Info
|
||||
_headShots = player getVariable["headShots",0];
|
||||
_kills = player getVariable["zombieKills",0];
|
||||
_killsH = player getVariable["humanKills",0];
|
||||
_killsB = player getVariable["banditKills",0];
|
||||
_humanity = player getVariable["humanity",0];
|
||||
_zombies = count entities "zZombie_Base";
|
||||
_zombiesA = {alive _x} count entities "zZombie_Base";
|
||||
//_groups = count allGroups;
|
||||
//_dead = count allDead;
|
||||
//dayz_zombiesLocal = {local _x} count entities "zZombie_Base";
|
||||
//_loot = count allMissionObjects "WeaponHolder";
|
||||
//_wrecks = count allMissionObjects "Wreck_Base";
|
||||
//_lootL = {local _x} count allMissionObjects "WeaponHolder";
|
||||
//_speed = (_vel distance [0,0,0]);
|
||||
|
||||
hintSilent format["DEBUG MONITOR: \n\nZombies Killed: %1\nHeadshots: %2\nMurders: %10\nBandits Killed: %12\nBlood: %4\nZombies (alive/total): %15/%8\nName: %14\nHumanity: %11",_kills,_headShots,_speed,r_player_blood,round(dayz_temperatur),r_player_infected,dayz_inside,_zombies,_lastSave,_killsH,round(_humanity),_killsB,_freeTarget,dayz_playerName,_zombiesA];
|
||||
};
|
||||
|
||||
// If in combat, display counter and restrict logout
|
||||
_startcombattimer = player getVariable["startcombattimer",0];
|
||||
if (_startcombattimer == 1) then {
|
||||
player setVariable["combattimeout", time + 30, true];
|
||||
player setVariable["startcombattimer", 0, true];
|
||||
dayz_combat = 1;
|
||||
};
|
||||
|
||||
_combattimeout = player getVariable["combattimeout",0];
|
||||
if (_combattimeout > 0) then {
|
||||
_timeleft = _combattimeout - time;
|
||||
if (_timeleft > 0) then {
|
||||
//hintSilent format["In Combat: %1",round(_timeleft)];
|
||||
} else {
|
||||
//hintSilent "Not in Combat";
|
||||
player setVariable["combattimeout", 0, true];
|
||||
dayz_combat = 0;
|
||||
_combatdisplay = uiNamespace getVariable 'DAYZ_GUI_display';
|
||||
_combatcontrol = _combatdisplay displayCtrl 1307;
|
||||
_combatcontrol ctrlShow true;
|
||||
};
|
||||
} else {
|
||||
//hintSilent "Not in Combat";
|
||||
dayz_combat = 0;
|
||||
_combatdisplay = uiNamespace getVariable 'DAYZ_GUI_display';
|
||||
_combatcontrol = _combatdisplay displayCtrl 1307;
|
||||
_combatcontrol ctrlShow true;
|
||||
};
|
||||
|
||||
/*
|
||||
setGroupIconsVisible [false,false];
|
||||
clearGroupIcons group player;
|
||||
*/
|
||||
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, (r_player_blood/r_player_bloodTotal)], [1, 1, 1, 0.0]];
|
||||
"colorCorrections" ppEffectCommit 0;
|
||||
sleep 2;
|
||||
|
||||
_myPos = player getVariable["lastPos",[]];
|
||||
if (count _myPos > 0) then {
|
||||
player setVariable["lastPos",_mylastPos, true];
|
||||
player setVariable["lastPos",[]];
|
||||
};
|
||||
|
||||
_lastPos = getPosATL player;
|
||||
if (player == vehicle player) then {
|
||||
if (_mylastPos distance _lastPos > 200) then {
|
||||
if (alive player) then {
|
||||
player setPosATL _mylastPos;
|
||||
};
|
||||
};
|
||||
} else {
|
||||
if (_mylastPos distance _lastPos > 800) then {
|
||||
if (alive player) then {
|
||||
player setPosATL _mylastPos;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//Hatchet ammo fix
|
||||
//"MeleeHatchet" call dayz_meleeMagazineCheck;
|
||||
|
||||
//Crowbar ammo fix
|
||||
//"MeleeCrowbar" call dayz_meleeMagazineCheck;
|
||||
};
|
||||
2
dayz_code/system/server_monitor.sqf
Normal file
2
dayz_code/system/server_monitor.sqf
Normal file
@@ -0,0 +1,2 @@
|
||||
waitUntil{!isnil "bis_fnc_init"};
|
||||
execVM "\z\addons\dayz_server\system\server_monitor.sqf";
|
||||
162
dayz_code/system/trap_monitor.fsm
Normal file
162
dayz_code/system/trap_monitor.fsm
Normal file
@@ -0,0 +1,162 @@
|
||||
/*%FSM<COMPILE "C:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Trap">*/
|
||||
/*%FSM<HEAD>*/
|
||||
/*
|
||||
item0[] = {"init",0,250,-450.000000,-200.000000,-350.000000,-150.000000,0.000000,"init"};
|
||||
item1[] = {"Open",2,250,-125.000000,25.000000,-25.000000,75.000000,0.000000,"Open"};
|
||||
item2[] = {"nearby",4,4314,-200.000000,-50.000000,-100.000000,0.000000,0.000000,"nearby"};
|
||||
item3[] = {"wait",2,250,-325.000000,-50.000000,-225.000000,0.000000,0.000000,"wait"};
|
||||
item4[] = {"local",4,218,-325.000000,-125.000000,-225.000000,-75.000000,2.000000,"local"};
|
||||
item5[] = {"opened",4,218,-325.000000,25.000000,-225.000000,75.000000,0.000000,"opened"};
|
||||
item6[] = {"server",4,218,-450.000000,-125.000000,-350.000000,-75.000000,1.000000,"server"};
|
||||
item7[] = {"true",8,218,-575.000000,-125.000000,-475.000000,-75.000000,0.000000,"true"};
|
||||
item8[] = {"end",1,250,-450.000000,-50.000000,-350.000000,0.000000,0.000000,"end"};
|
||||
item9[] = {"closed",4,218,-200.000000,-125.000000,-100.000000,-75.000000,0.000000,"closed"};
|
||||
item10[] = {"",7,210,-79.000000,-29.000000,-71.000000,-21.000000,0.000000,""};
|
||||
item11[] = {"",7,210,-79.000000,-104.000000,-71.000000,-96.000000,0.000000,""};
|
||||
link0[] = {0,4};
|
||||
link1[] = {0,6};
|
||||
link2[] = {0,7};
|
||||
link3[] = {1,10};
|
||||
link4[] = {2,3};
|
||||
link5[] = {3,5};
|
||||
link6[] = {4,3};
|
||||
link7[] = {5,1};
|
||||
link8[] = {6,8};
|
||||
link9[] = {7,8};
|
||||
link10[] = {9,3};
|
||||
link11[] = {10,2};
|
||||
link12[] = {10,11};
|
||||
link13[] = {11,9};
|
||||
globals[] = {25.000000,1,0,0,0,640,480,1,97,6316128,1,-619.928406,50.669247,261.518799,-371.823456,954,901,1};
|
||||
window[] = {2,-1,-1,-32000,-32000,1145,315,1286,203,3,972};
|
||||
*//*%FSM</HEAD>*/
|
||||
class FSM
|
||||
{
|
||||
fsmName = "DayZ Trap";
|
||||
class States
|
||||
{
|
||||
/*%FSM<STATE "init">*/
|
||||
class init
|
||||
{
|
||||
name = "init";
|
||||
init = /*%FSM<STATEINIT""">*/"_trap = _this select 0;" \n
|
||||
""/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "local">*/
|
||||
class local
|
||||
{
|
||||
priority = 2.000000;
|
||||
to="wait";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"local _trap"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_pos = getPosATL _trap;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "server">*/
|
||||
class server
|
||||
{
|
||||
priority = 1.000000;
|
||||
to="end";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"isServer"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"[_trap] call eh_localCleanup;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "true">*/
|
||||
class true
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="end";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/""/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "Open">*/
|
||||
class Open
|
||||
{
|
||||
name = "Open";
|
||||
init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "closed">*/
|
||||
class closed
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="wait";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"((_trap animationPhase ""LeftShutter"") > 0)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"[nil,_trap,rSAY,[""trap_bear_0"",60]] call RE;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "nearby">*/
|
||||
class nearby
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="wait";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"count (_pos nearEntities 0.5) > 0"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_ent = (_pos nearEntities 0.5) select 0;" \n
|
||||
"" \n
|
||||
"//Sound/Animate" \n
|
||||
"[nil,_trap,rSAY,[""trap_bear_0"",60]] call RE;" \n
|
||||
"_trap animate [""LeftShutter"",1];" \n
|
||||
"_trap animate [""RightShutter"",1];" \n
|
||||
"" \n
|
||||
"if (_ent isKindOf ""Animal"") then {" \n
|
||||
" _ent setDamage 1;" \n
|
||||
"} else {" \n
|
||||
" _ent setHit [""legs"",1];" \n
|
||||
" _ent setVariable [""hit_legs"",2,true];" \n
|
||||
"};"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "wait">*/
|
||||
class wait
|
||||
{
|
||||
name = "wait";
|
||||
init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "opened">*/
|
||||
class opened
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Open";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"!((_trap animationPhase ""LeftShutter"") > 0)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "end">*/
|
||||
class end
|
||||
{
|
||||
name = "end";
|
||||
init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
};
|
||||
initState="init";
|
||||
finalStates[] =
|
||||
{
|
||||
"end",
|
||||
};
|
||||
};
|
||||
/*%FSM</COMPILE>*/
|
||||
702
dayz_code/system/zombie_agent.fsm
Normal file
702
dayz_code/system/zombie_agent.fsm
Normal file
@@ -0,0 +1,702 @@
|
||||
/*%FSM<COMPILE "D:\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Zombie Agent">*/
|
||||
/*%FSM<HEAD>*/
|
||||
/*
|
||||
item0[] = {"init",0,250,-75.000000,-250.000000,25.000000,-200.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,0.000000,25.000000,50.000000,0.000000,"wait"};
|
||||
item3[] = {"Looking_for_Targ",2,250,-75.000000,75.000000,25.000000,125.000000,0.000000,"Looking for" \n "Target"};
|
||||
item4[] = {"Not_Alive",4,218,0.000000,300.000000,100.000000,350.000000,5.000000,"Not" \n "Alive"};
|
||||
item5[] = {"Nobody_Near",4,218,0.000000,375.000000,100.000000,425.000000,4.000000,"Nobody" \n "Near"};
|
||||
item6[] = {"loiter",4,218,-325.000000,0.000000,-225.000000,50.000000,0.000000,"loiter"};
|
||||
item7[] = {"Loiter",2,250,-325.000000,75.000000,-225.000000,125.000000,0.000000,"Loiter"};
|
||||
item8[] = {"In_Position",4,218,-200.000000,75.000000,-100.000000,125.000000,1.000000,"In Position"};
|
||||
item9[] = {"",7,210,-29.000042,321.000000,-20.999958,329.000000,0.000000,""};
|
||||
item10[] = {"",7,210,-29.000042,395.999939,-20.999958,404.000061,0.000000,""};
|
||||
item11[] = {"true",8,218,-75.000000,-175.000000,25.000000,-125.000000,0.000000,"true"};
|
||||
item12[] = {"Begin",2,250,-75.000000,-100.000000,25.000000,-50.000000,0.000000,"Begin"};
|
||||
item13[] = {"",7,210,-29.000006,-29.000004,-20.999996,-20.999996,0.000000,""};
|
||||
item14[] = {"",7,210,-279.000061,-29.000004,-270.999969,-20.999996,0.000000,""};
|
||||
item15[] = {"",7,210,-254.000046,146.000000,-245.999954,154.000000,0.000000,""};
|
||||
item16[] = {"Has_Target",4,218,-150.000000,225.000000,-50.000000,275.000000,1.000000,"Has" \n "Target"};
|
||||
item17[] = {"Chase",2,4346,-150.000000,300.000000,-50.000000,350.000000,0.000000,"Chase"};
|
||||
item18[] = {"Time_Check",4,218,50.000000,75.000000,150.000000,125.000000,0.000000,"Time" \n "Check"};
|
||||
item19[] = {"",7,210,-29.000006,146.000000,-20.999996,154.000000,0.000000,""};
|
||||
item20[] = {"",7,210,-29.000006,196.000000,-20.999996,204.000000,0.000000,""};
|
||||
item21[] = {"",7,210,-104.000000,196.000000,-95.999992,204.000000,0.000000,""};
|
||||
item22[] = {"Time_Check",4,218,-450.000000,75.000000,-350.000000,125.000000,0.000000,"Time" \n "Check"};
|
||||
item23[] = {"Time_Check",4,218,-275.000000,300.000000,-175.000000,350.000000,0.000000,"Time" \n "Check"};
|
||||
item24[] = {"No_Target",4,218,-275.000000,375.000000,-175.000000,425.000000,3.000000,"No" \n "Target"};
|
||||
item25[] = {"",7,210,-479.000000,396.000000,-471.000000,404.000000,0.000000,""};
|
||||
item26[] = {"",7,210,-479.000000,146.000000,-471.000000,154.000000,0.000000,""};
|
||||
item27[] = {"",7,210,221.000000,321.000000,229.000000,329.000000,0.000000,""};
|
||||
item28[] = {"",7,210,221.000000,396.000000,229.000000,404.000000,0.000000,""};
|
||||
item29[] = {"Cleanup_",2,250,175.000000,200.000000,275.000000,250.000000,0.000000,"Cleanup?"};
|
||||
item30[] = {"nobody_around",4,218,175.000000,-25.000000,275.000000,25.000000,0.000000,"nobody" \n "around"};
|
||||
item31[] = {"",7,210,-104.000023,396.000000,-95.999992,404.000000,0.000000,""};
|
||||
item32[] = {"cant_see",4,218,-275.000000,450.000000,-175.000000,500.000000,2.000000,"cant" \n "see"};
|
||||
item33[] = {"Finish_Move",2,250,-275.000000,525.000000,-175.000000,575.000000,0.000000,"Finish" \n "Move"};
|
||||
item34[] = {"finished",4,218,-425.000000,525.000000,-325.000000,575.000000,1.000000,"finished"};
|
||||
item35[] = {"",7,210,-479.000000,546.000000,-471.000000,554.000000,0.000000,""};
|
||||
item36[] = {"",7,210,-29.000002,546.000000,-20.999998,554.000000,0.000000,""};
|
||||
item37[] = {"",7,210,-304.000000,146.000000,-296.000000,154.000000,0.000000,""};
|
||||
item38[] = {"someone_here",4,218,300.000000,200.000000,400.000000,250.000000,0.000000,"someone" \n "here"};
|
||||
item39[] = {"wait",2,250,300.000000,125.000000,400.000000,175.000000,0.000000,"wait"};
|
||||
item40[] = {"time_up",4,218,300.000000,-25.000000,400.000000,25.000000,0.000000,"time" \n "up"};
|
||||
item41[] = {"",7,210,346.000000,95.999992,354.000000,104.000000,0.000000,""};
|
||||
item42[] = {"",7,210,221.000000,96.000008,229.000000,103.999977,0.000000,""};
|
||||
item43[] = {"Time_Check",4,218,425.000000,125.000000,525.000000,175.000000,0.000000,"Time" \n "Check"};
|
||||
item44[] = {"",7,210,346.000000,-79.000000,354.000000,-71.000000,0.000000,""};
|
||||
item45[] = {"",7,210,221.000000,-79.000000,229.000000,-71.000000,0.000000,""};
|
||||
item46[] = {"too_long",4,218,-425.000000,600.000000,-325.000000,650.000000,0.000000,"too long"};
|
||||
item47[] = {"",7,210,-229.000000,621.000000,-221.000000,629.000000,0.000000,""};
|
||||
item48[] = {"",7,210,-479.000000,621.000000,-471.000000,629.000000,0.000000,""};
|
||||
item49[] = {"Reset_Targeting",2,250,-525.000000,325.000000,-425.000000,375.000000,0.000000,"Reset" \n "Targeting"};
|
||||
item50[] = {"true",8,218,-525.000000,250.000000,-425.000000,300.000000,0.000000,"true"};
|
||||
item51[] = {"deleted",4,218,425.000000,-25.000000,525.000000,25.000000,0.000000,"deleted"};
|
||||
item52[] = {"",7,210,471.000000,-79.000000,479.000000,-71.000000,0.000000,""};
|
||||
item53[] = {"",7,210,471.000000,95.999977,479.000000,104.000023,0.000000,""};
|
||||
item54[] = {"",7,210,-104.000000,471.000000,-95.999992,479.000000,0.000000,""};
|
||||
item55[] = {"player_check",4,218,-450.000000,0.000000,-350.000000,50.000000,0.000000,"player" \n "check"};
|
||||
item56[] = {"player_check",4,218,50.000000,0.000000,150.000000,50.000000,0.000000,"player" \n "check"};
|
||||
item57[] = {"is_Dedicated",4,218,50.000000,-250.000000,150.000000,-200.000000,5.000000,"is" \n "Dedicated"};
|
||||
link0[] = {0,11};
|
||||
link1[] = {0,57};
|
||||
link2[] = {2,3};
|
||||
link3[] = {3,18};
|
||||
link4[] = {3,19};
|
||||
link5[] = {3,56};
|
||||
link6[] = {4,27};
|
||||
link7[] = {5,28};
|
||||
link8[] = {6,7};
|
||||
link9[] = {7,8};
|
||||
link10[] = {7,15};
|
||||
link11[] = {7,22};
|
||||
link12[] = {7,55};
|
||||
link13[] = {8,7};
|
||||
link14[] = {9,4};
|
||||
link15[] = {9,10};
|
||||
link16[] = {10,5};
|
||||
link17[] = {11,12};
|
||||
link18[] = {12,13};
|
||||
link19[] = {13,2};
|
||||
link20[] = {13,14};
|
||||
link21[] = {14,6};
|
||||
link22[] = {15,19};
|
||||
link23[] = {16,17};
|
||||
link24[] = {17,9};
|
||||
link25[] = {17,23};
|
||||
link26[] = {17,31};
|
||||
link27[] = {18,3};
|
||||
link28[] = {19,20};
|
||||
link29[] = {20,9};
|
||||
link30[] = {20,21};
|
||||
link31[] = {21,16};
|
||||
link32[] = {22,7};
|
||||
link33[] = {23,17};
|
||||
link34[] = {24,25};
|
||||
link35[] = {25,49};
|
||||
link36[] = {26,37};
|
||||
link37[] = {27,29};
|
||||
link38[] = {28,27};
|
||||
link39[] = {29,38};
|
||||
link40[] = {29,42};
|
||||
link41[] = {30,45};
|
||||
link42[] = {31,24};
|
||||
link43[] = {31,54};
|
||||
link44[] = {32,33};
|
||||
link45[] = {33,34};
|
||||
link46[] = {33,36};
|
||||
link47[] = {33,47};
|
||||
link48[] = {34,35};
|
||||
link49[] = {35,25};
|
||||
link50[] = {36,10};
|
||||
link51[] = {37,7};
|
||||
link52[] = {38,39};
|
||||
link53[] = {39,41};
|
||||
link54[] = {39,43};
|
||||
link55[] = {40,44};
|
||||
link56[] = {41,40};
|
||||
link57[] = {41,42};
|
||||
link58[] = {41,53};
|
||||
link59[] = {42,30};
|
||||
link60[] = {43,39};
|
||||
link61[] = {44,45};
|
||||
link62[] = {45,1};
|
||||
link63[] = {46,48};
|
||||
link64[] = {47,46};
|
||||
link65[] = {48,35};
|
||||
link66[] = {49,50};
|
||||
link67[] = {50,26};
|
||||
link68[] = {51,52};
|
||||
link69[] = {52,44};
|
||||
link70[] = {53,51};
|
||||
link71[] = {54,32};
|
||||
link72[] = {55,7};
|
||||
link73[] = {56,3};
|
||||
link74[] = {57,1};
|
||||
globals[] = {25.000000,1,0,0,0,640,480,1,97,6316128,1,-848.842712,436.361816,737.753784,-47.213638,984,601,1};
|
||||
window[] = {2,-1,-1,-1,-1,802,22,1230,22,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;" \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""">*/"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
|
||||
" deleteVehicle _agent;" \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 = time;" \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 "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 "Nobody_Near">*/
|
||||
class Nobody_Near
|
||||
{
|
||||
priority = 4.000000;
|
||||
to="Cleanup_";
|
||||
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 = 1.000000;
|
||||
to="Chase";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"!(isNull _target)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"//Leader cries out" \n
|
||||
"if (_isSomeone) then {" \n
|
||||
" [_agent,""spotted"",0,false] call dayz_zombieSpeak;" \n
|
||||
"};" \n
|
||||
"if (!_hasMoved) then {" \n
|
||||
" _agent setVariable[""doLoiter"",true,true];" \n
|
||||
"};" \n
|
||||
"_countr = 0;" \n
|
||||
"_losCheck = 0;" \n
|
||||
"_cantSee = false;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "player_check">*/
|
||||
class player_check
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Looking_for_Targ";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"(time - _entityTime) > 30"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_entityTime = time;" \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="Looking_for_Targ";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"(time - _timeN) > 1"/*%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
|
||||
"_target = _agent call zombie_findTargetAgent;" \n
|
||||
"" \n
|
||||
"_agent forceSpeed 2;" \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</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%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 "Nobody_Near">*/
|
||||
class Nobody_Near
|
||||
{
|
||||
priority = 4.000000;
|
||||
to="Cleanup_";
|
||||
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 = 1.000000;
|
||||
to="Chase";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"!(isNull _target)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"//Leader cries out" \n
|
||||
"if (_isSomeone) then {" \n
|
||||
" [_agent,""spotted"",0,false] call dayz_zombieSpeak;" \n
|
||||
"};" \n
|
||||
"if (!_hasMoved) then {" \n
|
||||
" _agent setVariable[""doLoiter"",true,true];" \n
|
||||
"};" \n
|
||||
"_countr = 0;" \n
|
||||
"_losCheck = 0;" \n
|
||||
"_cantSee = false;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "In_Position">*/
|
||||
class In_Position
|
||||
{
|
||||
priority = 1.000000;
|
||||
to="Loiter";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"_agent distance (_agent getVariable [""myDest"",getposATL _agent]) < 3"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"[_agent,_position] call zombie_loiter;" \n
|
||||
"_myDest = _agent getVariable [""myDest"",getposATL _agent];" \n
|
||||
""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "player_check">*/
|
||||
class player_check
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Loiter";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"(time - _entityTime) > 30"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_entityTime = time;" \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""">*/"(time - _timeN) > 1"/*%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
|
||||
"_hasMoved = _doLoiter;" \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</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "loiter">*/
|
||||
class loiter
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Loiter";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"_hasMoved"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%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 = time;" \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
|
||||
"//Move to target" \n
|
||||
"_agent moveTo _targetPos;" \n
|
||||
"_agent forceSpeed 5;" \n
|
||||
"" \n
|
||||
"//Check if LOS" \n
|
||||
"if (_losCheck == 2) then {" \n
|
||||
" _losCheck = 0;" \n
|
||||
" _cantSee = [_agent,_target] call dayz_losCheck;" \n
|
||||
"};" \n
|
||||
""/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%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 "Nobody_Near">*/
|
||||
class Nobody_Near
|
||||
{
|
||||
priority = 4.000000;
|
||||
to="Cleanup_";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"!_isSomeone"/*%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)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%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""">*/""/*%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) > 1"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_losCheck = _losCheck + 1;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "Cleanup_">*/
|
||||
class Cleanup_
|
||||
{
|
||||
name = "Cleanup_";
|
||||
init = /*%FSM<STATEINIT""">*/"_waitStart = time;" \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""">*/"dayz_spawnZombies = dayz_spawnZombies - 1;"/*%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 = time;" \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 = 4.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""">*/""/*%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""">*/"(time - _timeN) > 10"/*%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 = time;"/*%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""">*/"(time - _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""">*/"dayz_spawnZombies = dayz_spawnZombies - 1;"/*%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""">*/"(time - _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""">*/"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</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "true">*/
|
||||
class true
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="Loiter";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
};
|
||||
initState="init";
|
||||
finalStates[] =
|
||||
{
|
||||
"End",
|
||||
};
|
||||
};
|
||||
/*%FSM</COMPILE>*/
|
||||
Reference in New Issue
Block a user