/*%FSM*/ /*%FSM*/ /* item0[] = {"init",0,250,-75.000000,-350.000000,25.000000,-300.000000,0.000000,"init"}; item1[] = {"isServer",4,218,50.000000,-350.000000,150.000000,-300.000000,0.000000,"isServer"}; item2[] = {"wait",2,250,50.000000,-275.000000,150.000000,-225.000000,0.000000,"wait"}; item3[] = {"Allow_Conn",4,218,50.000000,-200.000000,150.000000,-150.000000,0.000000,"Allow" \n "Conn"}; item4[] = {"Loading",2,250,-75.000000,-200.000000,25.000000,-150.000000,0.000000,"Loading"}; item5[] = {"Client",4,218,-75.000000,-275.000000,25.000000,-225.000000,0.000000,"Client"}; item6[] = {"player_not_null",4,218,-175.000000,-50.000000,-75.000000,0.000000,0.000000,"player" \n "not null"}; item7[] = {"Prepare",2,250,-75.000000,0.000000,25.000000,50.000000,0.000000,"Prepare"}; item8[] = {"player___player",4,218,50.000000,50.000000,150.000000,100.000000,0.000000,"player =" \n "player"}; item9[] = {"Collect",2,250,-75.000000,100.000000,25.000000,150.000000,0.000000,"Collect"}; item10[] = {"Single_Player",4,218,-200.000000,100.000000,-100.000000,150.000000,3.000000,"Single" \n "Player"}; item11[] = {"Make_PlayerID",2,250,-200.000000,175.000000,-100.000000,225.000000,0.000000,"Make PlayerID"}; item12[] = {"Has_PlayerID",4,218,-75.000000,175.000000,25.000000,225.000000,1.000000,"Has PlayerID"}; item13[] = {"no_PlayerID",4,218,50.000000,150.000000,150.000000,200.000000,2.000000,"no PlayerID"}; item14[] = {"ERROR__No_Player",2,250,175.000000,150.000000,275.000000,200.000000,0.000000,"ERROR:" \n "No PlayerID"}; item15[] = {"Request",2,250,-75.000000,250.000000,25.000000,300.000000,0.000000,"Request"}; item16[] = {"Response",4,218,-175.000000,300.000000,-75.000000,350.000000,0.000000,"Response"}; item17[] = {"Parse_Login",2,250,-75.000000,350.000000,25.000000,400.000000,0.000000,"Parse Login"}; item18[] = {"Hive_Bad",4,218,50.000000,350.000000,150.000000,400.000000,10.000000,"Hive" \n "Bad"}; item19[] = {"ERROR__Wrong_HIVE",2,250,175.000000,350.000000,275.000000,400.000000,0.000000,"ERROR:" \n "Wrong HIVE" \n "Version"}; item20[] = {"Hive_Ok",4,218,-175.000000,400.000000,-75.000000,450.000000,0.000000,"Hive" \n "Ok"}; item21[] = {"Phase_One",2,250,-75.000000,450.000000,25.000000,500.000000,0.000000,"Phase One"}; item22[] = {"Response",4,218,-175.000000,500.000000,-75.000000,550.000000,0.000000,"Response"}; item23[] = {"Phase_Two",2,250,-75.000000,550.000000,25.000000,600.000000,0.000000,"Phase Two"}; item24[] = {"Dead_Player",4,218,50.000000,550.000000,150.000000,600.000000,0.000000,"Dead" \n "Player"}; item25[] = {"ERROR__Player_Already",2,250,175.000000,550.000000,275.000000,600.000000,0.000000,"ERROR:" \n "Player Already" \n "Dead"}; item26[] = {"Alive",4,218,-175.000000,600.000000,-75.000000,650.000000,0.000000,"Alive"}; item27[] = {"Position",2,250,-75.000000,650.000000,25.000000,700.000000,0.000000,"Position"}; item28[] = {"Version_Ok",4,218,-175.000000,700.000000,-75.000000,750.000000,0.000000,"Version" \n "Ok"}; item29[] = {"Load_In",2,250,-75.000000,850.000000,25.000000,900.000000,0.000000,"Load In"}; item30[] = {"Bad_Version",4,218,50.000000,650.000000,150.000000,700.000000,0.000000,"Bad" \n "Version"}; item31[] = {"ERROR__Bad_Versi",2,250,175.000000,650.000000,275.000000,700.000000,0.000000,"ERROR:" \n "Bad Version"}; item32[] = {"Display_Ready",4,218,-175.000000,900.000000,-75.000000,950.000000,0.000000,"Display" \n "Ready"}; item33[] = {"Preload_Display",2,4346,-75.000000,950.000000,25.000000,1000.000000,0.000000,"Preload" \n "Display"}; item34[] = {"Preload_Done",4,218,-175.000000,1000.000000,-75.000000,1050.000000,0.000000,"Preload" \n "Done"}; item35[] = {"Initialize",2,250,-75.000000,1050.000000,25.000000,1100.000000,0.000000,"Initialize"}; item36[] = {"Finish",1,250,-75.000000,1150.000000,25.000000,1200.000000,0.000000,"Finish"}; item37[] = {"True",8,218,25.000000,1100.000000,125.000000,1150.000000,0.000000,"True"}; item38[] = {"Too_Long",4,218,300.000000,150.000000,400.000000,200.000000,0.000000,"Too" \n "Long"}; item39[] = {"Too_Long",4,218,300.000000,350.000000,400.000000,400.000000,0.000000,"Too" \n "Long"}; item40[] = {"Too_Long",4,218,300.000000,550.000000,400.000000,600.000000,0.000000,"Too" \n "Long"}; item41[] = {"Too_Long",4,218,300.000000,650.000000,400.000000,700.000000,0.000000,"Too" \n "Long"}; item42[] = {"Enable_Sim",2,250,-75.000000,-100.000000,25.000000,-50.000000,0.000000,"Enable Sim"}; item43[] = {"Initialized",4,218,-175.000000,-150.000000,-75.000000,-100.000000,0.000000,"Initialized"}; item44[] = {"New_Character",4,218,-275.000000,350.000000,-175.000000,400.000000,5.000000,"New" \n "Character"}; item45[] = {"Gender_Selection",2,250,-400.000000,350.000000,-300.000000,400.000000,0.000000,"Gender Selection" \n "Dialog"}; item46[] = {"Selected",4,218,-400.000000,450.000000,-300.000000,500.000000,0.000000,"Selected"}; item47[] = {"Process",2,250,-275.000000,450.000000,-175.000000,500.000000,0.000000,"Process"}; item48[] = {"no_PlayerID",4,218,50.000000,-100.000000,150.000000,-50.000000,2.000000,"no PlayerID"}; item49[] = {"ERROR__No_Player_1",2,250,175.000000,-100.000000,275.000000,-50.000000,0.000000,"ERROR:" \n "No PlayerID"}; item50[] = {"Too_Long",4,218,300.000000,-100.000000,400.000000,-50.000000,0.000000,"Too" \n "Long"}; item51[] = {"Stream",2,250,-75.000000,750.000000,25.000000,800.000000,0.000000,"Stream"}; item52[] = {"Preloaded",4,218,-175.000000,800.000000,-75.000000,850.000000,0.000000,"Preloaded"}; link0[] = {0,1}; link1[] = {0,5}; link2[] = {1,2}; link3[] = {2,3}; link4[] = {3,4}; link5[] = {4,43}; link6[] = {5,4}; link7[] = {6,7}; link8[] = {7,8}; link9[] = {8,9}; link10[] = {9,10}; link11[] = {9,12}; link12[] = {9,13}; link13[] = {10,11}; link14[] = {11,12}; link15[] = {12,15}; link16[] = {13,14}; link17[] = {14,38}; link18[] = {15,16}; link19[] = {16,17}; link20[] = {17,18}; link21[] = {17,20}; link22[] = {17,44}; link23[] = {18,19}; link24[] = {19,39}; link25[] = {20,21}; link26[] = {21,22}; link27[] = {22,23}; link28[] = {23,24}; link29[] = {23,26}; link30[] = {24,25}; link31[] = {25,40}; link32[] = {26,27}; link33[] = {27,28}; link34[] = {27,30}; link35[] = {28,51}; link36[] = {29,32}; link37[] = {30,31}; link38[] = {31,41}; link39[] = {32,33}; link40[] = {33,34}; link41[] = {34,35}; link42[] = {35,37}; link43[] = {37,36}; link44[] = {38,14}; link45[] = {39,19}; link46[] = {40,25}; link47[] = {41,31}; link48[] = {42,6}; link49[] = {42,48}; link50[] = {43,42}; link51[] = {44,45}; link52[] = {45,46}; link53[] = {46,47}; link54[] = {47,20}; link55[] = {48,49}; link56[] = {49,50}; link57[] = {50,49}; link58[] = {51,52}; link59[] = {52,29}; globals[] = {25.000000,1,0,0,0,640,480,1,81,6316128,1,-440.765930,455.171539,1392.221191,828.390381,955,601,1}; window[] = {2,-1,-1,-1,-1,934,154,1125,154,3,972}; *//*%FSM*/ class FSM { fsmName = "DayZ Player Monitor"; class States { /*%FSM*/ class init { name = "init"; init = /*%FSM*/"dayz_versionNo = getText(configFile >> ""CfgMods"" >> ""DayZ"" >> ""version"");" \n "diag_log (""DAYZ: CLIENT IS RUNNING DAYZ_CODE "" + str(dayz_versionNo));" \n "" \n "0 fadeSound 0;" \n "//player setPosATL [-2148,6655,0];" \n "" \n "_timeStart = time;" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Client { priority = 0.000000; to="Loading"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!isServer"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class isServer { priority = 0.000000; to="wait"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"isServer"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class wait { name = "wait"; init = /*%FSM*/""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Allow_Conn { priority = 0.000000; to="Loading"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"allowConnection"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Loading { name = "Loading"; init = /*%FSM*/"endLoadingScreen;" \n "diag_log (""PLOGIN: Initating"");" \n "" \n "0 cutText [localize ""str_player_13"", ""BLACK FADED"",60];"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Initialized { priority = 0.000000; to="Enable_Sim"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!isnil ""bis_fnc_init"""/*%FSM*/; action=/*%FSM*/"dayz_forceSave = {" \n " //dayzCharSave = [player,dayz_Magazines,true];" \n "" \n " createGearDialog [player, ""RscDisplayGear""];" \n "_dialog = findDisplay 106;" \n "_magazineArray = [];" \n "" \n "//Primary Mags" \n "for ""_i"" from 109 to 120 do " \n "{" \n " _control = _dialog displayCtrl _i;" \n " _item = gearSlotData _control;" \n " _val = gearSlotAmmoCount _control;" \n " _max = getNumber (configFile >> ""CfgMagazines"" >> _item >> ""count"");" \n " if (_item != """") then {" \n " if (_val != _max) then {" \n " _magazineArray set [count _magazineArray,[_item,_val]];" \n " } else {" \n " _magazineArray set [count _magazineArray,_item];" \n " };" \n " };" \n "};" \n "" \n "//Secondary Mags" \n "for ""_i"" from 122 to 129 do " \n "{" \n " _control = _dialog displayCtrl _i;" \n " _item = gearSlotData _control;" \n " _val = gearSlotAmmoCount _control;" \n " _max = getNumber (configFile >> ""CfgMagazines"" >> _item >> ""count"");" \n " if (_item != """") then {" \n " if (_val != _max) then {" \n " _magazineArray set [count _magazineArray,[_item,_val]];" \n " } else {" \n " _magazineArray set [count _magazineArray,_item];" \n " };" \n " };" \n "};" \n " closeDialog 0;" \n "" \n " _medical = player call player_sumMedical;" \n " " \n " /*" \n " Get character state details" \n " */" \n " _currentWpn = currentMuzzle player;" \n " _currentAnim = animationState player;" \n " _config = configFile >> ""CfgMovesMaleSdr"" >> ""States"" >> _currentAnim;" \n " _onLadder = (getNumber (_config >> ""onLadder"")) == 1;" \n " _isTerminal = (getNumber (_config >> ""terminal"")) == 1;" \n " //_wpnDisabled = (getNumber (_config >> ""disableWeapons"")) == 1;" \n " _currentModel = typeOf player;" \n " _charPos = getPosATL player;" \n " _playerPos = [round(direction player),_charPos];" \n " " \n " if (_onLadder or _isInVehicle or _isTerminal) then {" \n " _currentAnim = """";" \n " //If position to be updated, make sure it is at ground level!" \n " if ((count _playerPos > 0) and !_isTerminal) then {" \n " _charPos set [2,0];" \n " _playerPos set[1,_charPos]; " \n " };" \n " };" \n " if (_isInVehicle) then {" \n " _currentWpn = """";" \n " } else {" \n " if ( typeName(_currentWpn) == ""STRING"" ) then {" \n " _muzzles = getArray(configFile >> ""cfgWeapons"" >> _currentWpn >> ""muzzles"");" \n " if (count _muzzles > 1) then {" \n " _currentWpn = currentMuzzle player;" \n " }; " \n " } else {" \n " //diag_log (""DW_DEBUG: _currentWpn: "" + str(_currentWpn));" \n " _currentWpn = """";" \n " };" \n " };" \n " _temp = round(player getVariable [""temperature"",100]);" \n " _currentState = [_currentWpn,_currentAnim,_temp];" \n " " \n " dayzCharDisco = [dayz_characterID,_playerPos,[weapons player,_magazineArray],[typeOf (unitbackpack player),getWeaponCargo (unitbackpack player),getMagazineCargo (unitbackpack player)],_medical,_currentState,_currentModel];" \n " //diag_log str(dayzCharDisco); " \n "" \n " //publicVariableServer ""dayzCharSave"";" \n " publicVariableServer ""dayzCharDisco"";" \n " if (isServer) then {" \n " //dayzCharSave call server_playerSync;" \n " dayzCharDisco call server_characterSync;" \n " };" \n " dayz_lastSave = time;" \n " dayz_Magazines = [];" \n "};"/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Prepare { name = "Prepare"; init = /*%FSM*/"diag_log (""PLOGIN: Player Model Exists"");"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class player___player { priority = 0.000000; to="Collect"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"player == player"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Collect { name = "Collect"; init = /*%FSM*/"diag_log (""PLOGIN: Player Ready"");" \n "" \n "0 cutText [""Getting Player ID"", ""BLACK FADED"",60];" \n "" \n "_playerUID = getPlayerUID player;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Single_Player { priority = 3.000000; to="Make_PlayerID"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"count playableUnits == 0 and isServer"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class no_PlayerID { priority = 2.000000; to="ERROR__No_Player"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_playerUID == """""/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Has_PlayerID { priority = 1.000000; to="Request"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!(isNil ""_playerUID"")"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Make_PlayerID { name = "Make_PlayerID"; init = /*%FSM*/"//In Single Player" \n " isSinglePlayer = true;" \n " player sidechat ""PLOGIN: Single player Mode detected!"";" \n " _playerUID = ""42"";"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Has_PlayerID { priority = 1.000000; to="Request"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!(isNil ""_playerUID"")"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class ERROR__No_Player { name = "ERROR__No_Player"; init = /*%FSM*/"endLoadingScreen;" \n "selectNoPlayer;" \n "_myTime = time;" \n "0 cutText [localize ""str_player_14"", ""BLACK FADED"",15];"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Too_Long { priority = 0.000000; to="ERROR__No_Player"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(time - _myTime) > 10"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Request { name = "Request"; init = /*%FSM*/"startLoadingScreen ["""",""DayZ_loadingScreen""];" \n "" \n "diag_log (""PLOGIN: Requesting Authentication... ("" + _playerUID + "")"");" \n "0 cutText [localize ""str_player_15"", ""BLACK FADED"",60];" \n "" \n "_msg = [];" \n "" \n "dayzLogin = [_playerUID,player];" \n "dayzPlayerLogin = [];" \n "publicVariableServer ""dayzLogin"";" \n "if (isServer) then {" \n " dayzLogin call server_playerLogin;" \n "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Response { priority = 0.000000; to="Parse_Login"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"count (dayzPlayerLogin) > 0"/*%FSM*/; action=/*%FSM*/"_msg = dayzPlayerLogin;"/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Parse_Login { name = "Parse_Login"; init = /*%FSM*/"_charID = _msg select 0;" \n "_inventory = _msg select 1;" \n "_backpack = _msg select 2;" \n "_survival = _msg select 3;" \n "_isNew = _msg select 4;" \n "//_state = _msg select 5;" \n "_version = _msg select 5;" \n "_model = _msg select 6;" \n "" \n "_isHiveOk = false;" \n "_newPlayer = false;" \n "" \n "if (count _msg > 7) then {" \n " _isHiveOk = _msg select 7;" \n " _newPlayer = _msg select 8;" \n " diag_log (""PLAYER RESULT: "" + str(_isHiveOk));" \n "};" \n "" \n "0 cutText [localize ""str_player_17"", ""BLACK FADED"",60];" \n "diag_log (""PLOGIN: authenticated with : "" + str(_msg));" \n "" \n "//Not Equal Failure" \n "" \n "if (isNil ""_model"") then {" \n " _model = ""Survivor2_DZ"";" \n " diag_log (""PLOGIN: Model was nil, loading as survivor"");" \n "};" \n "" \n "if (_model == """") then {" \n " _model = ""Survivor2_DZ"";" \n " diag_log (""PLOGIN: Model was empty, loading as survivor"");" \n "};" \n "" \n "if (_model == ""Survivor1_DZ"") then {" \n " _model = ""Survivor2_DZ"";" \n "};" \n "" \n "_isHack = false;" \n "if (_model == ""hacker"") then {" \n " _isHack = true;" \n "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Hive_Bad { priority = 10.000000; to="ERROR__Wrong_HIVE"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_isHiveOk"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class New_Character { priority = 5.000000; to="Gender_Selection"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_isNew"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Hive_Ok { priority = 0.000000; to="Phase_One"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"true"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class ERROR__Wrong_HIVE { name = "ERROR__Wrong_HIVE"; init = /*%FSM*/"endLoadingScreen;" \n "selectNoPlayer;" \n "" \n "_myTime = time;" \n "0 cutText [""This server is running an incorrect version of the server side application. You cannot play on this server. If you are the server admin please contact DayZ staff."", ""BLACK FADED"",5];"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Too_Long { priority = 0.000000; to="ERROR__Wrong_HIVE"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(time - _myTime) > 10"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Phase_One { name = "Phase_One"; init = /*%FSM*/"//_model = ""BanditW1_DZ"";" \n "" \n "dayz_playerName = name player;" \n "_model call player_switchModel;" \n "" \n "player allowDamage false;" \n "_lastAte = _survival select 1;" \n "_lastDrank = _survival select 2;" \n "" \n "_usedFood = 0;" \n "_usedWater = 0;" \n "" \n "//_inventory = [[""Mk_48_DZ"",""NVGoggles"",""Binocular_Vector"",""M9SD"",""ItemGPS"",""ItemToolbox"",""ItemEtool"",""ItemCompass"",""ItemMatchbox"",""FoodCanBakedBeans"",""ItemKnife"",""ItemMap"",""ItemWatch""],[[""100Rnd_762x51_M240"",47],""ItemPainkiller"",""ItemBandage"",""15Rnd_9x19_M9SD"",""100Rnd_762x51_M240"",""ItemBandage"",""ItemBandage"",""15Rnd_9x19_M9SD"",""15Rnd_9x19_M9SD"",""15Rnd_9x19_M9SD"",""ItemMorphine"",""PartWoodPile""]];" \n "" \n "dayzGearSave = false;" \n "_inventory call player_gearSet;" \n "" \n "//player addMagazine ""7Rnd_45ACP_1911"";" \n "" \n "//Assess in backpack" \n "if (count _backpack > 0) then {" \n " //Populate" \n " _backpackType = _backpack select 0;" \n " _backpackWpn = _backpack select 1;" \n " _backpackMagTypes = [];" \n " _backpackMagQty = [];" \n " if (count _backpackWpn > 0) then {" \n " _backpackMagTypes = (_backpack select 2) select 0;" \n " _backpackMagQty = (_backpack select 2) select 1;" \n " };" \n " _countr = 0;" \n " _backpackWater = 0;" \n "" \n " //Add backpack" \n " if (_backpackType != """") then {" \n " _isOK = isClass(configFile >> ""CfgVehicles"" >>_backpackType);" \n " if (_isOK) then {" \n " player addBackpack _backpackType; " \n " dayz_myBackpack = unitBackpack player;" \n " " \n " //Fill backpack contents" \n " //Weapons" \n " _backpackWpnTypes = [];" \n " _backpackWpnQtys = [];" \n " if (count _backpackWpn > 0) then {" \n " _backpackWpnTypes = _backpackWpn select 0;" \n " _backpackWpnQtys = _backpackWpn select 1;" \n " };" \n " _countr = 0;" \n " {" \n " dayz_myBackpack addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)];" \n " _countr = _countr + 1;" \n " } forEach _backpackWpnTypes;" \n " " \n " //Magazines" \n " _countr = 0;" \n " {" \n " dayz_myBackpack addMagazineCargoGlobal [_x,(_backpackMagQty select _countr)];" \n " _countr = _countr + 1;" \n " } forEach _backpackMagTypes;" \n " " \n " dayz_myBackpackMags = getMagazineCargo dayz_myBackpack;" \n " dayz_myBackpackWpns = getWeaponCargo dayz_myBackpack;" \n " } else {" \n " dayz_myBackpack = objNull;" \n " dayz_myBackpackMags = [];" \n " dayz_myBackpackWpns = [];" \n " };" \n " } else {" \n " dayz_myBackpack = objNull;" \n " dayz_myBackpackMags = [];" \n " dayz_myBackpackWpns = [];" \n " };" \n "} else {" \n " dayz_myBackpack = objNull;" \n " dayz_myBackpackMags = [];" \n " dayz_myBackpackWpns = [];" \n "};" \n "" \n "dayzPlayerLogin2 = [];" \n "dayzLogin2 = [_charID,player,_playerUID];" \n "publicVariable ""dayzLogin2"";" \n "if (isServer) then {" \n " dayzLogin2 spawn server_playerSetup;" \n "};" \n "" \n "0 cutText [""Requesting Character data from server"", ""BLACK FADED"",60];" \n "diag_log ""Attempting Phase two..."";"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Response { priority = 0.000000; to="Phase_Two"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"count (dayzPlayerLogin2) > 0"/*%FSM*/; action=/*%FSM*/"_msg = player getVariable[""worldspace"",[]];"/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Phase_Two { name = "Phase_Two"; init = /*%FSM*/"0 cutText [""Character Data received from server"", ""BLACK FADED"",60];" \n "diag_log ""Finished..."";" \n "" \n "_worldspace = dayzPlayerLogin2 select 0;" \n "_state = dayzPlayerLogin2 select 1;" \n "" \n "_setDir = _worldspace select 0;" \n "_setPos = _worldspace select 1;" \n "" \n "player setPosATL _setPos;" \n "player setDir _setDir;" \n "" \n "//Legs and Arm fractures" \n "_legs = player getVariable [""hit_legs"",0];" \n "_arms = player getVariable [""hit_hands"",0];" \n "" \n "if (_legs > 1) then {" \n " player setHit[""legs"",1];" \n " r_fracture_legs = true;" \n "};" \n "if (_arms > 1) then {" \n " player setHit[""hands"",1];" \n " r_fracture_arms = true;" \n "};" \n "" \n "//Record current weapon state" \n "dayz_myWeapons = weapons player; //Array of last checked weapons" \n "dayz_myItems = items player; //Array of last checked items" \n "dayz_myMagazines = magazines player;" \n "" \n "dayz_playerUID = _playerUID;" \n "" \n "if ((_isNew) OR (count _inventory == 0)) then {" \n " //player is new, add initial loadout" \n " _config = (configFile >> ""CfgSurvival"" >> ""Inventory"" >> ""Default"");" \n " _mags = getArray (_config >> ""magazines"");" \n " _wpns = getArray (_config >> ""weapons"");" \n " _bcpk = getText (_config >> ""backpack"");" \n " _bcpkWpn = getText (_config >> ""backpackWeapon"");" \n " " \n " //Add inventory" \n " {" \n " _isOK = isClass(configFile >> ""CfgMagazines"" >> _x);" \n " if (_isOK) then {" \n " player addMagazine _x;" \n " };" \n " } forEach _mags;" \n " {" \n " _isOK = isClass(configFile >> ""CfgWeapons"" >> _x);" \n " if (_isOK) then {" \n " player addWeapon _x;" \n " };" \n " } forEach _wpns;" \n " " \n " player addBackpack _bcpk; " \n " dayz_myBackpack = unitBackpack player;" \n "" \n " if (_bcpkWpn != """") then {" \n " dayz_myBackpack addWeaponCargoGlobal [_bcpkWpn,1];" \n " };" \n "};" \n "" \n "//Work out survival time" \n "_totalMins = _survival select 0;" \n "_days = floor (_totalMins / 1440);" \n "_totalMins = (_totalMins - (_days * 1440));" \n "_hours = floor (_totalMins / 60);" \n "_mins = (_totalMins - (_hours * 60));" \n "" \n "//player variables" \n "dayz_characterID = _charID;" \n "dayz_hasFire = objNull; //records players Fireplace object" \n "dayz_myCursorTarget = objNull;" \n "dayz_myPosition = getPosATL player; //Last recorded position" \n "dayz_lastMeal = (_lastAte * 60);" \n "dayz_lastDrink = (_lastDrank * 60);" \n "dayz_zombiesLocal = 0; //Used to record how many local zombies being tracked" \n "" \n "//load in medical details" \n "r_player_dead = player getVariable[""USEC_isDead"",false];" \n "r_player_unconscious = player getVariable[""NORRN_unconscious"", false];" \n "r_player_infected = player getVariable[""USEC_infected"",false];" \n "r_player_injured = player getVariable[""USEC_injured"",false];" \n "r_player_inpain = player getVariable[""USEC_inPain"",false];" \n "r_player_cardiac = player getVariable[""USEC_isCardiac"",false];" \n "r_player_lowblood = player getVariable[""USEC_lowBlood"",false];" \n "r_player_blood = player getVariable[""USEC_BloodQty"",r_player_bloodTotal];" \n "" \n "//Hunger/Thirst" \n "_messing = player getVariable[""messing"",[0,0]];" \n "dayz_hunger = _messing select 0;" \n "dayz_thirst = _messing select 1;" \n "" \n "//player setVariable [""humanity"",-3000, true];"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Alive { priority = 0.000000; to="Position"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!r_player_dead"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Dead_Player { priority = 0.000000; to="ERROR__Player_Already"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"r_player_dead"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class ERROR__Player_Already { name = "ERROR__Player_Already"; init = /*%FSM*/"endLoadingScreen;" \n "selectNoPlayer;" \n "_myTime = time;" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Too_Long { priority = 0.000000; to="ERROR__Player_Already"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(time - _myTime) > 10"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Position { name = "Position"; init = /*%FSM*/"endLoadingScreen;" \n "startLoadingScreen ["""",""DayZ_loadingScreen""];" \n "//Location" \n "_myLoc = getPosATL player;" \n "" \n "0 cutText [""Setup Completed, please wait..."", ""BLACK FADED"",60];" \n "" \n "//GUI" \n "3 cutRsc [""playerStatusGUI"", ""PLAIN"",0];" \n "//5 cutRsc [""playerKillScore"", ""PLAIN"",2];" \n "" \n "//Update GUI" \n "call player_updateGui;" \n "_id = [] spawn {" \n " disableSerialization;" \n " _display = uiNamespace getVariable 'DAYZ_GUI_display';" \n " _control = _display displayCtrl 1204;" \n " _control ctrlShow false;" \n " if (!r_player_injured) then {" \n " _ctrlBleed = _display displayCtrl 1303;" \n " _ctrlBleed ctrlShow false;" \n " };" \n " if (!r_fracture_legs and !r_fracture_arms) then {" \n " _ctrlFracture = _display displayCtrl 1203;" \n " _ctrlFracture ctrlShow false;" \n " };" \n "};" \n "" \n "call ui_changeDisplay;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Bad_Version { priority = 0.000000; to="ERROR__Bad_Versi"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_version != dayz_versionNo"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Version_Ok { priority = 0.000000; to="Stream"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_version == dayz_versionNo"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Load_In { name = "Load_In"; init = /*%FSM*/"//Reveal action types" \n "" \n "{player reveal _x} forEach (nearestObjects [getPosATL player, [""AllVehicles"",""WeaponHolder"",""TentStorage"",""VaultStorage"",""BuiltItems""], 50]);" \n "" \n "dayz_clientPreload = true;" \n "3 fadeSound 1;" \n "0 cutText ["""", ""BLACK IN"", 3];" \n "0 fadeMusic 0.5;" \n "" \n "//Check mission objects" \n "{ _id = [_x,0] spawn object_roadFlare } forEach (allMissionObjects ""RoadFlare"");" \n "{ _id = [_x,1] spawn object_roadFlare } forEach (allMissionObjects ""ChemLight"");"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Display_Ready { priority = 0.000000; to="Preload_Display"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!(isNull (findDisplay 46))"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class ERROR__Bad_Versi { name = "ERROR__Bad_Versi"; init = /*%FSM*/"endLoadingScreen;" \n "selectNoPlayer;" \n "_myTime = time;" \n "cutText [format[localize ""str_player_18"",dayz_versionNo,_version], ""BLACK""];"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Too_Long { priority = 0.000000; to="ERROR__Bad_Versi"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(time - _myTime) > 10"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Preload_Display { name = "Preload_Display"; init = /*%FSM*/"dayz_lastCheckBit = 0;" \n "" \n "(findDisplay 46) displayAddEventHandler [""KeyDown"",""_this call dayz_spaceInterrupt""];" \n "player disableConversation true;" \n "" \n "eh_player_killed = player addeventhandler [""FiredNear"",{_this call player_weaponFiredNear;} ];" \n "//_eh_combat_projectilenear = player addEventHandler [""IncomingFire"",{_this call player_projectileNear;}];" \n "" \n "//Select Weapon" \n "// Desc: select default weapon & handle multiple muzzles" \n "_playerObjName = format[""player%1"",_playerUID];" \n "call compile format[""player%1 = player;"",_playerUID];" \n "diag_log (format[""player%1 = player"",_playerUID]);" \n "publicVariable _playerObjName;" \n "" \n "//_state = player getVariable[""state"",[]];" \n "_currentWpn = """";" \n "_currentAnim = """";" \n "if (count _state > 0) then {" \n " //Reload players state" \n " _currentWpn = _state select 0;" \n " _currentAnim = _state select 1;" \n " //Reload players state" \n " if (count _state > 2) then {" \n " dayz_temperatur = _state select 2;" \n " };" \n "};" \n "" \n "if (_currentWpn == ""MeleeCrowbar"") then {" \n " player addMagazine 'crowbar_swing';" \n "};" \n "if (_currentWpn == ""MeleeHatchet"") then {" \n " player addMagazine 'hatchet_swing';" \n "};" \n "" \n "reload player;" \n "" \n "if (_currentAnim != """") then {" \n " [objNull, player, rSwitchMove,_currentAnim] call RE;" \n "};" \n "if (_currentWpn != """") then {" \n " player selectWeapon _currentWpn;" \n "} else {" \n " //Establish default weapon" \n " if (count weapons player > 0) then" \n " {" \n " private['_type', '_muzzles'];" \n "" \n " _type = ((weapons player) select 0);" \n " // check for multiple muzzles (eg: GL)" \n " _muzzles = getArray(configFile >> ""cfgWeapons"" >> _type >> ""muzzles"");" \n "" \n " if (count _muzzles > 1) then {" \n " player selectWeapon (_muzzles select 0);" \n " } else {" \n " player selectWeapon _type;" \n " };" \n " };" \n "};" \n "" \n "//Player control loop" \n "dayz_monitor1 = [] spawn {" \n " while {true} do {" \n " call player_zombieCheck;" \n " sleep 1;" \n " };" \n "};" \n "" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Preload_Done { priority = 0.000000; to="Initialize"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"dayz_preloadFinished"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Initialize { name = "Initialize"; init = /*%FSM*/"//Medical" \n "dayz_medicalH = [] execVM ""\z\addons\dayz_code\medical\init_medical.sqf""; //Medical Monitor Script (client only)" \n "[player] call fnc_usec_damageHandle;" \n "if (r_player_unconscious) then {" \n " r_player_timeout = player getVariable[""unconsciousTime"",0];" \n " player playActionNow ""Die"";" \n "};" \n "player allowDamage true;" \n "" \n "//Add core tools" \n "player addWeapon ""Loot"";" \n "player addWeapon ""Flare"";" \n "" \n "//load in medical details" \n "r_player_dead = player getVariable[""USEC_isDead"",false];" \n "r_player_unconscious = player getVariable[""NORRN_unconscious"", false];" \n "r_player_infected = player getVariable[""USEC_infected"",false];" \n "r_player_injured = player getVariable[""USEC_injured"",false];" \n "r_player_inpain = player getVariable[""USEC_inPain"",false];" \n "r_player_cardiac = player getVariable[""USEC_isCardiac"",false];" \n "r_player_lowblood = player getVariable[""USEC_lowBlood"",false];" \n "r_player_blood = player getVariable[""USEC_BloodQty"",r_player_bloodTotal];" \n "" \n """colorCorrections"" ppEffectEnable true;" \n """colorCorrections"" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, (r_player_blood/r_player_bloodTotal)], [1, 1, 1, 0.0]];" \n """colorCorrections"" ppEffectCommit 0;" \n "" \n "dayz_gui = [] spawn {" \n " private[""_distance""];" \n " dayz_musicH = [] spawn player_music;" \n " while {true} do {" \n " _array = player call world_surfaceNoise;" \n " dayz_surfaceNoise = _array select 1;" \n " dayz_surfaceType = _array select 0;" \n " call player_checkStealth;" \n " dayz_statusArray = [] call player_updateGui;" \n " if (!isNull cursorTarget and !dayz_heartBeat) then {" \n " if (alive cursorTarget) then {" \n " _id = cursorTarget spawn dayz_lowHumanity;" \n " };" \n " };" \n " sleep 0.2;" \n " };" \n "};" \n "" \n "dayzGearSave = true;" \n "" \n "dayz_slowCheck = [] spawn player_spawn_2;" \n "" \n "_world = toUpper(worldName); //toUpper(getText (configFile >> ""CfgWorlds"" >> (worldName) >> ""description""));" \n "_nearestCity = nearestLocations [getPos player, [""NameCityCapital"",""NameCity"",""NameVillage"",""NameLocal""],1000];" \n "_town = ""Wilderness"";" \n "" \n "diag_log (""NearestCity"" + str(_nearestCity));" \n "" \n "if (count _nearestCity > 0) then {_town = text (_nearestCity select 0)};" \n "" \n "_strTime = call curTimeStr;" \n "_strDate = date;" \n "" \n "_first = [_world,_town,localize (""str_player_06"") + "" "" + str(_days)] spawn BIS_fnc_infoText;" \n "" \n "dayz_animalCheck = [] spawn player_spawn_1;" \n "" \n "dayz_lootCheck = [_playerUID,_charID] spawn {" \n " private[""_handle"",""_humanity"",""_playerUID"",""_oldModel"",""_runOnce""];" \n " _playerUID = _this select 0;" \n " _charID = _this select 1;" \n " _runOnce = false;" \n " while {true} do {" \n " _handle = [false] spawn player_spawnCheck;" \n " waitUntil{scriptDone _handle};" \n " call stream_locationCheck;" \n " sleep 2;" \n " };" \n "};" \n "{ _x call fnc_vehicleEventHandler; } forEach vehicles;" \n "{ nul = [_x,2,0,false,false] spawn BIS_Effects_Burn; } forEach allMissionObjects ""UH1Wreck_DZ"";" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class True { priority = 0.000000; to="Finish"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/""/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Finish { name = "Finish"; init = /*%FSM*/"dayzGearSave = true;" \n "dayz_myPosition = getPosATL player;" \n "" \n "dayzLoginRecord = [_playerUID,_charID,0];" \n "publicVariableServer ""dayzLoginRecord"";"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { }; }; /*%FSM*/ /*%FSM*/ class Enable_Sim { name = "Enable_Sim"; init = /*%FSM*/"_myAnim = getNumber(configFile >> ""CfgPatches"" >> ""dayz_anim"" >> ""isUpdated"");" \n "player enableSimulation true;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class no_PlayerID { priority = 2.000000; to="ERROR__No_Player_1"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_myAnim == 0"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class player_not_null { priority = 0.000000; to="Prepare"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!isNull player"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Gender_Selection { name = "Gender_Selection"; init = /*%FSM*/"dayz_selectGender = ""Survivor2_DZ"";" \n "endLoadingScreen;" \n "0 cutText ["""", ""BLACK FADED"",60];" \n "createDialog ""RscDisplayGenderSelect"";"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Selected { priority = 0.000000; to="Process"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!dialog"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Process { name = "Process"; init = /*%FSM*/"_model = dayz_selectGender;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Hive_Ok { priority = 0.000000; to="Phase_One"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"true"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class ERROR__No_Player_1 { name = "ERROR__No_Player_1"; init = /*%FSM*/"endLoadingScreen;" \n "selectNoPlayer;" \n "_myTime = time;" \n "0 cutText [""You have an outdated version of 'dayz_anim' please download the correct version"", ""BLACK FADED"",15];"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Too_Long { priority = 0.000000; to="ERROR__No_Player_1"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(time - _myTime) > 10"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ /*%FSM*/ class Stream { name = "Stream"; init = /*%FSM*/"//stream in location" \n "call stream_locationCheck;" \n "" \n "_zombies = (getPosATL player) nearEntities [""zZombie_Base"",30];" \n "{deleteVehicle _x} forEach _zombies;" \n "" \n "endLoadingScreen;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Preloaded { priority = 0.000000; to="Load_In"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"preloadCamera _setPos"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ }; initState="init"; finalStates[] = { "Finish", }; }; /*%FSM*/