/*%FSM*/ /*%FSM*/ /* item0[] = {"init",0,250,373.797485,-215.710526,463.797485,-165.710526,0.000000,"init"}; item1[] = {"true",8,218,373.218811,-125.753807,463.218842,-75.753784,0.000000,"true"}; item2[] = {"Wait_Loop",2,250,373.733643,-26.156036,463.733490,23.843948,0.000000,"Wait Loop"}; item3[] = {"No_Target",4,218,179.569595,272.342590,269.569641,322.342621,0.000000,"No Target"}; item4[] = {"Targets__Found",4,218,520.058899,184.889679,610.058899,234.889709,0.000000,"Targets " \n "Found"}; item5[] = {"Explore",2,250,237.354767,519.685730,327.354767,569.685547,0.000000,"Explore"}; item6[] = {"Loot_for_Player",2,250,520.379883,269.237518,610.380066,319.237305,0.000000,"Loot for Player"}; item7[] = {"__0s_Loop",4,218,373.372223,49.848572,463.372223,99.848618,0.000000,"60s Loop"}; item8[] = {"",7,210,171.356689,647.892578,179.356689,655.892578,0.000000,""}; item9[] = {"",7,210,171.356689,151.351974,179.356689,159.351974,0.000000,""}; item10[] = {"",7,210,690.467346,151.351944,698.467346,159.351944,0.000000,""}; item11[] = {"Look_for_Targets",2,250,373.243042,272.915710,463.242828,322.915741,0.000000,"Look for Targets"}; item12[] = {"true",8,218,374.626923,627.539429,464.626923,677.539429,0.000000,"true"}; item13[] = {"",7,210,691.777954,649.203125,699.777954,657.203125,0.000000,""}; item14[] = {"Dead",4,218,373.941559,374.013275,463.942017,424.013550,0.000000,"Dead"}; item15[] = {"Dead",1,4346,373.941711,523.814087,463.942291,573.814270,0.000000,"Dead"}; item16[] = {"FIRE",2,250,581.023865,513.330078,671.023865,563.330078,0.000000,"FIRE"}; item17[] = {"Spotted",4,218,580.989563,390.849304,670.989563,440.849030,0.000000,"Spotted"}; item18[] = {"Cannot_See",4,218,482.113403,394.224609,572.113464,444.224609,0.000000,"Cannot See"}; item19[] = {"SEARCH",2,250,480.993195,513.825806,570.993225,563.825806,0.000000,"SEARCH"}; link0[] = {0,1}; link1[] = {1,2}; link2[] = {2,7}; link3[] = {2,10}; link4[] = {3,5}; link5[] = {4,6}; link6[] = {5,12}; link7[] = {6,17}; link8[] = {6,18}; link9[] = {7,11}; link10[] = {8,9}; link11[] = {9,2}; link12[] = {10,13}; link13[] = {11,3}; link14[] = {11,4}; link15[] = {11,14}; link16[] = {12,8}; link17[] = {13,12}; link18[] = {14,15}; link19[] = {16,12}; link20[] = {17,16}; link21[] = {18,19}; link22[] = {19,12}; globals[] = {0.000000,0,0,0,0,640,480,1,45,6316128,1,-87.887314,875.501831,881.613037,-104.180443,860,880,1}; window[] = {2,-1,-1,-1,-1,754,1706,2744,26,3,878}; *//*%FSM*/ class FSM { fsmName = "soldiers"; class States { /*%FSM*/ class init { name = "init"; init = /*%FSM*/"_soldierSmith = _this select 0;" \n "" \n "_soldierSmith disableAI ""FSM"";" \n "_soldierSmith setBehaviour ""CARELESS"";" \n "_soldierSmith setCombatMode ""RED"";" \n "_soldierSmith setSkill 0;" \n "" \n "_lastRun = diag_tickTime;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class true { priority = 0.000000; to="Wait_Loop"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!(isNull _soldierSmith)"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Wait_Loop { name = "Wait_Loop"; init = /*%FSM*/"// check loop" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class true { priority = 0.000000; to="Wait_Loop"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"true"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class __0s_Loop { priority = 0.000000; to="Look_for_Targets"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"((diag_tickTime - _lastRun) > 10)"/*%FSM*/; action=/*%FSM*/"_lastRun = diag_tickTime;"/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Explore { name = "Explore"; init = /*%FSM*/"_currentPos = getPosATL _soldierSmith;" \n "_newPos = [(_currentPos select 0)+((random 100)-50),(_currentPos select 1)+((random 100)-50),0];" \n "_soldierSmith moveTo _currentPos;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class true { priority = 0.000000; to="Wait_Loop"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"true"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Loot_for_Player { name = "Loot_for_Player"; init = /*%FSM*/"_attackIndex = floor(random(_nearPlayersCount));" \n "" \n "_target = _nearPlayers select _attackIndex;" \n "" \n "_canSee = lineIntersects [eyePos _target, aimPos _soldierSmith, _target, _soldierSmith];"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Cannot_See { priority = 0.000000; to="SEARCH"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_canSee"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Spotted { priority = 0.000000; to="FIRE"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_canSee"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Look_for_Targets { name = "Look_for_Targets"; init = /*%FSM*/"// check schedule" \n "_nearPlayers = _soldierSmith nearEntities [[""Epoch_Male_F"",""Epoch_Female_F""], 250];" \n "_nearPlayersCount = count _nearPlayers;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Targets__Found { priority = 0.000000; to="Loot_for_Player"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_nearPlayersCount > 0"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Dead { priority = 0.000000; to="Dead"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!(alive _soldierSmith)"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class No_Target { priority = 0.000000; to="Explore"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_nearPlayersCount == 0"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Dead { name = "Dead"; init = /*%FSM*/"diag_log format[""KILLED SOLDIER: %1"", _soldierSmith];" \n "_soldierSmith spawn {" \n " uiSleep 60;" \n " deleteVehicle _this;" \n "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { }; }; /*%FSM*/ /*%FSM*/ class FIRE { name = "FIRE"; init = /*%FSM*/"" \n "_soldierSmith fire (currentweapon _soldierSmith);" \n "" \n "_soldierSmith forceWeaponFire [(currentWeapon _soldierSmith), ""Single""];"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class true { priority = 0.000000; to="Wait_Loop"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"true"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class SEARCH { name = "SEARCH"; init = /*%FSM*/"_currentTargetPos = getPosATL _target;" \n "_newTargetPos = [(_currentTargetPos select 0)+((random 10)-5),(_currentTargetPos select 1)+((random 10)-5),0];" \n "_soldierSmith moveTo _newTargetPos;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class true { priority = 0.000000; to="Wait_Loop"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"true"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ }; initState="init"; finalStates[] = { "Dead" }; }; /*%FSM*/