diff --git a/Server_Install_Pack/@epochhive/addons/epoch_server.pbo b/Server_Install_Pack/@epochhive/addons/epoch_server.pbo index 82ee8d48..1dc625d2 100644 Binary files a/Server_Install_Pack/@epochhive/addons/epoch_server.pbo and b/Server_Install_Pack/@epochhive/addons/epoch_server.pbo differ diff --git a/Server_Install_Pack/@epochhive/addons/epoch_server_core.pbo b/Server_Install_Pack/@epochhive/addons/epoch_server_core.pbo index 470fbe29..ae44b882 100644 Binary files a/Server_Install_Pack/@epochhive/addons/epoch_server_core.pbo and b/Server_Install_Pack/@epochhive/addons/epoch_server_core.pbo differ diff --git a/Server_Install_Pack/@epochhive/addons/epoch_server_settings.pbo b/Server_Install_Pack/@epochhive/addons/epoch_server_settings.pbo index e4fed799..f7102b80 100644 Binary files a/Server_Install_Pack/@epochhive/addons/epoch_server_settings.pbo and b/Server_Install_Pack/@epochhive/addons/epoch_server_settings.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Altis.pbo b/Server_Install_Pack/mpmissions/epoch.Altis.pbo index 97347ae8..c9ac2aff 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Altis.pbo and b/Server_Install_Pack/mpmissions/epoch.Altis.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Australia.pbo b/Server_Install_Pack/mpmissions/epoch.Australia.pbo index f6befeac..6581433f 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Australia.pbo and b/Server_Install_Pack/mpmissions/epoch.Australia.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Bootcamp_ACR.pbo b/Server_Install_Pack/mpmissions/epoch.Bootcamp_ACR.pbo index bdac0498..67aaadac 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Bootcamp_ACR.pbo and b/Server_Install_Pack/mpmissions/epoch.Bootcamp_ACR.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Bornholm.pbo b/Server_Install_Pack/mpmissions/epoch.Bornholm.pbo index 1188c978..2b264fb2 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Bornholm.pbo and b/Server_Install_Pack/mpmissions/epoch.Bornholm.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Chernarus.pbo b/Server_Install_Pack/mpmissions/epoch.Chernarus.pbo index 9b302345..7fc39d4b 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Chernarus.pbo and b/Server_Install_Pack/mpmissions/epoch.Chernarus.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Chernarus_Summer.pbo b/Server_Install_Pack/mpmissions/epoch.Chernarus_Summer.pbo index 4532d5bf..15feaf2c 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Chernarus_Summer.pbo and b/Server_Install_Pack/mpmissions/epoch.Chernarus_Summer.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Desert_E.pbo b/Server_Install_Pack/mpmissions/epoch.Desert_E.pbo index f76a6bc5..781299df 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Desert_E.pbo and b/Server_Install_Pack/mpmissions/epoch.Desert_E.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Esseker.pbo b/Server_Install_Pack/mpmissions/epoch.Esseker.pbo index de09d04c..e3ff27df 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Esseker.pbo and b/Server_Install_Pack/mpmissions/epoch.Esseker.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Mountains_ACR.pbo b/Server_Install_Pack/mpmissions/epoch.Mountains_ACR.pbo index e0cd6253..b189d411 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Mountains_ACR.pbo and b/Server_Install_Pack/mpmissions/epoch.Mountains_ACR.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Napf.pbo b/Server_Install_Pack/mpmissions/epoch.Napf.pbo index 77ec4f05..0e240fa4 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Napf.pbo and b/Server_Install_Pack/mpmissions/epoch.Napf.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Porto.pbo b/Server_Install_Pack/mpmissions/epoch.Porto.pbo index 3341d646..c6f538b2 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Porto.pbo and b/Server_Install_Pack/mpmissions/epoch.Porto.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.ProvingGrounds_PMC.pbo b/Server_Install_Pack/mpmissions/epoch.ProvingGrounds_PMC.pbo index 478280c2..9db899dd 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.ProvingGrounds_PMC.pbo and b/Server_Install_Pack/mpmissions/epoch.ProvingGrounds_PMC.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Sara.pbo b/Server_Install_Pack/mpmissions/epoch.Sara.pbo index e56e0cc6..cb87c139 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Sara.pbo and b/Server_Install_Pack/mpmissions/epoch.Sara.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.SaraLite.pbo b/Server_Install_Pack/mpmissions/epoch.SaraLite.pbo index 6181cdba..9ffc0d95 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.SaraLite.pbo and b/Server_Install_Pack/mpmissions/epoch.SaraLite.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Sara_dbe1.pbo b/Server_Install_Pack/mpmissions/epoch.Sara_dbe1.pbo index ba05fb71..44e166f0 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Sara_dbe1.pbo and b/Server_Install_Pack/mpmissions/epoch.Sara_dbe1.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Shapur_BAF.pbo b/Server_Install_Pack/mpmissions/epoch.Shapur_BAF.pbo index 3d711fb5..b2e378c8 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Shapur_BAF.pbo and b/Server_Install_Pack/mpmissions/epoch.Shapur_BAF.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Stratis.pbo b/Server_Install_Pack/mpmissions/epoch.Stratis.pbo index 496e0d64..e21b1eb9 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Stratis.pbo and b/Server_Install_Pack/mpmissions/epoch.Stratis.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Takistan.pbo b/Server_Install_Pack/mpmissions/epoch.Takistan.pbo index ee01c24d..4aa1fc5b 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Takistan.pbo and b/Server_Install_Pack/mpmissions/epoch.Takistan.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Tanoa.pbo b/Server_Install_Pack/mpmissions/epoch.Tanoa.pbo index 2d3d4efe..060af12c 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Tanoa.pbo and b/Server_Install_Pack/mpmissions/epoch.Tanoa.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.VR.pbo b/Server_Install_Pack/mpmissions/epoch.VR.pbo index 1c9bf93c..de97f435 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.VR.pbo and b/Server_Install_Pack/mpmissions/epoch.VR.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Woodland_ACR.pbo b/Server_Install_Pack/mpmissions/epoch.Woodland_ACR.pbo index 8e28ebe0..a736633b 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Woodland_ACR.pbo and b/Server_Install_Pack/mpmissions/epoch.Woodland_ACR.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.Zargabad.pbo b/Server_Install_Pack/mpmissions/epoch.Zargabad.pbo index d8a0381f..2b10718d 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.Zargabad.pbo and b/Server_Install_Pack/mpmissions/epoch.Zargabad.pbo differ diff --git a/Server_Install_Pack/mpmissions/epoch.utes.pbo b/Server_Install_Pack/mpmissions/epoch.utes.pbo index 37c0f557..590f7995 100644 Binary files a/Server_Install_Pack/mpmissions/epoch.utes.pbo and b/Server_Install_Pack/mpmissions/epoch.utes.pbo differ diff --git a/Sources/epoch_code/System/EPOCH_zombie_brain.fsm b/Sources/epoch_code/System/EPOCH_zombie_brain.fsm index ae787b17..83a52d95 100644 --- a/Sources/epoch_code/System/EPOCH_zombie_brain.fsm +++ b/Sources/epoch_code/System/EPOCH_zombie_brain.fsm @@ -1,4 +1,4 @@ -/*%FSM*/ +/*%FSM*/ /*%FSM*/ /* item0[] = {"brainz",0,250,-25.000000,-25.000000,75.000000,25.000000,0.000000,"brainz"}; @@ -29,9 +29,9 @@ item24[] = {"sight___target",4,218,550.000000,-350.000000,650.000000,-300.000000 item25[] = {"hearing___target",4,218,650.000000,-325.000000,750.000000,-275.000000,80.000000,"hearing / target"}; item26[] = {"nearest_target",4,218,725.000000,0.000000,825.000000,50.000000,75.000000,"nearest" \n "target"}; item27[] = {"spin",2,250,0.000000,-500.000000,100.000000,-450.000000,0.000000,"spin"}; -item28[] = {"wait",4,218,100.000000,-425.000000,200.000000,-375.000000,0.000000,"wait"}; +item28[] = {"wait",4,4314,100.000000,-425.000000,200.000000,-375.000000,0.000000,"wait"}; item29[] = {"scream",4,218,200.000000,-475.000000,300.000000,-425.000000,80.000000,"scream"}; -item30[] = {"____FAKE____",9,352,0.000000,0.000000,0.000000,0.000000,0.000000,"____FAKE____"}; +item30[] = {"____FAKE____",9,0,0.000000,0.000000,0.000000,0.000000,0.000000,"____FAKE____"}; link0[] = {0,17}; link1[] = {1,2}; link2[] = {2,3}; @@ -79,883 +79,915 @@ link43[] = {30,10}; link44[] = {30,19}; link45[] = {30,22}; link46[] = {30,26}; -globals[] = {0.000000,0,0,0,0,640,480,1,266,6316128,1,-207.474609,835.795471,312.554321,-630.442322,978,884,1}; -window[] = {2,-1,-1,-1,-1,707,182,1207,182,3,996}; +globals[] = {0.000000,0,0,0,0,640,480,1,266,6316128,1,-207.474609,835.795471,312.554321,-630.442322,978,854,1}; +window[] = {2,-1,-1,-1,-1,655,130,1155,130,3,996}; *//*%FSM*/ class FSM { - fsmName = "zombie"; - class States - { - /*%FSM*/ - class brainz - { - name = "brainz"; - init = /*%FSM*/"_zombie = _this select 0;" \n - "_sBomb = _this select 1;" \n - "_head = objNull;" \n - "_lastAlert = diag_tickTime;" \n - "_trgt = player;" \n - "" \n - "//Defaults" \n - "_fsmPath = ""epoch_code\system"";" \n - "_zombie setBehaviour ""CARELESS"";" \n - "_zombie setUnitPos ""UP""; " \n - "_trgtArr = [""Epoch_Man_Base_F"",""Epoch_Female_base_F""];" \n - "_vehArray = [""Car""];" \n - "_trgt = player;" \n - "_t = diag_tickTime;" \n - "_zedPos = getPosATL _zombie;" \n - "" \n - "//Behaviour Vars" \n - "_attackDist = getNumber (getMissionConfig ""CfgEpochRyanZombie"" >> ""attackDist"");" \n - "_groanTrig = getNumber (getMissionConfig ""CfgEpochRyanZombie"" >> ""groanTrig"");" \n - "_zRange = getNumber (getMissionConfig ""CfgEpochRyanZombie"" >> ""range"");" \n - "_sHideTrig = getNumber (getMissionConfig ""CfgEpochRyanZombie"" >> ""hideLevel""); " \n - "_moveTrig = getNumber (getMissionConfig ""CfgEpochRyanZombie"" >> ""chargeLevel""); " \n - "_sHardness = floor (random 6) max 1;" \n - "_checkFreq = getNumber (getMissionConfig ""CfgEpochRyanZombie"" >> ""reflexSpeed"");" \n - "_welcomeWait = random 4;" \n - "_config = 'CfgEpochClient' call EPOCH_returnConfig;" \n - "_jammerRange = getNumber(_config >> ""buildingJammerRange"");" \n - "_zSmell = getArray (getMissionConfig ""CfgEpochRyanZombie"" >> ""smell"");" \n - "_zSight = getArray (getMissionConfig ""CfgEpochRyanZombie"" >> ""sight"");" \n - "_zHear = getArray (getMissionConfig ""CfgEpochRyanZombie"" >> ""hearing"");" \n - "_zMem = getArray (getMissionConfig ""CfgEpochRyanZombie"" >> ""memory"");" \n - "_zMoans = getArray (getMissionConfig ""CfgEpochRyanZombie"" >> ""moans"");" \n - "_zScreams = getArray (getMissionConfig ""CfgEpochRyanZombie"" >> ""screams"");" \n - "" \n - "//Smell" \n - "_smellDist = _zSmell select 0;" \n - "_smellCoeff = _zSmell select 1;" \n - "" \n - "//Sight" \n - "_sightDist = _zSight select 0;" \n - "_sightCoeff = _zSight select 1;" \n - "_sight = [_zombie, ""VIEW""] checkVisibility [eyePos _zombie,aimPos _trgt];" \n - "" \n - "//Hearing" \n - "_hearDist = _zHear select 0;" \n - "_hearCoeff = _zHear select 1;" \n - "_zFiredNear = _zombie getVariable [""zFiredNear"",[objNull, 0]];" \n - "_shotDist = 0;" \n - "" \n - "//Memory" \n - "_memTime = _zMem select 0;" \n - "_memCoeff = _zMem select 1;" \n - "_m = _t;" \n - "_spottedPos = [0,0,0];" \n - "" \n - "//Moving" \n - "_moveTo = [0,0,0];" \n - "" \n - "//Attack" \n - "_lastAttack = _t;" \n - "_doAttack = false;" \n - "" \n - "//Sounds" \n - "_doMoan = false;" \n - "_doScream = false;" \n - "_lastMoan = _t;" \n - "" \n - "//Missions" \n - "_traderDispose = false;" \n - "" \n - "//FSM" \n - "_walkHandle = -1;" \n - "" \n - "_requestDispose = false;" \n - "_nrstTrgt = objNull;" \n - "_lowDist = 0;" \n - "_currDist = 0;" \n - "_filterBuilds = [""Land_i_Addon_03_V1_F"",""Land_Offices_01_V1_F""];" \n - "" \n - "_u = _t;" \n - "_c = _u;" \n - "_f = _c;" \n - "_h = _f;" \n - "_d2 = _h;" \n - "" \n - "" \n - "" \n - "_dirTo = 0;" \n - "_lDist = 0;" \n - "_checkEntry = """";" \n - "" \n - "_decisionMade = false;" \n - "_actionDone = false;" \n - "_zombiePos=[0,0,0];" \n - "_moveTo=[0,0,0];" \n - "_trgtPos=[0,0,0];" \n - "_hidePos = [0,0,0];" \n - "_nrPlyrs = [];" \n - "_circlePos = [0,0,0];" \n - "_behindPos = [0,0,0];" \n - "_sSide = 90;" \n - "" \n - "_vectTot = [0,0,0];" \n - "" \n - "_lastAction = """";" \n - "_maxStalkDist = 48;" \n - "_maxStalkDistPerm = 48;" \n - "_minStalkDist = 12;" \n - "_minStalkDistPerm = 12;" \n - "_doWander = false;" \n - "_callHide = false;" \n - "_callMove = false;" \n - "_callGroan = false;" \n - "" \n - "//Feeling vars" \n - "_sAnger = 50;" \n - "_sFear = 50;" \n - "_threateLevel = 0;" \n - "_addThreat = 0;" \n - "_sHit = [objNull, 0];" \n - "" \n - "_angerCoeff = random 1;" \n - "_calmAngerCoeff = 1 - _angerCoeff;" \n - "_fearCoeff = random 1;" \n - "_calmFearCoeff = 1 - _fearCoeff;" \n - "" \n - "_stuckCount = 0;" \n - "" \n - "_traderDispose = false;" \n - "" \n - "_doMove = false;" \n - "_sanityCheckDone = false;" \n - "_canSee = ([_zombie, ""VIEW""] checkVisibility [eyePos _zombie,aimPos _trgt] >= 0.5);" \n - "_nrTrgts = [];" \n - "_threatLevel = 0;" \n - "_trgtDist = _trgt distance _zombie;" \n - "_sanityCheck = 0;" \n - "_doHide = false;" \n - "_doAttack = false;" \n - "_firedNear = 0;" \n - "" \n - "" \n - "" \n - "" \n - "//Debug - Uncomment Sounds for live" \n - "_randomGroan = {" \n - "/*" \n - "_sounds = [""sapper_groan0"",""sapper_groan1"",""sapper_groan2""];" \n - "_sound = selectRandom _sounds;" \n - "" \n - "_zombie say3D _sound;" \n - "_say3D_PVS = [player, _zombie,(EPOCH_sounds find _sound), Epoch_personalToken];" \n - "_say3D_PVS remoteExec [""EPOCH_server_handle_say3D"",2];" \n - "*/" \n - "};" \n - "" \n - "_doInterrupt = {" \n - "_actionDone = true;" \n - "_criteria = ""(true)"";" \n - "};" \n - "" \n - "//DEBUG" \n - "_doDebug = false;" \n - "axeDebug = _doDebug ;" \n - "if(_doDebug)then{" \n - "axeDebug = true;" \n - "_jammerRange = 75;" \n - "axeZed = _zombie;" \n - "_debugDo = ""START"";" \n - "_mkrName = """";" \n - "};" \n - ""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Wait_random + fsmName = "zombie"; + class States { - priority = 10.000000; - to="reset_vars"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(diag_tickTime - _t) > _welcomeWait;"/*%FSM*/; - action=/*%FSM*/"call _randomGroan;"/*%FSM*/; + /*%FSM*/ + class brainz + { + name = "brainz"; + itemno = 0; + init = /*%FSM*/"_zombie = _this select 0;" \n + "_sBomb = _this select 1;" \n + "_head = objNull;" \n + "_lastAlert = diag_tickTime;" \n + "_trgt = player;" \n + "" \n + "//Defaults" \n + "_fsmPath = ""epoch_code\system"";" \n + "_zombie setBehaviour ""CARELESS"";" \n + "_zombie setUnitPos ""UP""; " \n + "_trgtArr = [""Epoch_Man_Base_F"",""Epoch_Female_base_F""];" \n + "_vehArray = [""Car""];" \n + "_trgt = player;" \n + "_t = diag_tickTime;" \n + "_zedPos = getPosATL _zombie;" \n + "" \n + "//Behaviour Vars" \n + "_attackDist = getNumber (getMissionConfig ""CfgEpochRyanZombie"" >> ""attackDist"");" \n + "_groanTrig = getNumber (getMissionConfig ""CfgEpochRyanZombie"" >> ""groanTrig"");" \n + "_zDisposeRange = getNumber (getMissionConfig ""CfgEpochRyanZombie"" >> ""disposeRange"");" \n + "_sHideTrig = getNumber (getMissionConfig ""CfgEpochRyanZombie"" >> ""hideLevel""); " \n + "_moveTrig = getNumber (getMissionConfig ""CfgEpochRyanZombie"" >> ""chargeLevel""); " \n + "_sHardness = floor (random 6) max 1;" \n + "_checkFreq = getNumber (getMissionConfig ""CfgEpochRyanZombie"" >> ""reflexSpeed"");" \n + "_welcomeWait = random 4;" \n + "_config = 'CfgEpochClient' call EPOCH_returnConfig;" \n + "_jammerRange = getNumber(_config >> ""buildingJammerRange"");" \n + "_zSmell = getArray (getMissionConfig ""CfgEpochRyanZombie"" >> ""smell"");" \n + "_zSight = getArray (getMissionConfig ""CfgEpochRyanZombie"" >> ""sight"");" \n + "_zHear = getArray (getMissionConfig ""CfgEpochRyanZombie"" >> ""hearing"");" \n + "_zMem = getArray (getMissionConfig ""CfgEpochRyanZombie"" >> ""memory"");" \n + "_zMoans = getArray (getMissionConfig ""CfgEpochRyanZombie"" >> ""moans"");" \n + "_zScreams = getArray (getMissionConfig ""CfgEpochRyanZombie"" >> ""screams"");" \n + "" \n + "//Smell" \n + "_smellDist = _zSmell select 0;" \n + "_smellCoeff = _zSmell select 1;" \n + "" \n + "//Sight" \n + "_sightDist = _zSight select 0;" \n + "_sightCoeff = _zSight select 1;" \n + "_sight = [_zombie, ""VIEW""] checkVisibility [eyePos _zombie,aimPos _trgt];" \n + "" \n + "//Hearing" \n + "_hearDist = _zHear select 0;" \n + "_hearCoeff = _zHear select 1;" \n + "_zFiredNear = _zombie getVariable [""zFiredNear"",[objNull, 0]];" \n + "_shotDist = 0;" \n + "" \n + "//Memory" \n + "_memTime = _zMem select 0;" \n + "_memCoeff = _zMem select 1;" \n + "_m = _t;" \n + "_spottedPos = [0,0,0];" \n + "" \n + "//Moving" \n + "_moveTo = [0,0,0];" \n + "" \n + "//Attack" \n + "_lastAttack = _t;" \n + "_doAttack = false;" \n + "" \n + "//Sounds" \n + "_doMoan = false;" \n + "_doScream = false;" \n + "_lastMoan = _t;" \n + "" \n + "//Missions" \n + "_traderDispose = false;" \n + "" \n + "//FSM" \n + "_walkHandle = -1;" \n + "" \n + "_requestDispose = false;" \n + "_nrstTrgt = objNull;" \n + "_lowDist = 0;" \n + "_currDist = 0;" \n + "_filterBuilds = [""Land_i_Addon_03_V1_F"",""Land_Offices_01_V1_F""];" \n + "" \n + "_u = _t;" \n + "_c = _u;" \n + "_f = _c;" \n + "_h = _f;" \n + "_d2 = _h;" \n + "" \n + "" \n + "" \n + "_dirTo = 0;" \n + "_lDist = 0;" \n + "_checkEntry = """";" \n + "" \n + "_decisionMade = false;" \n + "_actionDone = false;" \n + "_zombiePos=[0,0,0];" \n + "_moveTo=[0,0,0];" \n + "_trgtPos=[0,0,0];" \n + "_hidePos = [0,0,0];" \n + "_nrPlyrs = [];" \n + "_circlePos = [0,0,0];" \n + "_behindPos = [0,0,0];" \n + "_sSide = 90;" \n + "" \n + "_vectTot = [0,0,0];" \n + "" \n + "_lastAction = """";" \n + "_maxStalkDist = 48;" \n + "_maxStalkDistPerm = 48;" \n + "_minStalkDist = 12;" \n + "_minStalkDistPerm = 12;" \n + "_doWander = false;" \n + "_callHide = false;" \n + "_callMove = false;" \n + "_callGroan = false;" \n + "" \n + "//Feeling vars" \n + "_sAnger = 50;" \n + "_sFear = 50;" \n + "_threateLevel = 0;" \n + "_addThreat = 0;" \n + "_sHit = [objNull, 0];" \n + "" \n + "_angerCoeff = random 1;" \n + "_calmAngerCoeff = 1 - _angerCoeff;" \n + "_fearCoeff = random 1;" \n + "_calmFearCoeff = 1 - _fearCoeff;" \n + "" \n + "_stuckCount = 0;" \n + "" \n + "_traderDispose = false;" \n + "" \n + "_doMove = false;" \n + "_sanityCheckDone = false;" \n + "_canSee = ([_zombie, ""VIEW""] checkVisibility [eyePos _zombie,aimPos _trgt] >= 0.5);" \n + "_nrTrgts = [];" \n + "_threatLevel = 0;" \n + "_trgtDist = _trgt distance _zombie;" \n + "_sanityCheck = 0;" \n + "_doHide = false;" \n + "_doAttack = false;" \n + "_firedNear = 0;" \n + "" \n + "" \n + "" \n + "" \n + "//Debug - Uncomment Sounds for live" \n + "_randomGroan = {" \n + "/*" \n + "_sounds = [""sapper_groan0"",""sapper_groan1"",""sapper_groan2""];" \n + "_sound = selectRandom _sounds;" \n + "" \n + "_zombie say3D _sound;" \n + "_say3D_PVS = [player, _zombie,(EPOCH_sounds find _sound), Epoch_personalToken];" \n + "_say3D_PVS remoteExec [""EPOCH_server_handle_say3D"",2];" \n + "*/" \n + "};" \n + "" \n + "_doInterrupt = {" \n + "_actionDone = true;" \n + "_criteria = ""(true)"";" \n + "};" \n + "" \n + "//DEBUG" \n + "_doDebug = false;" \n + "axeDebug = _doDebug ;" \n + "if(_doDebug)then{" \n + "axeDebug = true;" \n + "_jammerRange = 75;" \n + "axeZed = _zombie;" \n + "_debugDo = ""START"";" \n + "_mkrName = """";" \n + "};" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Wait_random + { + itemno = 17; + priority = 10.000000; + to="reset_vars"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _t) > _welcomeWait;"/*%FSM*/; + action=/*%FSM*/"call _randomGroan;"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class instinct + { + name = "instinct"; + itemno = 2; + init = /*%FSM*/"//systemchat format[""I %1"",diag_tickTime];" \n + "" \n + "" \n + "" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class dispose + { + itemno = 9; + priority = 200.000000; + to="pre_dispose"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_doDispose || !(alive _zombie)"/*%FSM*/; + action=/*%FSM*/"if(_walkHandle < 0)then{" \n + "_walkHandle setFSMVariable [""_callDispose"", true];" \n + "};" \n + "_zombie removeAllEventHandlers ""Hit"";" \n + "_zombie removeAllEventHandlers ""FiredNear"";" \n + "//[] call EPOCH_zombieSpawn;" \n + "" \n + "_t = diag_tickTime;" \n + "" \n + "//systemChat ""Dispose/Respawn"";"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class dispose_1 + { + itemno = 5; + priority = 100.000000; + to="instinct"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!(alive _zombie) || _traderDispose || _trgtDist > _zDisposeRange;"/*%FSM*/; + action=/*%FSM*/"_doDispose = true;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class attack + { + itemno = 20; + priority = 90.000000; + to="spin"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_doAttack"/*%FSM*/; + action=/*%FSM*/"_zombie moveTo _zedPos;" \n + "_aslPos = ATLToASL _zedPos;" \n + "_trgtPos = getPosASLVisual _trgt;" \n + "_unitV = velocity _zombie;" \n + "_unitvDir = vectorDir _zombie;" \n + "_vDir = _aslPos vectorFromTo _trgtPos;" \n + "_unitvUp = vectorUp _trgt;" \n + "_lastAttack = _t;" \n + "_doAttack = false;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class scream + { + itemno = 29; + priority = 80.000000; + to="instinct"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_doScream"/*%FSM*/; + action=/*%FSM*/"_random = selectRandom _zScreams;" \n + "playSound format [""%1"",_random];" \n + "_doScream = false;" \n + "_debugDo = ""SCREAM"";" \n + "//systemChat ""Scream"";"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class moan + { + itemno = 16; + priority = 70.000000; + to="instinct"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_doMoan && diag_tickTime - _lastMoan > 8"/*%FSM*/; + action=/*%FSM*/"_random = selectRandom _zMoans;" \n + "playSound format [""%1"",_random];" \n + "_doMoan = false;" \n + "_lastMoan = _t;" \n + "_debugDo = ""SOUNDS"";"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class move + { + itemno = 11; + priority = 60.000000; + to="instinct"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!(_moveTo isEqualTo [0,0,0])"/*%FSM*/; + action=/*%FSM*/"if(_walkHandle < 0)then{" \n + "_walkHandle = [""EPOCH_zombie_walking"",_fsmPath,[_zombie]] call EPOCH_fnc_dynamicFSM;" \n + "};" \n + "_walkHandle setFSMVariable [""_nextPos"", _moveTo];" \n + "_moveTo = [0,0,0];" \n + "_debugDo = ""MOVE"";"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class check + { + itemno = 3; + priority = 5.000000; + to="checking_status"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"diag_tickTime > _u + _checkFreq"/*%FSM*/; + action=/*%FSM*/"_sanityCheck = 100;" \n + "_debugDo = ""CHECK"";" \n + "" \n + ""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class pre_dispose + { + name = "pre_dispose"; + itemno = 4; + init = /*%FSM*/"_nrTrgts = _zedPos nearEntities [_trgtArr, 480];" \n + "_canSee = [];" \n + "{" \n + " if !(lineIntersects [eyePos _trgt, eyePos _zombie, _zombie, _trgt]) then{" \n + " _canSee pushBack _x;" \n + " };" \n + "}forEach _nrTrgts;" \n + "if (count _canSee < 1)then{" \n + "deleteVehicle _zombie;" \n + "_t = _t + 480;" \n + "}else{" \n + "_zombie setdamage 1;" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class wait_dispose + { + itemno = 6; + priority = 0.000000; + to="end"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"diag_tickTime - _t > 480;"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class reset_vars + { + name = "reset_vars"; + itemno = 7; + init = /*%FSM*/"//System Vars" \n + "_t = diag_tickTime;" \n + "_u = _t;" \n + "" \n + "_doLoiter = false;" \n + "_loiterType = 0;" \n + "" \n + "_doMove = false;" \n + "_moving = false;" \n + "_moveCount = 0;" \n + "_attempts = 0;" \n + "" \n + "_doGroan = false;" \n + "" \n + "" \n + "_rnd = 0;" \n + "_sWait = 0;" \n + "_doDispose = false;" \n + "_chooseTarget = false;" \n + "" \n + "_nrTrgts=[];" \n + "_doHide = false;" \n + "" \n + "//Moving" \n + "_moving = false;" \n + "" \n + "//Sight" \n + "//_spottedPos = [0,0,0];" \n + "" \n + "//Safezones" \n + "_inSafe = false;" \n + "" \n + "//Dispose" \n + "" \n + "//FSM" \n + "" \n + "" \n + "//Brain Vars" \n + "_override = false;" \n + "_criteria =""(false)"";" \n + "_criteriaMet = false;" \n + "_criteriaMetAction = nil;" \n + "_allowInterrupt = false;" \n + "_interruptReason = ""(false)"";" \n + "" \n + "_debugDo = ""RESET"";" \n + "" \n + "" \n + "" \n + "" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class dispose + { + itemno = 9; + priority = 200.000000; + to="pre_dispose"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_doDispose || !(alive _zombie)"/*%FSM*/; + action=/*%FSM*/"if(_walkHandle < 0)then{" \n + "_walkHandle setFSMVariable [""_callDispose"", true];" \n + "};" \n + "_zombie removeAllEventHandlers ""Hit"";" \n + "_zombie removeAllEventHandlers ""FiredNear"";" \n + "//[] call EPOCH_zombieSpawn;" \n + "" \n + "_t = diag_tickTime;" \n + "" \n + "//systemChat ""Dispose/Respawn"";"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class _ + { + itemno = 1; + priority = 0.000000; + to="instinct"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class checking_status + { + name = "checking_status"; + itemno = 12; + init = /*%FSM*/""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class done + { + itemno = 15; + priority = 100.000000; + to="reset_vars"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_sanityCheck < 1" \n + ""/*%FSM*/; + action=/*%FSM*/"_debugDo = ""CHECKED"";"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class pre_vars___check + { + itemno = 23; + priority = 95.000000; + to="checking_status"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_sanityCheck > 95;"/*%FSM*/; + action=/*%FSM*/"//Zed" \n + "_zedPos = getPosATL _zombie;" \n + "_zedSpeed = speed _zombie;" \n + "" \n + "//Target" \n + "_trgtDist = _trgt distance _zombie;" \n + "_trgtPos = getPosATL _trgt;" \n + "" \n + "//Smell" \n + "_smellVect = [0,0,0];" \n + "_smellPos = [0,0,0];" \n + "_canSmellCount = 0;" \n + "" \n + "//Sight" \n + "_canSee = false;" \n + "_visTrgts = [];" \n + "_sightVect = [0,0,0];" \n + "_spottedVect = [0,0,0];" \n + "" \n + "//Attack" \n + "_sight = 0;" \n + "" \n + "" \n + "//Hearing" \n + "_hearVect = [0,0,0];" \n + "" \n + "//Target" \n + "_spottedVect = [0,0,0];" \n + "" \n + "_vectTot = [0,0,0];" \n + "_vectDiv = 0;" \n + "" \n + "//EH" \n + "_zFiredNear = _zombie getVariable [""zFiredNear"",[objNull, 0]];" \n + "_shotDist = _zFiredNear select 1;" \n + "" \n + "//Memory" \n + "if(diag_tickTime - _m > _memTime)then{" \n + "_spottedPos = [0,0,0];" \n + "};" \n + "" \n + "//Safe Zones" \n + "" \n + "_restricted = nearestObjects [player, [""ProtectionZone_Invisible_F""], 30];" \n + "if !(_restricted isEqualTo []) then {" \n + "_inSafe = true;" \n + "};" \n + "" \n + "_sanityCheck = 95;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class smell + { + itemno = 13; + priority = 90.000000; + to="checking_status"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_sanityCheck > 90 && !_moving && _smellCoeff > 0 && !_inSafe"/*%FSM*/; + action=/*%FSM*/"_nrstTrgt = objNull;" \n + "_nrTrgts = _zedPos nearEntities [_trgtArr, _smellDist];" \n + "_avPos = [0,0,0];" \n + "_upwindPos = [0,0,0];" \n + "" \n + "{" \n + " _upwindPos = [_x, _smellDist, winddir] call BIS_fnc_relPos;" \n + " if(_zombie distance _upwindPos < _smellDist + 1)then{" \n + " _canSmellCount = _canSmellCount + 1;" \n + " _avPos = _avPos vectorAdd getPosATL _x;" \n + " };" \n + "} forEach _nrTrgts;" \n + "" \n + "" \n + "if(_canSmellCount > 0)then{" \n + "_smellVect = _zedPos vectorDiff ([_avPos,_canSmellCount] call EPOCH_fnc_vectorDivide);" \n + "_smellVect = [_smellVect,_smellCoeff] call BIS_fnc_vectorMultiply;" \n + "_vectDiv = _vectDiv + 1;" \n + "};" \n + "" \n + "" \n + "_sanityCheck = 90;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class sight___target + { + itemno = 24; + priority = 85.000000; + to="checking_status"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_sanityCheck > 85 && _sightCoeff > 0 && !_inSafe"/*%FSM*/; + action=/*%FSM*/"_nrTrgts = _zedPos nearEntities [_trgtArr, _sightDist];" \n + "" \n + "_sightPos = [0,0,0];" \n + "_avPos = [0,0,0];" \n + "" \n + "_trgtCount = count _nrTrgts;" \n + "_visTrgts = [];" \n + "" \n + "if(_trgtCount > 0)then{" \n + "" \n + "_sight = [_zombie, ""VIEW""] checkVisibility [eyePos _zombie,aimPos _trgt];" \n + "" \n + " {" \n + " if(_sight >= 0.62)then{" \n + " _thisPos = getPosATL _x;" \n + " _relDir = _zombie getRelDir _thisPos;" \n + " if(_relDir < 42 || _relDir > 318)then{" \n + " _visTrgts pushBack _x;" \n + " _avPos = _avPos vectorAdd _thisPos;" \n + " };" \n + " };" \n + " } forEach _nrTrgts;" \n + "" \n + " if(count _visTrgts > 0)then{" \n + " _spottedPos = getPosATL (_visTrgts select 0);" \n + " _sightVect = _zedPos vectorDiff ([_avPos,_trgtCount,false] call EPOCH_fnc_vectorDivide);" \n + " _sightVect = [_sightVect,_sightCoeff] call BIS_fnc_vectorMultiply;" \n + " _vectDiv = _vectDiv + 1;" \n + " _canSee = true;" \n + " }; " \n + "" \n + "};" \n + "_sanityCheck = 85;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class hearing___target + { + itemno = 25; + priority = 80.000000; + to="checking_status"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_sanityCheck > 80 && !_moving && (_shotDist > 0 && _shotDist < _hearDist) && _hearCoeff > 0 && !_inSafe"/*%FSM*/; + action=/*%FSM*/"_trgt = (_zFiredNear select 0);" \n + "_hearTrgtPos = getPosATL _trgt;" \n + "_hearVect = _zedPos vectorDiff _hearTrgtPos;" \n + "_hearVect = [_hearVect,_hearCoeff] call BIS_fnc_vectorMultiply;" \n + "_vectDiv = _vectDiv + 1;" \n + "_zombie setVariable [""zFiredNear"", nil];" \n + "_sanityCheck = 80;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class do_attack + { + itemno = 8; + priority = 70.000000; + to="checking_status"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_sanityCheck > 70 && _sight > 0.6 && _trgtDist < _attackDist && diag_tickTime - _lastAttack > 3 && !_inSafe"/*%FSM*/; + action=/*%FSM*/"_doAttack = true;" \n + "_doScream = true;" \n + "_sanityCheck = 70;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class stuck + { + itemno = 21; + priority = 30.000000; + to="checking_status"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_sanityCheck > 30 && _moving && _attempts > 6 && _zedSpeed < 0.4" \n + "" \n + "" \n + ""/*%FSM*/; + action=/*%FSM*/"" \n + " if (!(_moveTo isEqualTo [0,0,0])) then {" \n + "" \n + " _moveTo = [_moveTo, floor(random 2), floor(random 360)] call BIS_fnc_relPos;" \n + " _zombie moveTo _moveTo;" \n + " _attempts = 0;" \n + " systemChat format[""UnSticking: %1"", diag_tickTime];" \n + " };" \n + "" \n + "_sanityCheck = 30;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class final_checks___r + { + itemno = 14; + priority = 10.000000; + to="checking_status"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_sanityCheck > 10;"/*%FSM*/; + action=/*%FSM*/"" \n + "_sAnger =_sAnger min 100 max 0;" \n + "_sFear =_sFear min 100 max 0;" \n + "" \n + "if(_vectDiv > 0)then{" \n + "_vectTot = _smellVect vectorAdd _sightVect vectorAdd _hearVect vectorAdd _spottedVect;" \n + "_moveTo = _zedPos vectorDiff ([_vectTot,_vectDiv,false] call EPOCH_fnc_vectorDivide);" \n + "_doMoan = true;" \n + "//_moveTo = [_moveTo, floor(random 2), floor(random 360)] call BIS_fnc_relPos;" \n + "};" \n + "" \n + "" \n + "if(_zedPos distance _spottedPos < 3)then{" \n + "_spottedPos = [0,0,0];" \n + "};" \n + "" \n + "if(_zombie getVariable [""EPOCH_callGroan"",false])then{_zombie setVariable [""EPOCH_callGroan"",false];_callGroan = true; _doGroan = true;};" \n + "if(_zombie getVariable [""EPOCH_callBoom"",false])then{_zombie setVariable [""EPOCH_callBoom"",false];_callBoom = true; _doBoom = true;};" \n + "" \n + "" \n + "if(_doDebug)then{" \n + "_plyrVel = velocity player;" \n + "_plyrVelSpeed = (_plyrVel select 0) + (_plyrVel select 1);" \n + "_plyRelDir = (player getRelDir _zedPos) - 180; " \n + "hintSilent format [""ZOMBIE (%4)\nStalk: %1 / %2\nDist To Move: %3 | Plyr:%6\nSee: %5 (%20)\nAnger: %7\nFear: %8\nHit: %9\nNear: %10\nSmell: %11\nMoved(ing):%12(%17)\nAttempts: %15\nPlyr Vel: %13\nRDir: %14\nSpeed: %16\nVectors: %18\nFPS: %19"",_minStalkDist,_maxStalkDist,_moveTo distance _zombie,_debugDo, _canSee,_zombie distance _trgt,_sAnger,_sFear,_sHit,_zFiredNear,_canSmellCount,moveToCompleted _zombie, _plyrVelSpeed,_plyRelDir,_attempts,_zedSpeed,_moving,_vectDiv,diag_FPS,_sight];" \n + "[_zombie,_zedPos,wind,""Sign_Arrow_Direction_Pink_F""] call EPOCH_fncHordeMemberVelPointer;" \n + "[""target"",0.8,_moveTo]call EPOCH_fnc_DebugMarker;" \n + "[""zed"",0.8,_zedPos]call EPOCH_fnc_DebugMarker;" \n + "};" \n + "" \n + "_sHit = [objNull, 0];" \n + "_zFiredNear = [objNull, 0];" \n + "_sanityCheck = 0;" \n + "" \n + "" \n + "" \n + ""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class end + { + name = "end"; + itemno = 18; + init = /*%FSM*/"if (!isNull _zombie) then {" \n + "deleteVehicle _zombie;//Move to cleanup" \n + "};" \n + "" \n + "" \n + "" \n + "" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + }; + }; + /*%FSM*/ + /*%FSM*/ + class spin + { + name = "spin"; + itemno = 27; + init = /*%FSM*/"_t = diag_tickTime;" \n + "_zombie setVelocityTransformation [_aslPos,_aslPos,_unitV,_unitV,_unitvDir,_vDir,_unitvUp,_unitvUp,2];"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class wait + { + itemno = 28; + priority = 0.000000; + to="instinct"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"diag_tickTime - _t > 0.6;"/*%FSM*/; + action=/*%FSM*/"[_zombie,_trgt] call EPOCH_client_bitePlayer;"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class ____FAKE____ + { + name = "____FAKE____"; + itemno = 30; + init = /*%FSM*/""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class check_threat + { + itemno = 10; + priority = 80.000000; + to="checking_status"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_sanityCheck > 80;"/*%FSM*/; + action=/*%FSM*/"_avDist = 0;" \n + "_tDist = 0;" \n + "_wepCount = 0;" \n + "_addThreat = 0;" \n + "" \n + "_nrTrgtCount = (count _nrTrgts);" \n + "if (_nrTrgtCount>0) then {" \n + "{" \n + "" \n + "" \n + " if!((currentWeapon _x) == """") then {" \n + " _tDist = _tDist + (_x distance _zombie);" \n + "" \n + " if!(lineIntersects [aimPos _zombie, eyePos _x, _zombie, _x]) then {" \n + " _wepCount = _wepCount + 1;" \n + " };" \n + "" \n + " };" \n + "" \n + "" \n + "}forEach _nrTrgts;" \n + "" \n + "_avDist = _tDist / _nrTrgtCount;" \n + "_addThreat = _wepCount;" \n + "" \n + "" \n + "};" \n + "" \n + "" \n + "_sanityCheck = 80;" \n + ""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class nearest_target + { + itemno = 26; + priority = 75.000000; + to="checking_status"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_sanityCheck > 75 && !_moving && !(_spottedPos isEqualTo [0,0,0]);" \n + "" \n + "" \n + ""/*%FSM*/; + action=/*%FSM*/"_spottedVect = _zedPos vectorDiff _spottedPos;" \n + "_spottedVect = [_spottedVect,_sightCoeff] call BIS_fnc_vectorMultiply;" \n + "_vectDiv = _vectDiv + 1;" \n + "_sanityCheck = 75;" \n + "" \n + ""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class check_target + { + itemno = 19; + priority = 60.000000; + to="checking_status"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_sanityCheck > 60;" \n + "" \n + "" \n + ""/*%FSM*/; + action=/*%FSM*/"" \n + "_trgtDist = _zombie distance _trgt;" \n + "_canSee = (([_zombie, ""VIEW""] checkVisibility [eyePos _zombie,aimPos _trgt] >= 0.5) && _trgtDist < _smellDist);" \n + "_trgtPos = getPosATL _trgt;" \n + "" \n + "if(_trgt getVariable [""EPOCH_callGroan"",false])then{_trgt setVariable [""EPOCH_callGroan"",false];_callGroan = true; _doGroan = true;};" \n + "if(_trgt getVariable [""EPOCH_callBoom"",false])then{_trgt setVariable [""EPOCH_callBoom"",false];_callBoom = true; _doBoom = true;};" \n + "" \n + "_sanityCheck = 60;" \n + "" \n + ""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class feeling + { + itemno = 22; + priority = 50.000000; + to="checking_status"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_sanityCheck > 50;" \n + "" \n + "" \n + ""/*%FSM*/; + action=/*%FSM*/"" \n + "if (_zFiredNear select 1 > 0 && _zFiredNear select 1 < 50) then {" \n + "_sAnger = _sAnger + ( random 2 * _angerCoeff);" \n + "_sFear = _sFear + (random 2 * _fearCoeff);" \n + "if (isPlayer (_sHit select 0)) then {" \n + "_trgt = _sHit select 0;" \n + "};" \n + "};" \n + "" \n + "if (_sHit select 1>0) then {" \n + "_sAnger = _sAnger + (random 14 * _angerCoeff);" \n + "_sFear = _sFear + (random 14 * _fearCoeff);" \n + "if (isPlayer (_sHit select 0)) then {" \n + "_trgt = _sHit select 0;" \n + "};" \n + "};" \n + "" \n + "//Can see target grrr" \n + "if (_canSee) then {" \n + "_sAnger = _sAnger + (random 2 * _angerCoeff);" \n + "};" \n + "" \n + "//can see armed targets" \n + "if (_addThreat > 0) then {" \n + "_sFear = _sFear + (_addThreat * _fearCoeff);" \n + "};" \n + "" \n + "//calm down calm down" \n + "//if (diag_tickTime > _f + 28) then {" \n + "_sAnger = _sAnger - (random _sHardness * _calmAngerCoeff);" \n + "_sFear = _sFear - (random _sHardness * _calmFearCoeff);" \n + "_f = diag_tickTime;" \n + "//};" \n + "" \n + "" \n + "_sanityCheck = 50;" \n + "" \n + ""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class instinct - { - name = "instinct"; - init = /*%FSM*/"//systemchat format[""I %1"",diag_tickTime];" \n - "" \n - "" \n - "" \n - ""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class dispose + initState="brainz"; + finalStates[] = { - priority = 200.000000; - to="pre_dispose"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_doDispose || !(alive _zombie)"/*%FSM*/; - action=/*%FSM*/"if(_walkHandle < 0)then{" \n - "_walkHandle setFSMVariable [""_callDispose"", true];" \n - "};" \n - "_zombie removeAllEventHandlers ""Hit"";" \n - "_zombie removeAllEventHandlers ""FiredNear"";" \n - "//[] call EPOCH_zombieSpawn;" \n - "" \n - "_t = diag_tickTime;" \n - "" \n - "//systemChat ""Dispose/Respawn"";"/*%FSM*/; + "end", }; - /*%FSM*/ - /*%FSM*/ - class dispose_1 - { - priority = 100.000000; - to="instinct"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!(alive _zombie) || _traderDispose || _trgtDist > _zRange;"/*%FSM*/; - action=/*%FSM*/"_doDispose = true;"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class attack - { - priority = 90.000000; - to="spin"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_doAttack"/*%FSM*/; - action=/*%FSM*/"_zombie moveTo _zedPos;" \n - "_aslPos = ATLToASL _zedPos;" \n - "_trgtPos = getPosASLVisual _trgt;" \n - "_unitV = velocity _zombie;" \n - "_unitvDir = vectorDir _zombie;" \n - "_vDir = _aslPos vectorFromTo _trgtPos;" \n - "_unitvUp = vectorUp _trgt;" \n - "_lastAttack = _t;" \n - "_doAttack = false;"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class scream - { - priority = 80.000000; - to="instinct"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_doScream"/*%FSM*/; - action=/*%FSM*/"_random = selectRandom _zScreams;" \n - "playSound format [""%1"",_random];" \n - "_doScream = false;" \n - "_debugDo = ""SCREAM"";" \n - "//systemChat ""Scream"";"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class moan - { - priority = 70.000000; - to="instinct"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_doMoan && diag_tickTime - _lastMoan > 8"/*%FSM*/; - action=/*%FSM*/"_random = selectRandom _zMoans;" \n - "playSound format [""%1"",_random];" \n - "_doMoan = false;" \n - "_lastMoan = _t;" \n - "_debugDo = ""SOUNDS"";"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class move - { - priority = 60.000000; - to="instinct"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!(_moveTo isEqualTo [0,0,0])"/*%FSM*/; - action=/*%FSM*/"if(_walkHandle < 0)then{" \n - "_walkHandle = [""EPOCH_zombie_walking"",_fsmPath,[_zombie]] call EPOCH_fnc_dynamicFSM;" \n - "};" \n - "_walkHandle setFSMVariable [""_nextPos"", _moveTo];" \n - "_moveTo = [0,0,0];" \n - "_debugDo = ""MOVE"";"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class check - { - priority = 5.000000; - to="checking_status"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"diag_tickTime > _u + _checkFreq"/*%FSM*/; - action=/*%FSM*/"_sanityCheck = 100;" \n - "_debugDo = ""CHECK"";" \n - "" \n - ""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class pre_dispose - { - name = "pre_dispose"; - init = /*%FSM*/"_nrTrgts = _zedPos nearEntities [_trgtArr, 480];" \n - "_canSee = [];" \n - "{" \n - " if !(lineIntersects [eyePos _trgt, eyePos _zombie, _zombie, _trgt]) then{" \n - " _canSee pushBack _x;" \n - " };" \n - "}forEach _nrTrgts;" \n - "if (count _canSee < 1)then{" \n - "deleteVehicle _zombie;" \n - "_t = _t + 480;" \n - "}else{" \n - "_zombie setdamage 1;" \n - "};"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class wait_dispose - { - priority = 0.000000; - to="end"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"diag_tickTime - _t > 480;"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class reset_vars - { - name = "reset_vars"; - init = /*%FSM*/"//System Vars" \n - "_t = diag_tickTime;" \n - "_u = _t;" \n - "" \n - "_doLoiter = false;" \n - "_loiterType = 0;" \n - "" \n - "_doMove = false;" \n - "_moving = false;" \n - "_moveCount = 0;" \n - "_attempts = 0;" \n - "" \n - "_doGroan = false;" \n - "" \n - "" \n - "_rnd = 0;" \n - "_sWait = 0;" \n - "_doDispose = false;" \n - "_chooseTarget = false;" \n - "" \n - "_nrTrgts=[];" \n - "_doHide = false;" \n - "" \n - "//Moving" \n - "_moving = false;" \n - "" \n - "//Sight" \n - "//_spottedPos = [0,0,0];" \n - "" \n - "//Safezones" \n - "_inSafe = false;" \n - "" \n - "//Dispose" \n - "" \n - "//FSM" \n - "" \n - "" \n - "//Brain Vars" \n - "_override = false;" \n - "_criteria =""(false)"";" \n - "_criteriaMet = false;" \n - "_criteriaMetAction = nil;" \n - "_allowInterrupt = false;" \n - "_interruptReason = ""(false)"";" \n - "" \n - "_debugDo = ""RESET"";" \n - "" \n - "" \n - "" \n - "" \n - ""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class dispose - { - priority = 200.000000; - to="pre_dispose"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_doDispose || !(alive _zombie)"/*%FSM*/; - action=/*%FSM*/"if(_walkHandle < 0)then{" \n - "_walkHandle setFSMVariable [""_callDispose"", true];" \n - "};" \n - "_zombie removeAllEventHandlers ""Hit"";" \n - "_zombie removeAllEventHandlers ""FiredNear"";" \n - "//[] call EPOCH_zombieSpawn;" \n - "" \n - "_t = diag_tickTime;" \n - "" \n - "//systemChat ""Dispose/Respawn"";"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class _ - { - priority = 0.000000; - to="instinct"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class checking_status - { - name = "checking_status"; - init = /*%FSM*/""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class done - { - priority = 100.000000; - to="reset_vars"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_sanityCheck < 1" \n - ""/*%FSM*/; - action=/*%FSM*/"_debugDo = ""CHECKED"";"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class pre_vars___check - { - priority = 95.000000; - to="checking_status"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_sanityCheck > 95;"/*%FSM*/; - action=/*%FSM*/"//Zed" \n - "_zedPos = getPosATL _zombie;" \n - "_zedSpeed = speed _zombie;" \n - "" \n - "//Target" \n - "_trgtDist = _trgt distance _zombie;" \n - "_trgtPos = getPosATL _trgt;" \n - "" \n - "//Smell" \n - "_smellVect = [0,0,0];" \n - "_smellPos = [0,0,0];" \n - "_canSmellCount = 0;" \n - "" \n - "//Sight" \n - "_canSee = false;" \n - "_visTrgts = [];" \n - "_sightVect = [0,0,0];" \n - "_spottedVect = [0,0,0];" \n - "" \n - "//Attack" \n - "_sight = 0;" \n - "" \n - "" \n - "//Hearing" \n - "_hearVect = [0,0,0];" \n - "" \n - "//Target" \n - "_spottedVect = [0,0,0];" \n - "" \n - "_vectTot = [0,0,0];" \n - "_vectDiv = 0;" \n - "" \n - "//EH" \n - "_zFiredNear = _zombie getVariable [""zFiredNear"",[objNull, 0]];" \n - "_shotDist = _zFiredNear select 1;" \n - "" \n - "//Memory" \n - "if(diag_tickTime - _m > _memTime)then{" \n - "_spottedPos = [0,0,0];" \n - "};" \n - "" \n - "//Safe Zones" \n - "" \n - "_restricted = nearestObjects [player, [""ProtectionZone_Invisible_F""], 30];" \n - "if !(_restricted isEqualTo []) then {" \n - "_inSafe = true;" \n - "};" \n - "" \n - "_sanityCheck = 95;"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class smell - { - priority = 90.000000; - to="checking_status"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_sanityCheck > 90 && !_moving && _smellCoeff > 0 && !_inSafe"/*%FSM*/; - action=/*%FSM*/"_nrstTrgt = objNull;" \n - "_nrTrgts = _zedPos nearEntities [_trgtArr, _smellDist];" \n - "_avPos = [0,0,0];" \n - "_upwindPos = [0,0,0];" \n - "" \n - "{" \n - " _upwindPos = [_x, _smellDist, winddir] call BIS_fnc_relPos;" \n - " if(_zombie distance _upwindPos < _smellDist + 1)then{" \n - " _canSmellCount = _canSmellCount + 1;" \n - " _avPos = _avPos vectorAdd getPosATL _x;" \n - " };" \n - "} forEach _nrTrgts;" \n - "" \n - "" \n - "if(_canSmellCount > 0)then{" \n - "_smellVect = _zedPos vectorDiff ([_avPos,_canSmellCount] call EPOCH_fnc_vectorDivide);" \n - "_smellVect = [_smellVect,_smellCoeff] call BIS_fnc_vectorMultiply;" \n - "_vectDiv = _vectDiv + 1;" \n - "};" \n - "" \n - "" \n - "_sanityCheck = 90;"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class sight___target - { - priority = 85.000000; - to="checking_status"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_sanityCheck > 85 && _sightCoeff > 0 && !_inSafe"/*%FSM*/; - action=/*%FSM*/"_nrTrgts = _zedPos nearEntities [_trgtArr, _sightDist];" \n - "" \n - "_sightPos = [0,0,0];" \n - "_avPos = [0,0,0];" \n - "" \n - "_trgtCount = count _nrTrgts;" \n - "_visTrgts = [];" \n - "" \n - "if(_trgtCount > 0)then{" \n - "" \n - "_sight = [_zombie, ""VIEW""] checkVisibility [eyePos _zombie,aimPos _trgt];" \n - "" \n - " {" \n - " if(_sight >= 0.62)then{" \n - " _thisPos = getPosATL _x;" \n - " _relDir = _zombie getRelDir _thisPos;" \n - " if(_relDir < 42 || _relDir > 318)then{" \n - " _visTrgts pushBack _x;" \n - " _avPos = _avPos vectorAdd _thisPos;" \n - " };" \n - " };" \n - " } forEach _nrTrgts;" \n - "" \n - " if(count _visTrgts > 0)then{" \n - " _spottedPos = getPosATL (_visTrgts select 0);" \n - " _sightVect = _zedPos vectorDiff ([_avPos,_trgtCount,false] call EPOCH_fnc_vectorDivide);" \n - " _sightVect = [_sightVect,_sightCoeff] call BIS_fnc_vectorMultiply;" \n - " _vectDiv = _vectDiv + 1;" \n - " _canSee = true;" \n - " }; " \n - "" \n - "};" \n - "_sanityCheck = 85;"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class hearing___target - { - priority = 80.000000; - to="checking_status"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_sanityCheck > 80 && !_moving && (_shotDist > 0 && _shotDist < _hearDist) && _hearCoeff > 0 && !_inSafe"/*%FSM*/; - action=/*%FSM*/"_trgt = (_zFiredNear select 0);" \n - "_hearTrgtPos = getPosATL _trgt;" \n - "_hearVect = _zedPos vectorDiff _hearTrgtPos;" \n - "_hearVect = [_hearVect,_hearCoeff] call BIS_fnc_vectorMultiply;" \n - "_vectDiv = _vectDiv + 1;" \n - "_zombie setVariable [""zFiredNear"", nil];" \n - "_sanityCheck = 80;"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class do_attack - { - priority = 70.000000; - to="checking_status"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_sanityCheck > 70 && _sight > 0.6 && _trgtDist < _attackDist && diag_tickTime - _lastAttack > 3 && !_inSafe"/*%FSM*/; - action=/*%FSM*/"_doAttack = true;" \n - "_doScream = true;" \n - "_sanityCheck = 70;"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class stuck - { - priority = 30.000000; - to="checking_status"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_sanityCheck > 30 && _moving && _attempts > 6 && _zedSpeed < 0.4" \n - "" \n - "" \n - ""/*%FSM*/; - action=/*%FSM*/"" \n - " if (!(_moveTo isEqualTo [0,0,0])) then {" \n - "" \n - " _moveTo = [_moveTo, floor(random 2), floor(random 360)] call BIS_fnc_relPos;" \n - " _zombie moveTo _moveTo;" \n - " _attempts = 0;" \n - " systemChat format[""UnSticking: %1"", diag_tickTime];" \n - " };" \n - "" \n - "_sanityCheck = 30;"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class final_checks___r - { - priority = 10.000000; - to="checking_status"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_sanityCheck > 10;"/*%FSM*/; - action=/*%FSM*/"" \n - "_sAnger =_sAnger min 100 max 0;" \n - "_sFear =_sFear min 100 max 0;" \n - "" \n - "if(_vectDiv > 0)then{" \n - "_vectTot = _smellVect vectorAdd _sightVect vectorAdd _hearVect vectorAdd _spottedVect;" \n - "_moveTo = _zedPos vectorDiff ([_vectTot,_vectDiv,false] call EPOCH_fnc_vectorDivide);" \n - "_doMoan = true;" \n - "//_moveTo = [_moveTo, floor(random 2), floor(random 360)] call BIS_fnc_relPos;" \n - "};" \n - "" \n - "" \n - "if(_zedPos distance _spottedPos < 3)then{" \n - "_spottedPos = [0,0,0];" \n - "};" \n - "" \n - "if(_zombie getVariable [""EPOCH_callGroan"",false])then{_zombie setVariable [""EPOCH_callGroan"",false];_callGroan = true; _doGroan = true;};" \n - "if(_zombie getVariable [""EPOCH_callBoom"",false])then{_zombie setVariable [""EPOCH_callBoom"",false];_callBoom = true; _doBoom = true;};" \n - "" \n - "" \n - "if(_doDebug)then{" \n - "_plyrVel = velocity player;" \n - "_plyrVelSpeed = (_plyrVel select 0) + (_plyrVel select 1);" \n - "_plyRelDir = (player getRelDir _zedPos) - 180; " \n - "hintSilent format [""ZOMBIE (%4)\nStalk: %1 / %2\nDist To Move: %3 | Plyr:%6\nSee: %5 (%20)\nAnger: %7\nFear: %8\nHit: %9\nNear: %10\nSmell: %11\nMoved(ing):%12(%17)\nAttempts: %15\nPlyr Vel: %13\nRDir: %14\nSpeed: %16\nVectors: %18\nFPS: %19"",_minStalkDist,_maxStalkDist,_moveTo distance _zombie,_debugDo, _canSee,_zombie distance _trgt,_sAnger,_sFear,_sHit,_zFiredNear,_canSmellCount,moveToCompleted _zombie, _plyrVelSpeed,_plyRelDir,_attempts,_zedSpeed,_moving,_vectDiv,diag_FPS,_sight];" \n - "[_zombie,_zedPos,wind,""Sign_Arrow_Direction_Pink_F""] call EPOCH_fncHordeMemberVelPointer;" \n - "[""target"",0.8,_moveTo]call EPOCH_fnc_DebugMarker;" \n - "[""zed"",0.8,_zedPos]call EPOCH_fnc_DebugMarker;" \n - "};" \n - "" \n - "_sHit = [objNull, 0];" \n - "_zFiredNear = [objNull, 0];" \n - "_sanityCheck = 0;" \n - "" \n - "" \n - "" \n - ""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class end - { - name = "end"; - init = /*%FSM*/"if (!isNull _zombie) then {" \n - "deleteVehicle _zombie;//Move to cleanup" \n - "};" \n - "" \n - "" \n - "" \n - "" \n - ""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - }; - }; - /*%FSM*/ - /*%FSM*/ - class spin - { - name = "spin"; - init = /*%FSM*/"_t = diag_tickTime;" \n - "_zombie setVelocityTransformation [_aslPos,_aslPos,_unitV,_unitV,_unitvDir,_vDir,_unitvUp,_unitvUp,2];"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class wait - { - priority = 0.000000; - to="instinct"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"diag_tickTime - _t > 0.6;"/*%FSM*/; - action=/*%FSM*/"_zombie switchMove ""AwopPercMstpSgthWnonDnon_throw"";"/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class ____FAKE____ - { - name = "____FAKE____"; - init = /*%FSM*/""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class check_threat - { - priority = 80.000000; - to="checking_status"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_sanityCheck > 80;"/*%FSM*/; - action=/*%FSM*/"_avDist = 0;" \n - "_tDist = 0;" \n - "_wepCount = 0;" \n - "_addThreat = 0;" \n - "" \n - "_nrTrgtCount = (count _nrTrgts);" \n - "if (_nrTrgtCount>0) then {" \n - "{" \n - "" \n - "" \n - " if!((currentWeapon _x) == """") then {" \n - " _tDist = _tDist + (_x distance _zombie);" \n - "" \n - " if!(lineIntersects [aimPos _zombie, eyePos _x, _zombie, _x]) then {" \n - " _wepCount = _wepCount + 1;" \n - " };" \n - "" \n - " };" \n - "" \n - "" \n - "}forEach _nrTrgts;" \n - "" \n - "_avDist = _tDist / _nrTrgtCount;" \n - "_addThreat = _wepCount;" \n - "" \n - "" \n - "};" \n - "" \n - "" \n - "_sanityCheck = 80;" \n - ""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class nearest_target - { - priority = 75.000000; - to="checking_status"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_sanityCheck > 75 && !_moving && !(_spottedPos isEqualTo [0,0,0]);" \n - "" \n - "" \n - ""/*%FSM*/; - action=/*%FSM*/"_spottedVect = _zedPos vectorDiff _spottedPos;" \n - "_spottedVect = [_spottedVect,_sightCoeff] call BIS_fnc_vectorMultiply;" \n - "_vectDiv = _vectDiv + 1;" \n - "_sanityCheck = 75;" \n - "" \n - ""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class check_target - { - priority = 60.000000; - to="checking_status"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_sanityCheck > 60;" \n - "" \n - "" \n - ""/*%FSM*/; - action=/*%FSM*/"" \n - "_trgtDist = _zombie distance _trgt;" \n - "_canSee = (([_zombie, ""VIEW""] checkVisibility [eyePos _zombie,aimPos _trgt] >= 0.5) && _trgtDist < _smellDist);" \n - "_trgtPos = getPosATL _trgt;" \n - "" \n - "if(_trgt getVariable [""EPOCH_callGroan"",false])then{_trgt setVariable [""EPOCH_callGroan"",false];_callGroan = true; _doGroan = true;};" \n - "if(_trgt getVariable [""EPOCH_callBoom"",false])then{_trgt setVariable [""EPOCH_callBoom"",false];_callBoom = true; _doBoom = true;};" \n - "" \n - "_sanityCheck = 60;" \n - "" \n - ""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class feeling - { - priority = 50.000000; - to="checking_status"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_sanityCheck > 50;" \n - "" \n - "" \n - ""/*%FSM*/; - action=/*%FSM*/"" \n - "if (_zFiredNear select 1 > 0 && _zFiredNear select 1 < 50) then {" \n - "_sAnger = _sAnger + ( random 2 * _angerCoeff);" \n - "_sFear = _sFear + (random 2 * _fearCoeff);" \n - "if (isPlayer (_sHit select 0)) then {" \n - "_trgt = _sHit select 0;" \n - "};" \n - "};" \n - "" \n - "if (_sHit select 1>0) then {" \n - "_sAnger = _sAnger + (random 14 * _angerCoeff);" \n - "_sFear = _sFear + (random 14 * _fearCoeff);" \n - "if (isPlayer (_sHit select 0)) then {" \n - "_trgt = _sHit select 0;" \n - "};" \n - "};" \n - "" \n - "//Can see target grrr" \n - "if (_canSee) then {" \n - "_sAnger = _sAnger + (random 2 * _angerCoeff);" \n - "};" \n - "" \n - "//can see armed targets" \n - "if (_addThreat > 0) then {" \n - "_sFear = _sFear + (_addThreat * _fearCoeff);" \n - "};" \n - "" \n - "//calm down calm down" \n - "//if (diag_tickTime > _f + 28) then {" \n - "_sAnger = _sAnger - (random _sHardness * _calmAngerCoeff);" \n - "_sFear = _sFear - (random _sHardness * _calmFearCoeff);" \n - "_f = diag_tickTime;" \n - "//};" \n - "" \n - "" \n - "_sanityCheck = 50;" \n - "" \n - ""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - }; - initState="brainz"; - finalStates[] = - { - "end", - }; }; -/*%FSM*/ +/*%FSM*/ \ No newline at end of file diff --git a/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf b/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf index 50e1ac2c..9b6a11af 100644 --- a/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf +++ b/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf @@ -125,7 +125,8 @@ switch _unitClass do { case "EPOCH_RyanZombie_1": { for "_i" from 1 to (_spawnLimit - _currentLimit) do { - [] call EPOCH_zombieSpawn; + _unit = [] call EPOCH_zombieSpawn; + _units pushBack _unit; }; }; }; diff --git a/Sources/epoch_code/compile/EPOCH_zombieSpawn.sqf b/Sources/epoch_code/compile/EPOCH_zombieSpawn.sqf index 2ddd996f..2c8c89e0 100644 --- a/Sources/epoch_code/compile/EPOCH_zombieSpawn.sqf +++ b/Sources/epoch_code/compile/EPOCH_zombieSpawn.sqf @@ -23,38 +23,27 @@ params [["_justSpawn",false]]; private ["_zRange","_disableAI","_unitClass","_unit","_clutterPos","_zedHandle","_zMax"]; _disableAI = {{_this disableAI _x}forEach["TARGET","AUTOTARGET","FSM"];}; -_units = []; + _zRange = getNumber (getMissionConfig "CfgEpochRyanZombie" >> "range"); _zeds = getArray (getMissionConfig "CfgEpochRyanZombie" >> "zeds"); -_zMax = getNumber (getMissionConfig "CfgEpochRyanZombie" >> "maxNumber"); -_zDoCnt = 0; -//Check for horde -_nrZeds = nearestObjects [player,_zeds,_zRange]; -_currZCount = count _nrZeds; -if(_currZCount < _zMax)then{_zDoCnt = _zMax - _currZCount;}; -for "_i" from 1 to _zDoCnt step 1 do{ +// _zMax = getNumber (getMissionConfig "CfgEpochRyanZombie" >> "maxNumber"); - _unitClass = selectRandom _zeds; - _unit = createAgent[_unitClass, position player, [], _zRange, "FORM"]; - // todo cleanup this object after some time - //_clutterPos = getPosATL _unit; - //if!(isOnRoad _unit)then{ - // _grave = createVehicle ["Land_Grave_dirt_F", _clutterPos, [], 0, "CAN_COLLIDE"]; - //}; - _unit call _disableAI; - _unit switchMove "AmovPercMstpSnonWnonDnon_SaluteOut"; - [[_unit,player], 4, Epoch_personalToken] remoteExec ["EPOCH_server_handle_switchMove",2]; +_unitClass = selectRandom _zeds; +_unit = createAgent[_unitClass, position player, [], _zRange, "FORM"]; +// todo cleanup this object after some time +//_clutterPos = getPosATL _unit; +//if!(isOnRoad _unit)then{ + // _grave = createVehicle ["Land_Grave_dirt_F", _clutterPos, [], 0, "CAN_COLLIDE"]; +//}; +_unit call _disableAI; +_unit switchMove "AmovPercMstpSnonWnonDnon_SaluteOut"; +[[_unit,player], 4, Epoch_personalToken] remoteExec ["EPOCH_server_handle_switchMove",2]; - _unit setmimic "dead"; - _unit setface (selectRandom ["RyanZombieFace1", "RyanZombieFace2", "RyanZombieFace3", "RyanZombieFace4", "RyanZombieFace5"]); - removegoggles _unit; - _zedHandle = [_unit,true] execFSM "epoch_code\system\EPOCH_zombie_brain.fsm"; - _unit addEventHandler ["FiredNear", "(_this select 0) setVariable [""zFiredNear"",[_this select 1, _this select 2]];"]; - _unit addEventHandler ["Hit", "(_this select 0) setVariable [""zHit"",[_this select 1, _this select 2]];"]; - _units pushBack _unit; +_unit setmimic "dead"; +_unit setface (selectRandom ["RyanZombieFace1", "RyanZombieFace2", "RyanZombieFace3", "RyanZombieFace4", "RyanZombieFace5"]); +removegoggles _unit; +_zedHandle = [_unit,true] execFSM "epoch_code\system\EPOCH_zombie_brain.fsm"; +_unit addEventHandler ["FiredNear", "(_this select 0) setVariable [""zFiredNear"",[_this select 1, _this select 2]];"]; +_unit addEventHandler ["Hit", "(_this select 0) setVariable [""zHit"",[_this select 1, _this select 2]];"]; -}; - -if !(_units isEqualTo []) then { - _units remoteExec ["EPOCH_localCleanup",2]; -}; +_unit diff --git a/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf b/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf index 4642adb1..b0b5cfda 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf @@ -27,6 +27,7 @@ if (currentVisionMode player == 1) then { //NV enabled _energyValue = _energyValue - _energyCostNV; if (EPOCH_playerEnergy == 0) then { player action["nvGogglesOff", player]; + ["Night Vision Goggles: Need Energy", 5] call Epoch_message; }; }; diff --git a/Sources/epoch_code/compile/setup/masterLoop/init.sqf b/Sources/epoch_code/compile/setup/masterLoop/init.sqf index f16b7555..0510677b 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/init.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/init.sqf @@ -6,7 +6,7 @@ _prevEnergy = EPOCH_playerEnergy; // init config data EPOCH_sapperRndChance = ["CfgEpochClient", "sapperRngChance", 100] call EPOCH_fnc_returnConfigEntryV2; -EPOCH_zombieRndChance = ["CfgEpochClient", "zombieRndChance", 100] call EPOCH_fnc_returnConfigEntryV2; +EPOCH_zombieRndChance = ["CfgEpochClient", "zombieRndChance", 50] call EPOCH_fnc_returnConfigEntryV2; EPOCH_droneRndChance = ["CfgEpochClient", "droneRngChance", 100] call EPOCH_fnc_returnConfigEntryV2; _baseHTLoss = ["CfgEpochClient", "baseHTLoss", 8] call EPOCH_fnc_returnConfigEntryV2; _energyCostNV = ["CfgEpochClient", "energyCostNV", 3] call EPOCH_fnc_returnConfigEntryV2; diff --git a/Sources/epoch_code/init/client_init.sqf b/Sources/epoch_code/init/client_init.sqf index 7a4033cb..15ae4856 100644 --- a/Sources/epoch_code/init/client_init.sqf +++ b/Sources/epoch_code/init/client_init.sqf @@ -67,7 +67,7 @@ if(EPOCH_AirDropChance < 0)then{EPOCH_AirDropChance = 101;EPOCH_AirDropCheck = 9 EPOCH_droneRndChance = 100; EPOCH_sapperRndChance = 100; -EPOCH_zombieRndChance = 30; +EPOCH_zombieRndChance = 50; // Custom Keys EPOCH_keysActionPressed = false; //prevents EH spam diff --git a/Sources/epoch_config/Configs/CfgEpochClient.hpp b/Sources/epoch_config/Configs/CfgEpochClient.hpp index 1a05f994..caff811f 100644 --- a/Sources/epoch_config/Configs/CfgEpochClient.hpp +++ b/Sources/epoch_config/Configs/CfgEpochClient.hpp @@ -158,11 +158,13 @@ class CfgEpochCloak }; class CfgEpochRyanZombie { + zeds[] = {"EPOCH_RyanZombie_1","EPOCH_RyanZombie_2","EPOCH_RyanZombie_3","EPOCH_RyanZombie_4","EPOCH_RyanZombie_5"}; attackDist = 1.6; //Attack Distance. - range = 108; //Range at which to dispose old zombies and spawn new ones within. - maxNumber = 12; //Maximum number of zombies within range, - smell[] = {28,0.42}; //Distance in metres up to which the zombie can smell a target. | Skill (0 - 1). 0 - Disable - sight[] = {18,0.72}; //Zombie sight distance | Skill (0 - 1). + range = 45; //Range at which to dispose old zombies and spawn new ones within. + // maxNumber = 12; //Maximum number of zombies within range, + disposeRange = 800; // distance before zombie is disposed + smell[] = {38,0.42}; //Distance in metres up to which the zombie can smell a target. | Skill (0 - 1). 0 - Disable + sight[] = {28,0.72}; //Zombie sight distance | Skill (0 - 1). hearing[] = {108,0.68}; //Zombie hearing distance / Skill. Max FiredNear EH Limit ? memory[] = {480,0.8}; //Memory time. / Weighting. WIP - Not Used reflexSpeed = 0.25; //Zombie brain will pause for this time when checking for new stimulus during each thought process. Lower number equals a more reactive zombie. (Guide Min 0.25 - Max 2.5). diff --git a/Sources/epoch_config/Configs/CfgPricing.hpp b/Sources/epoch_config/Configs/CfgPricing.hpp index 457eb180..9be63df5 100644 --- a/Sources/epoch_config/Configs/CfgPricing.hpp +++ b/Sources/epoch_config/Configs/CfgPricing.hpp @@ -1093,6 +1093,21 @@ class CfgPricing class CUP_B_Ural_Empty_CDF {price = 1000;}; class CUP_C_DC3_CIV {price = 2400;}; + // APEX + class C_Boat_Transport_02_F {price = 1200;}; + class C_Scooter_Transport_01_F {price = 1200;}; + class C_Offroad_02_unarmed_F {price = 3500;}; + class I_C_Offroad_02_unarmed_F {price = 3500;}; + class B_T_LSV_01_unarmed_F {price = 4400;}; + class O_LSV_02_unarmed_F {price = 4300;}; + class O_T_LSV_02_unarmed_F {price = 4600;}; + class C_Plane_Civil_01_F {price = 5000;}; + class C_Plane_Civil_01_racing_F {price = 5000;}; + class B_CTRG_LSV_01_light_F {price = 4400;}; + class B_LSV_01_unarmed_F {price = 4400;}; + class B_T_VTOL_01_infantry_F {price = 10000;}; + class B_T_VTOL_01_vehicle_F {price = 10000;}; + //Mission Items class B_UavTerminal {price = 10;}; class O_UavTerminal {price = 10;}; diff --git a/Sources/epoch_config/build.hpp b/Sources/epoch_config/build.hpp index a42cc601..2d4e97e2 100644 --- a/Sources/epoch_config/build.hpp +++ b/Sources/epoch_config/build.hpp @@ -1 +1 @@ -build=547; +build=552; diff --git a/Sources/epoch_server/build.hpp b/Sources/epoch_server/build.hpp index a42cc601..2d4e97e2 100644 --- a/Sources/epoch_server/build.hpp +++ b/Sources/epoch_server/build.hpp @@ -1 +1 @@ -build=547; +build=552; diff --git a/Sources/epoch_server/compile/epoch_antagonists/EPOCH_server_triggerEvent.sqf b/Sources/epoch_server/compile/epoch_antagonists/EPOCH_server_triggerEvent.sqf index d88115d1..597b4bad 100644 --- a/Sources/epoch_server/compile/epoch_antagonists/EPOCH_server_triggerEvent.sqf +++ b/Sources/epoch_server/compile/epoch_antagonists/EPOCH_server_triggerEvent.sqf @@ -37,8 +37,8 @@ if (!isNull _target) then { case "PHANTOM": { "PHANTOM" remoteExec ['EPOCH_unitSpawnIncrease',_target]; }; - case "EPOCH_RyanZombie_1": { - "EPOCH_RyanZombie_1" remoteExec ['EPOCH_unitSpawnIncrease',_target]; + case "Zombie": { + ["EPOCH_RyanZombie_1",12] remoteExec ['EPOCH_unitSpawnIncrease',_target]; }; }; }; diff --git a/Sources/epoch_server/compile/epoch_server/EPOCH_weightedArray.sqf b/Sources/epoch_server/compile/epoch_server/EPOCH_weightedArray.sqf index 00a3e0e6..3cbc00f0 100644 --- a/Sources/epoch_server/compile/epoch_server/EPOCH_weightedArray.sqf +++ b/Sources/epoch_server/compile/epoch_server/EPOCH_weightedArray.sqf @@ -20,16 +20,22 @@ if(_return isEqualTo[]) then { _weightedArray = []; { if(_x isEqualType []) then { - _lootTableArray pushBack(_x select 0); - for "_i" from 1 to(_x select 1) do { - _weightedArray pushBack _forEachIndex; + _x params ["_tname","_tqty"]; + if (!(_tname isEqualTo "Zombie") || (_tname isEqualTo "Zombie") && EPOCH_mod_Ryanzombies_Enabled) then { + _lootTableArray pushBack _tname; + for "_i" from 1 to _tqty do { + _weightedArray pushBack _forEachIndex; + }; }; } else { - _lootTableArray pushBack _x; - _weightedArray pushBack _forEachIndex; + if (!(_x isEqualTo "Zombie") || (_x isEqualTo "Zombie") && EPOCH_mod_Ryanzombies_Enabled) then { + _lootTableArray pushBack _x; + _weightedArray pushBack _forEachIndex; + }; }; }forEach getArray(configFile >> _configName >> _keyName >> _arrayName); _return = [_lootTableArray,_weightedArray]; missionNamespace setVariable[format["EPOCH_LT_%1_%2_%3",_configName,_keyName,_arrayName],_return]; + diag_log format["EPOCH_LT_%1_%2_%3 = %4",_configName,_keyName,_arrayName,_return]; }; _return diff --git a/Sources/epoch_server_core/build.hpp b/Sources/epoch_server_core/build.hpp index a42cc601..2d4e97e2 100644 --- a/Sources/epoch_server_core/build.hpp +++ b/Sources/epoch_server_core/build.hpp @@ -1 +1 @@ -build=547; +build=552; diff --git a/Sources/epoch_server_settings/build.hpp b/Sources/epoch_server_settings/build.hpp index a42cc601..2d4e97e2 100644 --- a/Sources/epoch_server_settings/build.hpp +++ b/Sources/epoch_server_settings/build.hpp @@ -1 +1 @@ -build=547; +build=552; diff --git a/Sources/epoch_server_settings/configs/CfgMainTable.h b/Sources/epoch_server_settings/configs/CfgMainTable.h index a8dcfe65..d42433d9 100644 --- a/Sources/epoch_server_settings/configs/CfgMainTable.h +++ b/Sources/epoch_server_settings/configs/CfgMainTable.h @@ -21,10 +21,11 @@ class CfgMainTable LootMax = 1; tables[] = { "Food" }; antagonists[] = { - { "UAV", 30 }, - { "Cloak", 25 }, // Night = Epoch_Cloak_F, Day = Epoch_Sapper_F - { "Sapper", 25 }, - { "SapperB", 15 }, + { "Zombie", 40 }, + { "UAV", 15 }, + { "Cloak", 10 }, // Night = Epoch_Cloak_F, Day = Epoch_Sapper_F + { "Sapper", 20 }, + { "SapperB", 10 }, { "PHANTOM", 5 } }; }; @@ -61,10 +62,11 @@ class CfgMainTable { "GenericLarge", 18 } }; antagonists[] = { - { "UAV", 30 }, // I_UAV_01_F - { "Cloak", 30 }, // Night = Epoch_Cloak_F, Day = Epoch_Sapper_F - { "Sapper", 25 }, // Epoch_Sapper_F - { "SapperB", 15 } // Epoch_SapperB_F + { "Zombie", 45 }, + { "UAV", 15 }, + { "Cloak", 10 }, // Night = Epoch_Cloak_F, Day = Epoch_Sapper_F + { "Sapper", 20 }, + { "SapperB", 10 } }; }; class TrashSmall : Default diff --git a/Sources/epoch_server_settings/configs/maps/tanoa.h b/Sources/epoch_server_settings/configs/maps/tanoa.h index 6ca06429..644dc812 100644 --- a/Sources/epoch_server_settings/configs/maps/tanoa.h +++ b/Sources/epoch_server_settings/configs/maps/tanoa.h @@ -81,8 +81,6 @@ class Tanoa : Default {"C_Plane_Civil_01_racing_F",1}, {"B_CTRG_LSV_01_light_F",2}, {"B_LSV_01_unarmed_F",2}, - {"O_T_VTOL_02_infantry_F",1}, - {"O_T_VTOL_02_vehicle_F",1}, {"B_T_VTOL_01_infantry_F",1}, {"B_T_VTOL_01_vehicle_F",1} }; @@ -189,8 +187,6 @@ class Tanoa : Default {"C_Plane_Civil_01_racing_F",1}, {"B_CTRG_LSV_01_light_F",2}, {"B_LSV_01_unarmed_F",2}, - {"O_T_VTOL_02_infantry_F",1}, - {"O_T_VTOL_02_vehicle_F",1}, {"B_T_VTOL_01_infantry_F",1}, {"B_T_VTOL_01_vehicle_F",1} }; diff --git a/build.txt b/build.txt index 47431352..0cad145b 100644 --- a/build.txt +++ b/build.txt @@ -1 +1 @@ -547 +552