/*%FSM*/ /*%FSM*/ /* item0[] = {"mission",0,4346,-292.494934,-346.793884,-202.494995,-296.794006,0.000000,"mission"}; item1[] = {"_",8,218,62.332706,-185.990021,114.284866,-157.584717,0.000000,""}; item2[] = {"instinct",2,250,191.105453,-225.114914,281.105408,-175.114914,0.000000,"instinct"}; item3[] = {"action",2,250,164.446381,121.731827,254.446365,171.731903,0.000000,"action"}; item4[] = {"dispose",4,218,20.438301,-279.382568,110.438431,-229.382599,90.000000,"dispose"}; item5[] = {"_",8,218,184.126175,442.503937,236.078262,470.909149,0.000000,""}; item6[] = {"reset_vars",2,250,-57.248745,-196.860123,32.751255,-146.860138,0.000000,"reset vars"}; item7[] = {"_",8,218,-273.564545,-262.966431,-221.612381,-234.561172,0.000000,""}; item8[] = {"complete",4,218,-56.810909,-93.101501,33.189354,-43.101486,100.000000,"complete"}; item9[] = {"welcome",4,218,73.352470,-323.856232,163.352539,-273.856232,80.000000,"welcome"}; item10[] = {"end",1,250,-370.691071,10.611027,-280.691071,60.611038,0.000000,"end"}; item11[] = {"dispose",4,218,-102.640427,11.797817,-2.640434,61.797813,140.000000,"dispose"}; item12[] = {"mission_event_1",4,218,402.723938,-312.757385,492.723938,-262.757324,60.000000,"mission event 1"}; item13[] = {"no_decision",4,218,330.494629,-141.685272,420.494568,-91.685326,10.000000,"no decision"}; item14[] = {"instinct_done",4,218,164.237518,-54.324181,254.237457,-4.324169,100.000000,"instinct done"}; item15[] = {"completed",4,218,207.167007,-379.790894,297.167053,-329.790894,70.000000,"completed"}; item16[] = {"load_mission",2,250,-292.180725,-196.146988,-202.180710,-146.146988,0.000000,"load mission"}; item17[] = {"_",8,218,-162.998352,-185.990021,-111.046211,-157.584717,0.000000,""}; item18[] = {"welcome",4,218,295.219086,199.253082,385.219025,249.253082,0.000000,"welcome"}; item19[] = {"do_welcome",2,250,437.430695,199.688446,537.430664,249.688416,0.000000,"do welcome"}; item20[] = {"interrupt",4,218,51.666336,-72.125519,141.666382,-22.125553,120.000000,"interrupt"}; item21[] = {"mission_event_2",4,218,399.193695,-257.488159,489.193604,-207.488113,50.000000,"mission event 2"}; item22[] = {"mission_event_3",4,218,399.829254,-201.420883,489.829010,-151.420898,40.000000,"mission event 3"}; item23[] = {"mission_event_1",4,218,14.473431,177.857178,104.473343,227.857162,0.000000,"mission event 1"}; item24[] = {"in_mission_1",2,250,-135.305969,264.247803,-45.305984,314.247803,0.000000,"in mission 1"}; item25[] = {"mission_event_2",4,218,59.082150,218.902466,149.082092,268.902527,0.000000,"mission event 2"}; item26[] = {"mission_event_3",4,218,104.461388,258.831085,194.461349,308.830994,0.000000,"mission event 3"}; item27[] = {"in_mission_1_1",2,250,-134.509277,332.141968,-44.509247,382.141968,0.000000,"in mission 1"}; item28[] = {"in_mission_1_2",2,250,-135.272766,397.347107,-45.272724,447.347107,0.000000,"in mission 1"}; item29[] = {"complete_1",4,218,-11.056295,127.654327,78.943771,177.654495,0.000000,"complete"}; item30[] = {"complete",2,250,-137.496185,183.663330,-47.496330,233.663330,0.000000,"complete"}; item31[] = {"mission_check",4,218,338.559967,54.346359,428.559814,104.346336,110.000000,"mission check"}; item32[] = {"checking_status",2,250,675.000000,-50.000000,775.000000,0.000000,0.000000,"checking status"}; item33[] = {"items_player",4,218,525.000000,-125.000000,625.000000,-75.000000,90.000000,"items player"}; item34[] = {"checked",4,218,625.000000,25.000000,725.000000,75.000000,10.000000,"checked"}; item35[] = {"done",4,218,450.000000,-50.000000,550.000000,0.000000,100.000000,"done"}; item36[] = {"player_status",4,218,600.000000,-175.000000,700.000000,-125.000000,80.000000,"player status"}; item37[] = {"accepted",4,218,136.335068,-357.773987,226.335129,-307.773987,75.000000,"accepted"}; item38[] = {"return",2,250,324.819244,-48.579079,414.819275,1.420918,0.000000,"return"}; item39[] = {"to_action",4,218,241.671967,3.543102,331.671967,53.543098,10.000000,"to action"}; item40[] = {"to_instinct",4,218,251.599976,-118.075302,341.599976,-68.075302,5.000000,"to instinct"}; item41[] = {"accept",4,218,243.062256,251.914124,333.062256,301.914124,0.000000,"accept"}; item42[] = {"accept_mission",2,250,362.788879,361.609375,452.789001,411.609375,0.000000,"accept mission"}; item43[] = {"give_mission",4,218,725.000000,-175.000000,825.000000,-125.000000,70.000000,"give mission"}; item44[] = {"abandoned",4,218,272.889526,-355.696106,362.889526,-305.696106,65.000000,"abandoned"}; item45[] = {"abandoned",4,218,-100.000000,-50.000000,0.000000,0.000000,160.000000,"abandoned"}; item46[] = {"abandoned",2,250,-251.320206,-49.915840,-151.320221,0.084147,0.000000,"abandoned"}; item47[] = {"wait",4,218,-250.899475,-138.286346,-150.899460,-88.286331,5.000000,"wait"}; item48[] = {"call_revenge",2,250,-370.813080,-137.218597,-280.813080,-87.218597,0.000000,"call revenge"}; item49[] = {"continue",4,218,441.737213,121.630814,531.737183,171.630829,10.000000,"continue"}; item50[] = {"clean_up",4,218,800.000000,-150.000000,900.000000,-100.000000,60.000000,"clean up"}; item51[] = {"mission_status",4,218,750.000000,25.000000,850.000000,75.000000,20.000000,"mission status"}; item52[] = {"near_characters",4,218,850.000000,-25.000000,950.000000,25.000000,30.000000,"near characters"}; item53[] = {"mission_vars",4,218,850.000000,-100.000000,950.000000,-50.000000,50.000000,"mission vars"}; item54[] = {"alert",4,218,-50.000000,75.000000,50.000000,125.000000,150.000000,"alert"}; item55[] = {"do_alert",2,250,-147.601227,110.981712,-47.601219,160.981720,0.000000,"do alert"}; item56[] = {"_",8,218,-351.789581,-56.608616,-299.837433,-28.203323,0.000000,""}; item57[] = {"____FAKE____",9,2280,0.000000,0.000000,0.000000,0.000000,0.000000,"____FAKE____"}; link0[] = {0,7}; link1[] = {1,2}; link2[] = {2,4}; link3[] = {2,9}; link4[] = {2,12}; link5[] = {2,13}; link6[] = {2,14}; link7[] = {2,15}; link8[] = {2,21}; link9[] = {2,22}; link10[] = {2,37}; link11[] = {2,44}; link12[] = {3,8}; link13[] = {3,11}; link14[] = {3,18}; link15[] = {3,20}; link16[] = {3,23}; link17[] = {3,25}; link18[] = {3,26}; link19[] = {3,29}; link20[] = {3,31}; link21[] = {3,41}; link22[] = {3,45}; link23[] = {3,54}; link24[] = {4,2}; link25[] = {5,3}; link26[] = {6,1}; link27[] = {7,16}; link28[] = {8,6}; link29[] = {9,2}; link30[] = {11,10}; link31[] = {12,2}; link32[] = {13,32}; link33[] = {14,3}; link34[] = {15,2}; link35[] = {16,17}; link36[] = {17,6}; link37[] = {18,19}; link38[] = {19,49}; link39[] = {20,2}; link40[] = {21,2}; link41[] = {22,2}; link42[] = {23,24}; link43[] = {24,5}; link44[] = {25,27}; link45[] = {26,28}; link46[] = {27,5}; link47[] = {28,5}; link48[] = {29,30}; link49[] = {30,5}; link50[] = {31,32}; link51[] = {32,33}; link52[] = {32,34}; link53[] = {32,35}; link54[] = {32,36}; link55[] = {32,50}; link56[] = {32,51}; link57[] = {32,52}; link58[] = {32,53}; link59[] = {33,32}; link60[] = {34,32}; link61[] = {35,38}; link62[] = {36,32}; link63[] = {37,2}; link64[] = {38,39}; link65[] = {38,40}; link66[] = {39,3}; link67[] = {40,2}; link68[] = {41,42}; link69[] = {42,5}; link70[] = {43,32}; link71[] = {44,2}; link72[] = {45,46}; link73[] = {46,47}; link74[] = {47,48}; link75[] = {48,56}; link76[] = {49,3}; link77[] = {50,32}; link78[] = {51,32}; link79[] = {52,32}; link80[] = {53,32}; link81[] = {54,55}; link82[] = {55,5}; link83[] = {56,10}; link84[] = {57,43}; globals[] = {0.000000,0,0,0,16777215,640,480,1,214,6316128,1,-324.270538,917.894897,460.891968,-494.921631,759,731,1}; window[] = {2,-1,-1,-1,-1,530,100,900,100,3,777}; *//*%FSM*/ class FSM { fsmName = "trader animal control"; class States { /*%FSM*/ class mission { name = "mission"; init = /*%FSM*/"_plyr = _this select 0;" \n "_trader = _this select 1;" \n "_missionName = ""MissionSapper"";" \n "_handle = ""NOT SET"";" \n "_plyrArray = [""Epoch_Male_F"",""Epoch_Female_F""];" \n "_vehArray = [""Car""];" \n "" \n "_t = diag_tickTime;" \n "_u = _t;" \n "_m1 = _t;" \n "_m2 = _m1;" \n "_m3 = _m2;" \n "_dropped = _m3;" \n "" \n "_missionStart = _m3;" \n "_nrPlyrs = [];" \n "_startCopter = objNull;" \n "_nrEnts = [];" \n "_plyrPos = [0,0,0];" \n "_newTrader = objNull;" \n "_rnd = random 100;" \n "" \n "" \n "//Mission Vars" \n "_callWelcome = true;//call mission on startup from menu" \n "_doWelcome = false;" \n "_doDispose = false;" \n "_doComplete = false;" \n "_doMission1 = false;" \n "_doMission2 = false;" \n "_doMission3 = false;" \n "_doAccepted = false;" \n "_doAbandon = false;" \n "_nrEnts = [];" \n "_wDiag = """";" \n "_rndWChoice = 0;" \n "_welcomeDone = false;" \n "_packageFound = false;" \n "" \n "_checkEntry = """";" \n "_doDispose = false;" \n "_callComplete = false;" \n "_callAbandoned = false;" \n "_callDispose = false;" \n "" \n "_doAccept = false;" \n "_acceptDone = false;" \n "_missionItem = """";" \n "_inMission = false;" \n "" \n "_startHolder = objNull;" \n "_cargo = objNull;" \n "_cargoCheck = [];" \n "" \n "_doAlert = false;" \n "_alertMessage = [""""];" \n "_alert = _m3 - 60;" \n "_dropped = _alert - 60;" \n "_lostCount = 0;" \n "" \n "_sapper = objNull;" \n "" \n "" \n "//Testing - Bounty System" \n "_seenPlayers = _trader getVariable [""seenPlayers"",[]];" \n "_seenPlayers pushBack name _plyr;" \n "_trader setVariable [""seenPlayers"",_seenPlayers];" \n "" \n "//DEBUG" \n "_doDebug = false;" \n "_debugDo = format[""INIT | %1"", _plyr];" \n "" \n "" \n "" \n "" \n "" \n "" \n "" \n "" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class _ { priority = 0.000000; to="load_mission"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/""/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class instinct { name = "instinct"; init = /*%FSM*/"_t = diag_tickTime;" \n "" \n "if (_doDebug) then {" \n "systemChat format [""I:%1"",diag_tickTime];" \n "};" \n "" \n "" \n "" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class instinct_done { priority = 100.000000; to="action"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_decisionMade;"/*%FSM*/; action=/*%FSM*/"_u = _t;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class dispose { priority = 90.000000; to="instinct"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!(alive _plyr) || _doDispose || _callDispose;"/*%FSM*/; action=/*%FSM*/"_doDispose = true;" \n "_decisionMade = true;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class welcome { priority = 80.000000; to="instinct"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_callWelcome && !_welcomeDone;"/*%FSM*/; action=/*%FSM*/"_doWelcome = true;" \n "_decisionMade = true;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class accepted { priority = 75.000000; to="instinct"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(_inMission || _skipWelcomeCheck) && !_acceptDone;"/*%FSM*/; action=/*%FSM*/"_skipWelcomeCheck = false;" \n "_doAccept = true;" \n "_decisionMade = true;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class completed { priority = 70.000000; to="instinct"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_callComplete && _inMission;"/*%FSM*/; action=/*%FSM*/"_doComplete = true;" \n "_decisionMade = true;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class abandoned { priority = 65.000000; to="instinct"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_callAbandoned && _inMission;" \n ""/*%FSM*/; action=/*%FSM*/"_callAbandoned = false;" \n "_doAbandon = true;" \n "_decisionMade = true;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class mission_event_1 { priority = 60.000000; to="instinct"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(call compile _imCondition1) && diag_tickTime - _m1 > _freq1 && _inMission;"/*%FSM*/; action=/*%FSM*/"if (_freq1 < 1) then {" \n "_freq1 = getNumber ( configFile >> ""TraderMissions"" >> _missionName >> ""inmission1"" >> ""frequency"");" \n "};" \n "_doMission1 = true;" \n "_decisionMade = true;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class mission_event_2 { priority = 50.000000; to="instinct"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(call compile _imCondition2) && diag_tickTime -_m2 > _freq2 && _inMission;"/*%FSM*/; action=/*%FSM*/"if (_freq2 < 1) then {" \n "_freq2 = getNumber ( configFile >> ""TraderMissions"" >> _missionName >> ""inmission2"" >> ""frequency"");" \n "};" \n "_doMission2 = true;" \n "_decisionMade = true;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class mission_event_3 { priority = 40.000000; to="instinct"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(call compile _imCondition3) && diag_tickTime - _m3 > _freq3 && _inMission;"/*%FSM*/; action=/*%FSM*/"if (_freq3 < 1) then {" \n "_freq3 = getNumber ( configFile >> ""TraderMissions"" >> _missionName >> ""inmission3"" >> ""frequency"");" \n "};" \n "_doMission3 = true;" \n "_decisionMade = true;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class no_decision { priority = 10.000000; to="checking_status"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_decisionMade && diag_tickTime - _t > 3;"/*%FSM*/; action=/*%FSM*/"_checkEntry = ""instinct"";" \n "_sanityCheck = 100;"/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class action { name = "action"; init = /*%FSM*/"" \n "" \n "if (_doDebug) then {" \n "systemChat format [""A:%1"",diag_tickTime];" \n "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class abandoned { priority = 160.000000; to="abandoned"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_doAbandon;"/*%FSM*/; action=/*%FSM*/"" \n "_wInDiag = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""missioncheck"" >> ""abandoned"" >> ""dialogue"");" \n "_wInDiag2 = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""missioncheck"" >> ""abandoned"" >> ""dialogue2"");" \n "_rndWChoice = floor (random (count _wInDiag));" \n "" \n " _wDiag = _wInDiag select _rndWChoice;" \n " _wDiag2 = _wInDiag2 select _rndWChoice;" \n "" \n "_act = getText ( configFile >> ""TraderMissions"" >> _missionName >> ""missioncheck"" >> ""abandoned"" >> ""action"");" \n "_aWait = getNumber ( configFile >> ""TraderMissions"" >> _missionName >> ""missioncheck"" >> ""abandoned"" >> ""delay"");" \n "_doAbandon = false;" \n "_t = diag_tickTime;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class alert { priority = 150.000000; to="do_alert"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_doAlert && diag_tickTime - _alert > 30;"/*%FSM*/; action=/*%FSM*/"_doAlert = false"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class dispose { priority = 140.000000; to="end"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_doDispose && diag_tickTime - _t > 60 ;"/*%FSM*/; action=/*%FSM*/"_plyr setVariable [""inMission"",[""end"",_missionName],false];"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class interrupt { priority = 120.000000; to="instinct"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_allowInterrupt && (call compile _interruptReason);"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class mission_check { priority = 110.000000; to="checking_status"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_actionDone && diag_tickTime > _u + 4;"/*%FSM*/; action=/*%FSM*/"_checkEntry = ""action"";" \n "_sanityCheck = 100;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class complete { priority = 100.000000; to="reset_vars"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_actionDone && ((call compile _criteria) || (diag_tickTime > (_t + _sWait)));"/*%FSM*/; action=/*%FSM*/"if (!isNil ""_criteriaMetAction"") then {" \n "call compile _criteriaMetAction;" \n "};"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class complete_1 { priority = 0.000000; to="complete"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_doComplete;"/*%FSM*/; action=/*%FSM*/"_doComplete = false;" \n "" \n "_wInDiag = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""completed"" >> ""dialogue"");" \n "_wInDiag2 = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""completed"" >> ""dialogue2"");" \n "_wInCrypto = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""completed"" >> ""crypto"");" \n "_wInWeap = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""completed"" >> ""weapon"");" \n "_wInAmmo = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""completed"" >> ""magazine"");" \n "_act = getText ( configFile >> ""TraderMissions"" >> _missionName >> ""completed"" >> ""action"");" \n "" \n "_rndWChoice = floor (random (count _wInDiag));" \n " _wDiag = _wInDiag select _rndWChoice;" \n " _wDiag2 = _wInDiag select _rndWChoice;" \n " _wCrypto = _wInCrypto select _rndWChoice;" \n " _wWeapon = _wInWeap select _rndWChoice;" \n " _wAmmo = _wInAmmo select _rndWChoice;" \n " _wItem = _wInItem select _rndWChoice;" \n "" \n ""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class mission_event_1 { priority = 0.000000; to="in_mission_1"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_doMission1;"/*%FSM*/; action=/*%FSM*/"" \n "_wInDiag = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""inmission1"" >> ""dialogue"");" \n "_rndWChoice = floor (random (count _wInDiag));" \n "" \n " _wDiag = _wInDiag select _rndWChoice;" \n "_act = getText ( configFile >> ""TraderMissions"" >> _missionName >> ""inmission1"" >> ""action"");" \n "_doMission1 = false;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class accept { priority = 0.000000; to="accept_mission"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_doAccept;"/*%FSM*/; action=/*%FSM*/"" \n "" \n "_wInDiag = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""accept"" >> ""dialogue"");" \n "_wInDiag2 = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""accept"" >> ""dialogue2"");" \n "_wInCrypto = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""accept"" >> ""crypto"");" \n "_wInWeap = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""accept"" >> ""weapon"");" \n "_wInAmmo = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""accept"" >> ""magazine"");" \n "_wInItem = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""accept"" >> ""item"");" \n "_act = getText ( configFile >> ""TraderMissions"" >> _missionName >> ""accept"" >> ""action"");" \n "" \n "//_rndWChoice = floor (random (count _wInDiag));" \n "" \n " _wDiag = _wInDiag select _rndWChoice;" \n " _wDiag2 = _wInDiag2 select _rndWChoice;" \n " _wCrypto = _wInCrypto select _rndWChoice;" \n "" \n " _wWeapon = _wInWeap select _rndWChoice;" \n " _wAmmo = _wInAmmo select _rndWChoice;" \n " _wItem = _wInItem select _rndWChoice;" \n "" \n "" \n "_doAccept = false;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class welcome { priority = 0.000000; to="do_welcome"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_doWelcome;"/*%FSM*/; action=/*%FSM*/"" \n "_wInDiag = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""welcome"" >> ""dialogue"");" \n "_wInDiag2 = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""welcome"" >> ""dialogue2"");" \n "_wInItem = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""welcome"" >> ""item"");" \n "_act = getText ( configFile >> ""TraderMissions"" >> _missionName >> ""welcome"" >> ""action"");" \n "" \n "_rndWChoice = floor (random (count _wInDiag));" \n "" \n " _wDiag = _wInDiag select _rndWChoice;" \n " _wDiag2 = _wInDiag2 select _rndWChoice;" \n "if (count _wInItem > 1) then {" \n " _wItem = _wInItem select _rndWChoice;" \n "}else{" \n " _wItem = _wInItem select 0;" \n "};" \n "" \n "_doWelcome = false;" \n "_packageFound = false;" \n "_t = diag_tickTime;" \n ""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class mission_event_2 { priority = 0.000000; to="in_mission_1_1"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_doMission2;"/*%FSM*/; action=/*%FSM*/"_wInDiag = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""inmission2"" >> ""dialogue"");" \n "_rndWChoice = floor (random (count _wInDiag));" \n " _wDiag = _wInDiag select _rndWChoice;" \n "_act = getText ( configFile >> ""TraderMissions"" >> _missionName >> ""inmission2"" >> ""action"");" \n "" \n "_doMission2 = false;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class mission_event_3 { priority = 0.000000; to="in_mission_1_2"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_doMission3;"/*%FSM*/; action=/*%FSM*/"_wInDiag = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""inmission3"" >> ""dialogue"");" \n "_rndWChoice = floor (random (count _wInDiag));" \n " _wDiag = _wInDiag select _rndWChoice;" \n "_act = getText ( configFile >> ""TraderMissions"" >> _missionName >> ""inmission3"" >> ""action"");" \n "_doMission3 = false;"/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class reset_vars { name = "reset_vars"; init = /*%FSM*/"//Default Vars" \n "_rnd = 0;" \n "_actionDone = false;" \n "_decisionMade = false;" \n "_sWait = 0;" \n "_doDispose = false;" \n "_chooseTarget = false;" \n "_criteria = Nil;" \n "_criteriaMet = false;" \n "_allowInterrupt = false;" \n "_interruptReason = ""(false)"";" \n "" \n "" \n "_moveTo = [0,0,0];" \n "" \n "//Brain Vars" \n "_override = false;" \n "_criteria =""(false)"";" \n "_criteriaMetAction = nil;" \n "" \n "" \n "//Mission Vars" \n "_wDiag = """";" \n "_wDiag2 = """";" \n "_wAction = """";" \n "_wCrypto = 0;" \n "_wWeapon = """";" \n "_wAmmo = """";" \n "_wItem = """";" \n "_act = """";" \n "" \n "" \n "" \n "" \n "" \n "" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class _ { priority = 0.000000; to="instinct"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/""/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class end { name = "end"; init = /*%FSM*/""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { }; }; /*%FSM*/ /*%FSM*/ class load_mission { name = "load_mission"; init = /*%FSM*/"//Welcome" \n "" \n "_wCondition = getText ( configFile >> ""traderMissions"" >> _missionName >> ""welcome"" >> ""condition"");" \n "" \n "_imCondition1 = getText ( configFile >> ""TraderMissions"" >> _missionName >> ""inmission1"" >> ""condition"");" \n "_imCondition2 = getText ( configFile >> ""TraderMissions"" >> _missionName >> ""inmission2"" >> ""condition"");" \n "_imCondition3 = getText ( configFile >> ""TraderMissions"" >> _missionName >> ""inmission3"" >> ""condition"");" \n "" \n "_mAccepted = getText ( configFile >> ""TraderMissions"" >> _missionName >> ""accept"" >> ""condition"");" \n "_skipWelcomeCheck = call compile _mAccepted;" \n "" \n "_freq1 = 0;" \n "_freq2 = 0;" \n "_freq3 = 0;" \n "" \n "_wAbandon = getText ( configFile >> ""TraderMissions"" >> _missionName >> ""missioncheck"" >> ""abandoned"" >> ""condition"");" \n "" \n "_wComplete = getText ( configFile >> ""TraderMissions"" >> _missionName >> ""completed"" >> ""condition"");" \n "" \n "" \n "_dialogueCount = 0;" \n "" \n "" \n "//Information" \n "" \n "if (floor (random 100) < 25) then {" \n "" \n "if (count _seenPlayers > 1) then {" \n "" \n "" \n "titleText [format[""Hey %1, we've seen %2 round these parts, in case you were interested."",name player,_seenPlayers select (floor random (count _seenPlayers))],""PLAIN""];" \n "};" \n "};" \n "" \n "_callWelcome = true;" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class _ { priority = 0.000000; to="reset_vars"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/""/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class do_welcome { name = "do_welcome"; init = /*%FSM*/"if (_plyr getVariable[""inMission"",["""",""""]] select 0 == ""true"") then {" \n "titleText [""You must finish the mission you are on first."",""PLAIN"",6];" \n "_callDispose = true;" \n "};" \n "" \n "" \n "if (!_callDispose) then {" \n "" \n "titleText [_wDiag,""PLAIN"",6];" \n "" \n " if (_wDiag2 != """") then {" \n "" \n " _wDiag2 spawn {" \n " uiSleep 6;" \n " titleText [_this,""PLAIN"",6];" \n " };" \n " " \n " };" \n "" \n "" \n " if (_act != """") then {" \n " call compile _act;" \n " };" \n "" \n " _inMission = true;" \n "" \n "" \n "" \n "};" \n "" \n "_callWelcome = false;" \n "" \n "" \n "" \n "" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class continue { priority = 10.000000; to="action"; precondition = /*%FSM*/"_packageFound = false;" \n "" \n "{" \n "if (_x == _missionItem) then {" \n "_packageFound = true;" \n "};" \n "" \n "}forEach items player;" \n "" \n "{" \n "if (_x == _missionItem) then {" \n "_packageFound = true;" \n "};" \n "}forEach magazines player;"/*%FSM*/; condition=/*%FSM*/"_callDispose || diag_tickTime - _t > 16;"/*%FSM*/; action=/*%FSM*/"_welcomeDone = true;" \n "_sWait = 6;" \n "_actionDone = true;" \n "_criteria = ""(false)"";" \n ""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class in_mission_1 { name = "in_mission_1"; init = /*%FSM*/"if (_wDiag != """") then {" \n "titleText [_wDiag,""PLAIN""];" \n "};" \n "" \n "if (_act != """") then {" \n "call compile _act;" \n "};" \n "" \n "_sWait = 6;" \n "_actionDone = true;" \n "_t = diag_tickTime;" \n "_m1 = _t;" \n "_criteria = ""(false)"";" \n "" \n "if (_doDebug) then {" \n "_debugDo = ""In MIssion 1"";" \n "};" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class _ { priority = 0.000000; to="action"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/""/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class in_mission_1_1 { name = "in_mission_1_1"; init = /*%FSM*/"if (_wDiag != """") then {" \n "titleText [_wDiag,""PLAIN""];" \n "};" \n "" \n "if (_act != """") then {" \n "call compile _act;" \n "};" \n "" \n "" \n "_sWait = 6;" \n "_actionDone = true;" \n "_t = diag_tickTime;" \n "_m2 = _t;" \n "_criteria = ""(false)"";" \n "" \n "" \n "if (_doDebug) then {" \n "_debugDo = ""In MIssion 2"";" \n "};" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class _ { priority = 0.000000; to="action"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/""/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class in_mission_1_2 { name = "in_mission_1_2"; init = /*%FSM*/"if (_wDiag != """") then {" \n "titleText [_wDiag,""PLAIN""];" \n "};" \n "" \n "if (_act != """") then {" \n "call compile _act;" \n "};" \n "" \n "" \n "_sWait = 6;" \n "_actionDone = true;" \n "_t = diag_tickTime;" \n "_criteria = ""(false)"";" \n "_m3 = _t;" \n "" \n "" \n "if (_doDebug) then {" \n "_debugDo = ""In Mission 3"";" \n "};" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class _ { priority = 0.000000; to="action"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/""/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class complete { name = "complete"; init = /*%FSM*/"titleText [_wDiag,""PLAIN"", 6];" \n "" \n "" \n "if (_act != """") then {" \n "call compile _act;" \n "};" \n "" \n "if (_wDiag2 != """") then {" \n "" \n "_wDiag2 spawn {" \n " uiSleep 6;" \n " titleText [_this,""PLAIN"",6];" \n "};" \n "" \n "};" \n "" \n "_wDiag = """";" \n "_wDiag2 = """";" \n "" \n "[_sapper, _trader] spawn EPOCH_mission_cage_sapper;" \n "" \n "_plyr setVariable[""inMission"",["""",""""]];" \n "_inMission = false;" \n "_callDispose = true;" \n "_sWait = 6;" \n "_actionDone = true;" \n "_t = diag_tickTime;" \n "_criteria = ""(false)"";" \n "" \n "if (_doDebug) then {" \n "_debugDo = ""Complete"";" \n "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class _ { priority = 0.000000; to="action"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/""/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class checking_status { name = "checking_status"; init = /*%FSM*/"if (_doDebug) then {" \n "systemChat format [""S:%1"",diag_tickTime];" \n "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class done { priority = 100.000000; to="return"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_sanityCheck < 1;"/*%FSM*/; action=/*%FSM*/"_u = diag_tickTime;" \n "" \n ""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class items_player { priority = 90.000000; to="checking_status"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_sanityCheck > 90;"/*%FSM*/; action=/*%FSM*/"" \n "" \n "" \n "_sanityCheck = 90;" \n ""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class player_status { priority = 80.000000; to="checking_status"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_sanityCheck > 80;"/*%FSM*/; action=/*%FSM*/"" \n "" \n "" \n "_plyrPos = getPosATL _plyr;" \n "" \n "_damageHelp = false;" \n "" \n "if (damage player > 0.3) then {" \n "_damageHelp = true;" \n "};" \n "" \n "_sanityCheck = 80;" \n ""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class clean_up { priority = 60.000000; to="checking_status"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_sanityCheck > 60;"/*%FSM*/; action=/*%FSM*/"" \n "" \n "_sanityCheck = 60;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class mission_vars { priority = 50.000000; to="checking_status"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_sanityCheck > 50;"/*%FSM*/; action=/*%FSM*/"_rnd = random 100;" \n "" \n "_sanityCheck = 50;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class near_characters { priority = 30.000000; to="checking_status"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_sanityCheck > 30;"/*%FSM*/; action=/*%FSM*/"_nrEnts = nearestObjects [_plyr, [""Man"",""Epoch_Sapper_F""], 200];" \n "" \n "{" \n " if ((_x getVariable [""AI_SLOT"", -1 ] > -1) && _x != _trader) then {" \n " _newTrader = _x;" \n " };" \n "" \n " if (!(alive _x) && !(typeof _x == ""Epoch_Sapper_F"")) then {" \n " _doAlert = true;" \n " _alertMessage = getArray ( configFile >> ""TraderMissions"" >> _missionName >> ""missioncheck"" >> ""characters"" >> ""dialogue"");" \n " };" \n "" \n " if (typeof _x == ""Epoch_Sapper_F"" && alive _x) then {" \n " _sapper = _x;" \n " };" \n "" \n "}forEach _nrEnts;" \n "" \n "_sanityCheck = 30;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class mission_status { priority = 20.000000; to="checking_status"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_sanityCheck > 20;"/*%FSM*/; action=/*%FSM*/"if (_inMission) then {" \n "" \n "" \n "};" \n "" \n "" \n "if!(isNull _newTrader) then {" \n "" \n " if (_newTrader distance _plyr < 6) then {" \n " _callComplete = true;" \n " };" \n "" \n "};" \n "" \n "" \n "" \n "_sanityCheck = 20;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class checked { priority = 10.000000; to="checking_status"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_sanityCheck > 10;"/*%FSM*/; action=/*%FSM*/"" \n "" \n "if (!(isNull _sapper) &&(_sapper distance _trader < 26)) then {" \n "_sapperFoundMessages = [""Ok, I see him. You need to get right back.\nGet out of sight so I can guide him in."",""Get yourself out of sight, I have control of him...just.\nThe people who made this guy left a chip in his head."",""Find a spot out of his sight.\nI don't need him wound up when caging him.""];" \n "titleText [_sapperFoundMessages select floor(random count _sapperFoundMessages),""PLAIN""];" \n "_callComplete = true;" \n "sapperHndl setFSMVariable [""_traderDispose"",true];" \n "};" \n "" \n "_sanityCheck = 0 ;" \n "" \n "" \n "" \n ""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class return { name = "return"; init = /*%FSM*/""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class to_action { priority = 10.000000; to="action"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_checkEntry == ""action"";"/*%FSM*/; action=/*%FSM*/"_checkEntry = """";" \n ""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class to_instinct { priority = 5.000000; to="instinct"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_checkEntry == ""instinct"";"/*%FSM*/; action=/*%FSM*/"_checkEntry = """";" \n ""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class accept_mission { name = "accept_mission"; init = /*%FSM*/"" \n "titleText [_wDiag,""PLAIN"",6];" \n "" \n "" \n "if (_act != """") then {" \n "call compile _act;" \n "};" \n "" \n "if (_wDiag2 != """") then {" \n "" \n "_wDiag2 spawn {" \n " uiSleep 6;" \n " titleText [_this,""PLAIN"",6];" \n "};" \n "};" \n "" \n "_inMission = true;" \n "_plyr setVariable [""inMission"",[""true"",_missionName],false];" \n "_acceptDone = true;" \n "_sWait = 60;" \n "_actionDone = true;" \n "_t = diag_tickTime;" \n "_criteria = ""(_plyr distance _trader > 12)"";" \n "" \n "" \n "if (_doDebug) then {" \n "_debugDo = ""Accept"";" \n "};" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class _ { priority = 0.000000; to="action"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/""/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class abandoned { name = "abandoned"; init = /*%FSM*/"" \n "titleText [_wDiag,""PLAIN""];" \n "" \n "if (_wDiag2 != """") then {" \n "" \n "_wDiag2 spawn {" \n " uiSleep 6;" \n " titleText [_this,""PLAIN""];" \n "};" \n "" \n "};" \n "" \n "" \n "if (_doDebug) then {" \n "_debugDo = ""Abandoned"";" \n "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class wait { priority = 5.000000; to="call_revenge"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(diag_tickTime - _t > _aWait);"/*%FSM*/; action=/*%FSM*/"call compile _act;" \n "_punished = true;" \n "_doDispose = true;" \n "" \n "" \n "" \n ""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class call_revenge { name = "call_revenge"; init = /*%FSM*/"""I_UAV_01_F"" call EPOCH_unitSpawn;" \n "_plyr setVariable [""inMission"",[""abandon"",_missionName],false];"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class _ { priority = 0.000000; to="end"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/""/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class do_alert { name = "do_alert"; init = /*%FSM*/"_message = _alertMessage select floor (random (count _alertMessage));" \n "titletext [_message,""PLAIN"",6];" \n "_message = """";" \n "_alertMessage = [""""];" \n "_alert = diag_tickTime;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class _ { priority = 0.000000; to="action"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/""/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class ____FAKE____ { name = "____FAKE____"; init = /*%FSM*/""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class give_mission { priority = 70.000000; to="checking_status"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_sanityCheck > 70;"/*%FSM*/; action=/*%FSM*/"//Test for future passing of mission to other players" \n "" \n "_passMission = false;" \n "_missionPassed = false;" \n "_nrPlyrs = _plyr nearEntities [_plyrArray, 10];" \n "" \n "{" \n "" \n "{" \n "if (_x == _missionItem) then {" \n "_passMission = true;" \n "};" \n "}forEach items _x;" \n "" \n "{" \n "if (_x == _missionItem) then {" \n "_passMission = true;" \n "};" \n "}forEach magazines _x;" \n "" \n "if (_passMission) then {" \n "_plyr = _x;" \n "_passMission = false;" \n "_missionPassed = true;" \n "};" \n "" \n "}forEach _nrPlyrs;" \n "" \n "_sanityCheck = 70;"/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ }; initState="mission"; finalStates[] = { "end" }; }; /*%FSM*/