/*%FSM*/ /*%FSM*/ /* item0[] = {"Init",0,250,-81.542984,-257.577942,8.457038,-207.578140,0.000000,"Init"}; item1[] = {"End",1,250,-216.387955,-52.508366,-126.387947,-2.508394,0.000000,"End"}; item2[] = {"Update_Areas",2,4346,-82.090652,-139.314026,7.909359,-89.314034,0.000000,"Update Areas"}; item3[] = {"Loop",4,218,53.846153,-139.681244,143.846161,-89.681236,0.000000,"Loop"}; item4[] = {"Gameover",4,218,-216.387955,-139.464890,-126.387947,-89.464890,0.000000,"Gameover"}; item5[] = {"_",8,218,-51.736092,-184.192123,-21.083296,-163.272247,0.000000,""}; link0[] = {0,5}; link1[] = {2,3}; link2[] = {2,4}; link3[] = {3,2}; link4[] = {4,1}; link5[] = {5,2}; globals[] = {0.000000,0,0,0,0,640,480,1,8,6316128,1,-450.330200,450.329834,163.072220,-391.043060,721,617,1}; window[] = {0,-1,-1,-1,-1,792,265,1678,55,1,739}; *//*%FSM*/ class FSM { fsmName = "basearea"; class States { /*%FSM*/ class Init { name = "Init"; init = /*%FSM*/"_brr = 'WFBE_BASEAREARANGE' Call GetNamespace;" \n "_mbr = 'WFBE_MHQBUILDINGRANGE' Call GetNamespace;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class _ { priority = 0.000000; to="Update_Areas"; 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 Update_Areas { name = "Update_Areas"; init = /*%FSM*/"_lastUpdate = time;" \n "_areaWest = WF_Logic getVariable 'WestArea';" \n "_areaEast = WF_Logic getVariable 'EastArea';" \n "" \n "_buildingsWest = WestBaseStructures + [WestMHQ];" \n "_buildingsEast = EastBaseStructures + [EastMHQ];" \n "" \n "_newWest = _areaWest;" \n "_newEast = _areaEast;" \n "" \n "{" \n " _logic = _x;" \n " _structures = [_logic,_buildingsWest] Call SortByDistance;" \n " _update = false;" \n " if (count _structures > 0) then {" \n " if ((_structures select 0) distance _logic > (_brr + _mbr)) then {_update = true};" \n " if (_update) then {" \n " _newWest = _newWest - [_logic] - [objNull];" \n " _grp = group _logic;" \n " deleteVehicle _logic;" \n " deleteGroup _grp;" \n " };" \n " };" \n "} forEach _areaWest;" \n "" \n "if (count _newWest != count _areaWest) then {" \n " WF_Logic setVariable ['WestArea',_newWest,true];" \n "};" \n "" \n "{" \n " _logic = _x;" \n " _structures = [_logic,_buildingsEast] Call SortByDistance;" \n " _update = false;" \n " if (count _structures > 0) then {" \n " if ((_structures select 0) distance _logic > (_brr + _mbr)) then {_update = true};" \n " if (_update) then {" \n " _newEast = _newEast - [_logic] - [objNull];" \n " _grp = group _logic;" \n " deleteVehicle _logic;" \n " deleteGroup _grp;" \n " };" \n " };" \n "} forEach _areaEast;" \n "" \n "if (count _newEast != count _areaEast) then {" \n " WF_Logic setVariable ['EastArea',_newEast,true];" \n "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Gameover { priority = 0.000000; to="End"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"gameOver"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Loop { priority = 0.000000; to="Update_Areas"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!gameOver && time - _lastUpdate > 30"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ }; initState="Init"; finalStates[] = { "End" }; }; /*%FSM*/