From d4362f3b125c20dffcf0cc537656b7a8a8d18972 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Tue, 14 Jun 2016 14:22:22 +0100 Subject: [PATCH] Ryans Support Zombie walking --- .../System/EPOCH_zombie_walking.fsm | 294 ++++++++++++++++++ 1 file changed, 294 insertions(+) create mode 100644 Sources/epoch_code/System/EPOCH_zombie_walking.fsm diff --git a/Sources/epoch_code/System/EPOCH_zombie_walking.fsm b/Sources/epoch_code/System/EPOCH_zombie_walking.fsm new file mode 100644 index 00000000..76dd1ca0 --- /dev/null +++ b/Sources/epoch_code/System/EPOCH_zombie_walking.fsm @@ -0,0 +1,294 @@ +/*%FSM*/ +/*%FSM*/ +/* +item0[] = {"zombie",0,250,-100.000000,-250.000000,0.000000,-200.000000,0.000000,"zombie"}; +item1[] = {"instinct",2,250,150.000000,-175.000000,250.000000,-125.000000,0.000000,"instinct"}; +item2[] = {"action",2,250,150.000000,-25.000000,250.000000,25.000000,0.000000,"action"}; +item3[] = {"dispose",4,218,150.000000,-250.000000,250.000000,-200.000000,90.000000,"dispose"}; +item4[] = {"_",8,218,150.000000,75.000000,250.000000,125.000000,0.000000,""}; +item5[] = {"reset___control",2,250,-100.000000,-100.000000,0.000000,-50.000000,0.000000,"reset / control"}; +item6[] = {"_",8,218,-100.000000,-175.000000,0.000000,-125.000000,0.000000,""}; +item7[] = {"complete",4,218,-100.000000,-25.000000,0.000000,25.000000,100.000000,"complete"}; +item8[] = {"end",1,4346,-100.000000,75.000000,0.000000,125.000000,0.000000,"end"}; +item9[] = {"dispose",4,218,25.000000,75.000000,125.000000,125.000000,120.000000,"dispose"}; +item10[] = {"instinct_done",4,218,150.000000,-100.000000,250.000000,-50.000000,100.000000,"instinct done"}; +item11[] = {"move",4,218,300.000000,-175.000000,400.000000,-125.000000,60.000000,"move"}; +item12[] = {"_",8,218,25.000000,-175.000000,125.000000,-125.000000,0.000000,""}; +item13[] = {"move",4,218,300.000000,-25.000000,400.000000,25.000000,10.000000,"move"}; +item14[] = {"do_move",2,250,300.000000,75.000000,400.000000,125.000000,0.000000,"do move"}; +link0[] = {0,6}; +link1[] = {1,3}; +link2[] = {1,10}; +link3[] = {1,11}; +link4[] = {2,7}; +link5[] = {2,9}; +link6[] = {2,13}; +link7[] = {3,1}; +link8[] = {4,2}; +link9[] = {5,12}; +link10[] = {6,5}; +link11[] = {7,5}; +link12[] = {9,8}; +link13[] = {10,2}; +link14[] = {11,1}; +link15[] = {12,1}; +link16[] = {13,14}; +link17[] = {14,4}; +globals[] = {25.000000,0,0,0,0,640,480,1,246,6316128,1,-246.574387,523.779114,344.046051,-352.794586,1006,910,1}; +window[] = {2,-1,-1,-1,-1,793,389,1414,268,3,1024}; +*//*%FSM*/ +class FSM +{ + fsmName = "zombie walking"; + class States + { + /*%FSM*/ + class zombie + { + name = "zombie"; + itemno = ; + init = /*%FSM*/"//Developer code" \n + "//Author: axeman (Andrew Gregory | andrew@andgregor.co.uk)" \n + "//Licence:" \n + "//You may not copy, reproduce, edit, move or transfer in any way without the express permission of the author." \n + "//All files contained in this MPMission folder also fall under the Epoch Mod Creative Commons Licence: https://creativecommons.org/licenses/by-nc-nd/4.0/" \n + "//Any files triggered, called, execVM'ed, execFSM'ed etc, by this file fall under the same agreement." \n + "" \n + "//systemChat ""INIT WALKING"";" \n + "_unit = _this select 0;" \n + "" \n + "_moveTo = [];" \n + "_nextPos = [];" \n + "" \n + "_callDispose = false;" \n + "_doDispose = false;" \n + "_decisionMade = false;" \n + "_t = diag_tickTime;" \n + "_c = diag_tickTime;" \n + "_sFreqCheck = 1.5;" \n + "_lFreqCheck = 12;" \n + "_doneCheck = false;" \n + "" \n + "//Debug" \n + "_showDebug = {" \n + "hint format [""SAPPER\nAnger: %2\nCanSee: %3\nTarget: %4\nHit: %5\nNear: %6FPS:%1"",diag_fps,_sAnger,_canSee,_trgt,_sHit,_sFiredNear];" \n + "};" \n + "" \n + "" \n + "" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class _ + { + itemno = ; + priority = 0.000000; + to="reset___control"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class instinct + { + name = "instinct"; + itemno = ; + init = /*%FSM*/"//systemchat format [""WI:%1"",diag_tickTime];"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class instinct_done + { + itemno = ; + priority = 100.000000; + to="action"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_decisionMade;"/*%FSM*/; + action=/*%FSM*/"_decisionMade = false;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class dispose + { + itemno = ; + priority = 90.000000; + to="instinct"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!alive _unit || _callDispose;"/*%FSM*/; + action=/*%FSM*/"_doDispose = true;" \n + "_decisionMade = true;" \n + "" \n + "" \n + ""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class move + { + itemno = ; + priority = 60.000000; + to="instinct"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!(_moveTo isEqualTo _nextPos)"/*%FSM*/; + action=/*%FSM*/"_doMove = true;" \n + "_decisionMade = true;" \n + "_moveTo = [] + _nextPos;" \n + ""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class action + { + name = "action"; + itemno = ; + init = /*%FSM*/"//systemchat format [""WA:%1"",diag_tickTime];"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class dispose + { + itemno = ; + priority = 120.000000; + to="end"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_doDispose;"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class complete + { + itemno = ; + priority = 100.000000; + to="reset___control"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_actionDone && ((call compile _criteria) || (diag_tickTime > (_t + _sWait)));"/*%FSM*/; + action=/*%FSM*/"" \n + "if(!isNil ""_criteriaMetAction"")then{" \n + "call _criteriaMetAction;" \n + "};" \n + "" \n + "" \n + "" \n + "" \n + "" \n + "" \n + "" \n + "" \n + "" \n + ""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class move + { + itemno = ; + priority = 10.000000; + to="do_move"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_doMove;" \n + ""/*%FSM*/; + action=/*%FSM*/"_doMove = false;" \n + ""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class reset___control + { + name = "reset___control"; + itemno = ; + init = /*%FSM*/"//Brain Vars" \n + "_criteria =""(false)"";" \n + "_criteriaMetAction = nil;" \n + "_actionDone = false;" \n + "_sWait = 0;" \n + "" \n + "_newTrgt = false;" \n + "" \n + "" \n + "" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class _ + { + itemno = ; + priority = 0.000000; + to="instinct"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class end + { + name = "end"; + itemno = ; + init = /*%FSM*/"//systemchat format[""Walk Disposing for %1"",_unit];"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + }; + }; + /*%FSM*/ + /*%FSM*/ + class do_move + { + name = "do_move"; + itemno = ; + init = /*%FSM*/"_unit moveTo _moveTo;" \n + "" \n + "" \n + "_actionDone = true;" \n + "_criteria = ""moveToCompleted _unit || _newTrgt"";" \n + "_sWait = (_unit distance _moveTo) * 2;" \n + "" \n + "if(axeDebug)then{" \n + "[_unit, _moveTo, ""Sign_Arrow_F""] call EPOCH_fnc_debugArrow;" \n + "};" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class _ + { + itemno = ; + priority = 0.000000; + to="action"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + }; + initState="zombie"; + finalStates[] = + { + "end", + }; +}; +/*%FSM*/