/*%FSM*/ /*%FSM*/ /* item0[] = {"Init",0,4346,64.981941,-136.945908,154.981949,-86.946060,0.000000,"Init"}; item1[] = {"Check_Towns",2,250,-66.836029,-56.267544,23.163887,-6.267582,0.000000,"Check Towns"}; item2[] = {"End",1,250,-218.006683,15.304325,-128.006653,65.304314,0.000000,"End"}; item3[] = {"Loop",4,218,65.605347,-56.267605,155.605377,-6.267574,0.000000,"Loop"}; item4[] = {"Gameover",4,218,-216.668854,-56.267559,-126.668869,-6.267574,0.000000,"Gameover"}; item5[] = {"Update_Capture",2,250,66.545486,22.916348,156.545471,72.916397,0.000000,"Update Capture"}; item6[] = {"In_Range",4,218,-66.545563,22.916351,23.454376,72.916374,0.000000,"In Range"}; item7[] = {"Not_in_Range",4,218,-167.954971,85.174767,-77.955025,135.174774,0.000000,"Not in Range"}; item8[] = {"Hide",2,250,215.453018,86.056137,305.453064,136.056137,0.000000,"Hide"}; link0[] = {0,3}; link1[] = {1,3}; link2[] = {1,4}; link3[] = {1,6}; link4[] = {1,7}; link5[] = {3,1}; link6[] = {4,2}; link7[] = {5,3}; link8[] = {6,5}; link9[] = {7,8}; link10[] = {8,3}; globals[] = {0.000000,0,0,0,0,640,480,1,25,6316128,1,-526.153625,526.153442,261.834167,-341.160065,1024,906,1}; window[] = {2,-1,-1,-1,-1,834,200,1460,200,3,1042}; *//*%FSM*/ class FSM { fsmName = "updatecapture"; class States { /*%FSM*/ class Init { name = "Init"; init = /*%FSM*/"disableSerialization;" \n "_delay = 4;" \n "_lastCheck = """";" \n "_lastSID = -1;" \n "_lastUpdate = time;" \n "" \n "_tcarm = 'WFBE_TOWNCAPTUREASSISTRANGEMODIFIER' Call GetNamespace;" \n "" \n "_colorBlue = [0,0,0.7,0.7];" \n "_colorGreen = [0,0.7,0,0.7];" \n "_colorRed = [0.7,0,0,0.7];" \n "" \n "_colorFriendly = switch ('Friendly' Call GetMarkerColoration) do {" \n " case ""ColorGreen"": {_colorGreen};" \n " case ""ColorBlue"": {_colorBlue};" \n " case ""ColorRed"": {_colorRed};" \n " default {_colorGreen};" \n "};" \n "" \n "_colorEnemy = switch ('Enemy' Call GetMarkerColoration) do {" \n " case ""ColorGreen"": {_colorGreen};" \n " case ""ColorBlue"": {_colorBlue};" \n " case ""ColorRed"": {_colorRed};" \n " default {_colorRed};" \n "};" \n "" \n "_coloResistance = switch ('Resistance' Call GetMarkerColoration) do {" \n " case ""ColorGreen"": {_colorGreen};" \n " case ""ColorBlue"": {_colorBlue};" \n " case ""ColorRed"": {_colorRed};" \n " default {_colorBlue};" \n "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Loop { priority = 0.000000; to="Check_Towns"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"time - _lastUpdate > 2 && !gameOver"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Check_Towns { name = "Check_Towns"; init = /*%FSM*/"_sorted = [player,towns] Call SortByDistance;" \n "_nearest = _sorted select 0;" \n "_range = (_nearest getVariable ""range"") * _tcarm;" \n "" \n "_update = false;" \n "if (player distance _nearest < _range && alive player) then {_update = true};" \n "" \n "_lastUpdate = time;"/*%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 In_Range { priority = 0.000000; to="Update_Capture"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_update && !gameOver"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Not_in_Range { priority = 0.000000; to="Hide"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_update && !gameOver"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Loop { priority = 0.000000; to="Check_Towns"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"time - _lastUpdate > 2 && !gameOver"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class End { name = "End"; init = /*%FSM*/""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { }; }; /*%FSM*/ /*%FSM*/ class Update_Capture { name = "Update_Capture"; init = /*%FSM*/"_sideID = _nearest getVariable ""sideID"";" \n "if (isNil '_sideID') then {_sideID = -1};" \n "_curSV = _nearest getVariable ""supplyValue"";" \n "_maxSV = _nearest getVariable ""maxSupplyValue"";" \n "_txt = """";" \n "_nObjects = nearestObjects [player, WFCAMP, 10];" \n "_nObject = if (count _nObjects > 0) then {_nObjects select 0} else {objNull};" \n "if !(isNull _nObject) then {" \n " _sideID = _nObject getVariable ""sideID"";" \n " if !(isNil '_sideID') then {" \n " _curSV = _nObject getVariable ""supplyValue"";" \n " if (_lastCheck == ""Town"") then {_delay = 0};" \n " _lastCheck = ""Camp"";" \n " } else {" \n " _sideID = -1;" \n " };" \n " if (player distance _nObject >= 10) then {" \n " _lastCheck = ""Town"";" \n " _sideID = _nearest getVariable ""sideID"";" \n " _curSV = _nearest getVariable ""supplyValue"";" \n " _txt = Format [""SV: %1/%2"",_curSV,_maxSV];" \n " };" \n "} else {" \n " if (_lastCheck == ""Camp"") then {_delay = 0};" \n " _lastCheck = ""Town"";" \n " _txt = Format [""SV: %1/%2"",_curSV,_maxSV];" \n "};" \n "" \n "_barColor = [];" \n "if (_sideID == RESISTANCEID || _sideID == -1) then {_barColor = _coloResistance};" \n "if ((_sideID == WESTID)&&(sideID == WESTID) || (_sideID == EASTID)&&(sideID == EASTID)) then {_barColor = _colorFriendly}; //--- Green" \n "if ((_sideID == WESTID)&&(sideID == EASTID) || (_sideID == EASTID)&&(sideID == WESTID)) then {_barColor = _colorEnemy};" \n "if (_sideID != _lastSID) then {_delay = 0};" \n "if (isNull ([""currentCutDisplay""] call BIS_FNC_GUIget)) then {12450 cutRsc[""OptionsAvailable"",""PLAIN"",0];_delay = 0};" \n "if (!isNull ([""currentCutDisplay""] call BIS_FNC_GUIget)) then {" \n " _control = ([""currentCutDisplay""] call BIS_FNC_GUIget) DisplayCtrl 3800;" \n " _control ctrlShow true;" \n " _control CtrlSetBackgroundColor _barColor;" \n " _backgroundControl = ([""currentCutDisplay""] call BIS_FNC_GUIget) DisplayCtrl 3600;" \n " _backgroundControl ctrlShow true;" \n " _backgroundControl CtrlSetBackgroundColor [0.1882, 0.2588, 0.149, 0.76];" \n " _textControl = ([""currentCutDisplay""] call BIS_FNC_GUIget) DisplayCtrl 3900;" \n " _textControl ctrlShow true;" \n " _textControl ctrlSetText _txt;" \n " _maxWidth = (CtrlPosition _backgroundControl Select 2) - 0.02;" \n " _position = CtrlPosition _control;" \n " _position Set[2,_maxWidth * _curSV / _maxSV];" \n " _control CtrlSetPosition _position;" \n " _control CtrlCommit _delay;" \n " _delay = 4;" \n " _lastSID = _sideID;" \n "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Loop { priority = 0.000000; to="Check_Towns"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"time - _lastUpdate > 2 && !gameOver"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Hide { name = "Hide"; init = /*%FSM*/"_delay = 0;" \n "if (isNull ([""currentCutDisplay""] call BIS_FNC_GUIget)) then {12450 cutRsc[""OptionsAvailable"",""PLAIN"",0]};" \n "if (!isNull ([""currentCutDisplay""] call BIS_FNC_GUIget)) then {" \n " _control = ([""currentCutDisplay""] call BIS_FNC_GUIget) DisplayCtrl 3800;" \n " _backgroundControl = ([""currentCutDisplay""] call BIS_FNC_GUIget) DisplayCtrl 3600;" \n " _textControl = ([""currentCutDisplay""] call BIS_FNC_GUIget) DisplayCtrl 3900;" \n " _control ctrlShow false;" \n " _backgroundControl ctrlShow false;" \n " _textControl ctrlShow false;" \n "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Loop { priority = 0.000000; to="Check_Towns"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"time - _lastUpdate > 2 && !gameOver"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ }; initState="Init"; finalStates[] = { "End" }; }; /*%FSM*/