diff --git a/SQF/dayz_code/NOTE.txt b/SQF/dayz_code/NOTE.txt index 6319d1e5b..dede8dc39 100644 --- a/SQF/dayz_code/NOTE.txt +++ b/SQF/dayz_code/NOTE.txt @@ -51,6 +51,12 @@ PVDZ_obj_Publish IS PVDZE_obj_Publish PVCDZ_obj_HideBody IS PVDZE_obj_HideBody ******REPLACE ALL PVCDZ_ AND PVDZ_ with PVCDZE/PVDZE_ +trap_monitor.fsm is no more! +dayzPlayerLogin VARIABLE IS NO MORE! +dayzPlayerLogin2 = []; VARIABLE IS NO MORE! USE PVCDZ_plr_Login2 +dayz_authed VARIABLE IS NO MORE??? +dayz_gui = [] spawn { IS NO MORE???? + PVDZ_drg_RaLW IS norrnRaLW PVDZ_drg_RLact IS norrnRLact NEW FNC PVDZE_hlt_Bleed -- THATS AN L change it to an I @@ -61,4 +67,6 @@ PVDZE_veh_SFuel BECOMES PVCDZE_veh_SetFuel PVDZ_plr_Death BECOMES PVDZE_plr_Died PVDZ_plr_Login1 BECOMES PVDZE_plr_Login PVDZ_obj_Destroy BECOMES PVDZE_obj_Delete //WHO RENAMED THESE VARIABLES IN DAYZ VANILLA, THE COMPILE IT CALLS IS STILL NAMED server_deleteObj WHY CHANGE IT TO DESTROY!!!!??? -dayzSetDate BECOMES PVDZE_plr_SetDate \ No newline at end of file +dayzSetDate BECOMES PVDZE_plr_SetDate + +PVDZ_serverStoreVar BECOMES PVDZE_serverStoreVar \ No newline at end of file diff --git a/SQF/dayz_code/compile/player_spawnCheck.sqf b/SQF/dayz_code/compile/player_spawnCheck.sqf index c80fb83c2..1c59b7a61 100644 --- a/SQF/dayz_code/compile/player_spawnCheck.sqf +++ b/SQF/dayz_code/compile/player_spawnCheck.sqf @@ -1,44 +1,68 @@ -private ["_type","_inVehicle","_dateNow","_maxWildZombies","_age","_radius","_position","_markerstr","_markerstr1","_markerstr2","_markerstr3","_nearByObj","_handle","_looted","_cleared","_zombied","_config","_canLoot","_dis","_players","_nearby","_nearbyCount","_onTheMove","_soundLimit"]; -//_t1 = diag_tickTime; - -_type = _this select 0; -_inVehicle = (vehicle player != player); -_onTheMove = (speed (vehicle player) > 10); -_dateNow = (DateToNumber date); -_maxWildZombies = 3; +private ["_isWreck","_maxControlledZombies","_looted","_zombied","_doNothing","_spawnZedRadius","_serverTime","_age","_nearbyBuildings","_position","_spawnableObjects","_speed","_radius","_maxlocalspawned","_maxWeaponHolders","_currentWeaponHolders","_maxtoCreate","_inVehicle","_isAir","_isLand","_isSea","_Controlledzeddivided","_totalcrew","_nearby","_type","_config","_canSpawn","_dis","_checkLoot","_islocal","_bPos","_zombiesNum"]; _age = -1; -_radius = 200; +//_nearbyBuildings = []; _position = [player] call FNC_GetPos; +_spawnableObjects = ["building", "CrashSite", "IC_Fireplace1", "IC_DomeTent", "IC_Tent"]; +_speed = speed (vehicle player); +_radius = 300; //150*0.707; Pointless Processing (106.5) +_spawnZedRadius = 20; -dayz_spawnZombies = 0; -dayz_CurrentZombies = 0; +/* +//Tick Time +PVDZ_getTickTime = player; +publicVariableServer "PVDZ_getTickTime"; +*/ -// experiment with adding fly sounds locally for both zombies && players. -_soundLimit = 2; -{ - if (!alive _x) then { - if (!(_x isKindOf "zZombie_Base")) then { - [player,"flysound",1,true] call dayz_zombieSpeak; - _soundLimit = _soundLimit - 1; - }; - }; - if (_soundLimit == 0) exitWith {}; -} count (nearestObjects [player, ["CAManBase"], 8]); +//Total Counts +_maxlocalspawned = round(dayz_spawnZombies); +_maxControlledZombies = round(dayz_maxLocalZombies); +_maxWeaponHolders = round(dayz_maxMaxWeaponHolders); +_currentWeaponHolders = round(dayz_currentWeaponHolders); -_players = _position nearEntities ["CAManBase",_radius+200]; -dayz_maxGlobalZombies = dayz_maxGlobalZombiesInit; -{ - if(isPlayer _x) then { - dayz_maxGlobalZombies = dayz_maxGlobalZombies + dayz_maxGlobalZombiesIncrease; - } else { - if (_x isKindOf "zZombie_Base") then { - if (local _x) then { - dayz_spawnZombies = dayz_spawnZombies + 1; - }; - dayz_CurrentZombies = dayz_CurrentZombies + 1; - }; - }; -} count _players; +//Limits (Land,Sea,Air) +_inVehicle = (vehicle player != player); +/* + _isAir = vehicle player iskindof "Air"; + _isLand = vehicle player iskindof "Land"; + _isSea = vehicle player iskindof "Sea"; + if (_isLand) then { } else { }; + if (_isAir) then { } else { }; + if (_isSea) then { } else { }; +*/ + +_doNothing = false; +if (_inVehicle) then { + _Controlledzeddivided = 0; + //exit if too fast + if (_speed > 25) exitwith {_doNothing = true;}; + + //Crew can spawn zeds. + _totalcrew = count (crew (vehicle player)); + if (_totalcrew > 1) then { + _Controlledzeddivided = 2; + + //Dont allow driver to spawn if we have other crew members. + if (player == driver (vehicle player)) exitwith {_doNothing = true;}; + } else { + _Controlledzeddivided = 4; + }; + + if (_Controlledzeddivided > 0) then { + _maxControlledZombies = round(_maxControlledZombies / _Controlledzeddivided); + r_player_divideinvehicle = _Controlledzeddivided; + }; +}; + +if (_doNothing) exitwith {}; + +//Logging +diag_log (format["%1 Local.Agents: %2/%3, NearBy.Agents: %8/%9, Global.Agents: %6/%7, W.holders: %10/%11, (radius:%4m %5fps).","SpawnCheck", + _maxlocalspawned, _maxControlledZombies, _radius, round diag_fpsmin,dayz_currentGlobalZombies, + dayz_maxGlobalZeds, dayz_CurrentNearByZombies, dayz_maxNearByZombies, _currentWeaponHolders,_maxWeaponHolders]); + +_nearby = nearestObjects [_position, _spawnableObjects,_radius]; +_maxlocalspawned = _maxlocalspawned max floor(_maxControlledZombies*.8); +if (_maxlocalspawned > 0) then { _spawnZedRadius = _spawnZedRadius * 3; }; if ("ItemMap_Debug" in items player) then { deleteMarkerLocal "MaxZeds"; @@ -83,71 +107,76 @@ diag_log ("GlobalZombies: " +str(dayz_CurrentZombies) + "/" +str(dayz_maxGlobalZ diag_log ("dayz_maxCurrentZeds: " +str(dayz_maxCurrentZeds) + "/" +str(dayz_maxZeds)); }; - - -_nearby = _position nearObjects ["building",_radius]; -_nearbyCount = count _nearby; -if (_nearbyCount < 1) exitwith +//Spawn Zeds & loot in buildings { - if ((dayz_spawnZombies < _maxWildZombies) && !_inVehicle) then { - [_position] call wild_spawnZombies; - }; -}; + _type = typeOf _x; + _config = configFile >> "CfgLoot" >> "Buildings" >> _type; + _canSpawn = isClass (_config); + if (_canSpawn) then { + _dis = _x distance player; + _checkLoot = (count (getArray (_config >> "lootPos"))) > 0; + _islocal = _x getVariable ["", false]; // object created locally via TownGenerator. See stream_locationFill.sqf -{ - _type = typeOf _x; - _config = configFile >> "CfgBuildingLoot" >> _type; - if (DZE_MissionLootTable) then { - _config = missionConfigFile >> "CfgBuildingLoot" >> _type; - }; - _canLoot = isClass (_config); - - if(_canLoot) then { - - _dis = _x distance player; - - //Loot - if ((_dis < 120) && (_dis > 30) && !_inVehicle) then { - _looted = (_x getVariable ["looted",-0.1]); - _cleared = (_x getVariable ["cleared",true]); - _dateNow = (DateToNumber date); - _age = (_dateNow - _looted) * 525948; - //diag_log ("SPAWN LOOT: " + _type + " Building is " + str(_age) + " old" ); - if ((_age > DZE_LootSpawnTimer) && (!_cleared)) then { - _nearByObj = nearestObjects [(getPosATL _x), ["WeaponHolder","WeaponHolderBase"],((sizeOf _type)+5)]; - {deleteVehicle _x} count _nearByObj; - _x setVariable ["cleared",true,true]; - _x setVariable ["looted",_dateNow,true]; - }; - if ((_age > DZE_LootSpawnTimer) && (_cleared)) then { - //Register - _x setVariable ["looted",_dateNow,true]; - //cleanup - _x call building_spawnLoot; + //Make sure wrecks always spawn Zeds + _isWreck = _x isKindOf "CrashSite"; + + //Loot + if (getNumber(_config >> "lootChance") > 0) then { + if (_currentWeaponHolders < _maxWeaponHolders) then { + //Baisc loot check + if ((_dis < 125) and (_dis > 30) and !_inVehicle and _checkLoot) then { + _serverTime = serverTime; + _looted = (_x getVariable ["looted",_serverTime]); + _age = _serverTime - _looted; + if ((_age == 0) or (_age > 900)) then { + _x setVariable ["looted",_serverTime,!_islocal]; + _x call building_spawnLoot; + if (!(_x in dayz_buildingBubbleMonitor)) then { + dayz_buildingBubbleMonitor set [count dayz_buildingBubbleMonitor, _x]; + }; + //diag_log [ diag_tickTime, "new loot at",_x,"age:", _age, "serverTime:", _serverTime]; + }/* + else { + diag_log [ diag_tickTime, "won't spawn loot at",_x,"age:", _age, "serverTime:", _serverTime]; + }*/; + }; }; }; - // do not spawn zeds if player is moving faster then 10kmh - if (!_onTheMove) then { - //Zeds - if ((time - dayz_spawnWait) > dayz_spawnDelay) then { - if (dayz_maxCurrentZeds < dayz_maxZeds) then { - if (dayz_CurrentZombies < dayz_maxGlobalZombies) then { - if (dayz_spawnZombies < dayz_maxLocalZombies) then { - _zombied = (_x getVariable ["zombieSpawn",-0.1]); - _dateNow = (DateToNumber date); - _age = (_dateNow - _zombied) * 525948; - if (_age > 3) then { - _x setVariable ["zombieSpawn",_dateNow,true]; - [_x] call building_spawnZombies; + //Zeds + if (getNumber(_config >> "zombieChance") > 0) then { + if (_dis > _spawnZedRadius) then { + _serverTime = serverTime; + _zombied = (_x getVariable ["zombieSpawn",_serverTime]); + _age = _serverTime - _zombied; + if ((_age == 0) or (_age > 300)) then { + if (!_isWreck) then { + if ((dayz_spawnZombies < _maxControlledZombies) and (dayz_CurrentNearByZombies < dayz_maxNearByZombies) and (dayz_currentGlobalZombies < dayz_maxGlobalZeds)) then { + _bPos = getPosATL _x; + _zombiesNum = {alive _x} count (_bPos nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 10)]); + + if (_zombiesNum == 0) then { + _x setVariable ["zombieSpawn",_serverTime,!_islocal]; + + if (!(_x in dayz_buildingBubbleMonitor)) then { + //add active zed to var + dayz_buildingBubbleMonitor set [count dayz_buildingBubbleMonitor, _x]; }; - } else { - dayz_spawnWait = time; + + //start spawn + [_x] call building_spawnZombies; + }; + //diag_log (format["%1 building. %2", __FILE__, _x]); }; + } else { + _bPos = getPosATL _x; + _zombiesNum = {alive _x} count (_bPos nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 30)]); + //Should be a wreck + if (_zombiesNum == 0) then { [_x,_isWreck] call building_spawnZombies; }; }; }; }; }; - }; -} forEach _nearby; + }; +} forEach _nearby; \ No newline at end of file diff --git a/SQF/dayz_code/system/REsec.hpp b/SQF/dayz_code/system/REsec.hpp new file mode 100644 index 000000000..1defa4daf --- /dev/null +++ b/SQF/dayz_code/system/REsec.hpp @@ -0,0 +1,31 @@ +// (c) facoptere@gmail.com, licensed to DayZMod for the community + +// These RE commands will be cancelled once init.sqf is exec'ed on client or server +#ifndef REMOVED_LIB +#define REMOVED_LIB [ "addAction", "addEventhandler", "addMagazine", "addMagazineCargo", "addWeapon", \ +"addWeaponCargo", "addWPCur", "animate", "callVar", "clearMagazineCargo", "clearWeaponCargo", "createDiaryRecord", \ +"createMarkerLocal", "createSimpleTask", "createTaskSet", "debugLog", "deleteWP", "enablesimulation", "endMission", \ +"execfsm", "fadeMusic", "fadeSound", "failMission", "globalChat", "globalRadio", "groupChat", "groupRadio", \ +"hideObject", "hint", "hintC", "kbAddTopic", "kbreact", "kbRemoveTopic", "kbtell", "land", "move", "moveIn", \ +"playAction", "playActionnow", "playmovenow", "playMusic", "playsound", "removeAction", \ +"removeAllWeapons", "setCaptive", "setCurrentTask", "setCurrentTaskArrays", "setDate", "setDir", "setGroupID", \ +"setMarkerPosLocal", "setObjectTexture", "setSimpleTaskDescription", "setTaskState", "setWPdesc", "setWPtype", \ +"showCommandingMenu", "sideChat", "sideRadio", "skiptime", "spawn", "switchAction", "switchCamera", "taskHint", \ +"titleCut", "Hangender"] +#endif + +// Allowed commands +#ifndef TRACED_LIB +#define TRACED_LIB [ "execVM", "JIPexec", "JIPrequest", "say", "playmove", "switchmove", "titleText" ] +// uncomment following line to log all incoming allowed RE +#define RESEC_VERBOSE +#endif + +// Special logic for execVM, only these whitelisted scripts will be spawned +#ifndef WHITELISTED_EXECVM +#define WHITELISTED_EXECVM [ ""ca\Modules\Functions\init.sqf"" ] +// uncomment and put in the array above if you want your server be able to kick players (not used in DayZ for now) +//""ca\Modules\MP\data\scriptCommands\endMission.sqf"" +#endif + +#define Stringify(macro) #macro diff --git a/SQF/dayz_code/system/animal_agent.fsm b/SQF/dayz_code/system/animal_agent.fsm index 8165a5b48..a2ee5037a 100644 --- a/SQF/dayz_code/system/animal_agent.fsm +++ b/SQF/dayz_code/system/animal_agent.fsm @@ -6,12 +6,14 @@ item1[] = {"wait",2,250,-25.000000,300.000000,75.000000,350.000000,0.000000,"wai item2[] = {"End",1,250,100.000000,225.000000,200.000000,275.000000,0.000000,"End"}; item3[] = {"Not_Alive",4,218,-150.000000,300.000000,-50.000000,350.000000,4.000000,"Not" \n "Alive"}; item4[] = {"Loiter",2,250,-150.000000,225.000000,-50.000000,275.000000,0.000000,"Loiter"}; -item5[] = {"In_Position",4,4314,-250.000000,275.000000,-150.000000,325.000000,2.000000,"In Position"}; +item5[] = {"In_Position",4,218,-350.000000,225.000000,-250.000000,275.000000,2.000000,"In Position"}; item6[] = {"preloaded",4,218,-150.000000,150.000000,-50.000000,200.000000,0.000000,"preloaded"}; item7[] = {"time_up",4,218,-25.000000,225.000000,75.000000,275.000000,0.000000,"time" \n "up"}; item8[] = {"player_check",4,218,-250.000000,175.000000,-150.000000,225.000000,1.000000,"player" \n "check"}; item9[] = {"player_check",4,218,100.000000,300.000000,200.000000,350.000000,1.000000,"player" \n "check"}; item10[] = {"tamed",4,218,-25.000000,150.000000,75.000000,200.000000,3.000000,"tamed"}; +item11[] = {"moveToCompleted",4,218,-250.000000,275.000000,-150.000000,325.000000,0.000000,"moveToCompleted "}; +item12[] = {"Failed_to_move",4,4314,-300.000000,250.000000,-200.000000,300.000000,0.000000,"Failed to move"}; link0[] = {0,6}; link1[] = {1,7}; link2[] = {1,9}; @@ -21,14 +23,18 @@ link5[] = {4,5}; link6[] = {4,7}; link7[] = {4,8}; link8[] = {4,10}; -link9[] = {5,4}; -link10[] = {6,4}; -link11[] = {7,2}; -link12[] = {8,4}; -link13[] = {9,1}; -link14[] = {10,2}; -globals[] = {25.000000,1,0,0,0,640,480,1,89,6316128,1,-299.424194,296.746490,405.380127,-436.653168,303,855,1}; -window[] = {0,-1,-1,-1,-1,1157,156,1364,156,1,321}; +link9[] = {4,11}; +link10[] = {4,12}; +link11[] = {5,4}; +link12[] = {6,4}; +link13[] = {7,2}; +link14[] = {8,4}; +link15[] = {9,1}; +link16[] = {10,2}; +link17[] = {11,4}; +link18[] = {12,4}; +globals[] = {25.000000,1,0,0,0,640,480,1,91,6316128,1,-478.843109,117.327553,583.704590,115.127663,813,1030,1}; +window[] = {2,-1,-1,-1,-1,806,26,1234,26,3,831}; *//*%FSM*/ class FSM { @@ -43,7 +49,7 @@ class FSM "_agent = _this select 1;" \n "" \n "_isSomeone = true;" \n - "_timeA = time;" \n + "_timeA = diag_tickTime;" \n "_isTamed = false;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links @@ -65,7 +71,7 @@ class FSM class wait { name = "wait"; - init = /*%FSM*/"_entityTime = time;"/*%FSM*/; + init = /*%FSM*/"_entityTime = diag_tickTime;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { @@ -75,14 +81,14 @@ class FSM priority = 1.000000; to="wait"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(time - _entityTime) > 30"/*%FSM*/; - action=/*%FSM*/"_entityTime = time;" \n + condition=/*%FSM*/"(diag_tickTime - _entityTime) > 30"/*%FSM*/; + action=/*%FSM*/"_entityTime = diag_tickTime;" \n "" \n "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n "_isSomeone = ({isPlayer _x} count _list) > 0;" \n "" \n "if (_isSomeone) then {" \n - " _timeA = time;" \n + " _timeA = diag_tickTime;" \n "};"/*%FSM*/; }; /*%FSM*/ @@ -92,7 +98,7 @@ class FSM priority = 0.000000; to="End"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(time - _timeA) > 120 && !_isSomeone"/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _timeA) > 120 and !_isSomeone"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ @@ -123,7 +129,7 @@ class FSM init = /*%FSM*/"_isAlive = alive _agent;" \n "" \n "//_agent forceSpeed 2;" \n - "_entityTime = time;"/*%FSM*/; + "_entityTime = diag_tickTime;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { @@ -134,7 +140,7 @@ class FSM to="wait"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"!_isAlive"/*%FSM*/; - action=/*%FSM*/"_timeA = time;"/*%FSM*/; + action=/*%FSM*/"_timeA = diag_tickTime;"/*%FSM*/; }; /*%FSM*/ /*%FSM*/ @@ -154,7 +160,8 @@ class FSM to="Loiter"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_agent distance _pos < 3"/*%FSM*/; - action=/*%FSM*/"_pos = [_pos,10,90,4,0,5,0] call BIS_fnc_findSafePos;" \n + action=/*%FSM*/"//_pos = [_pos,10,90,4,0,5,0] call BIS_fnc_findSafePos;" \n + "_pos = [_pos,10,90,1] call fn_selectRandomLocation;" \n "_agent moveTo _pos;"/*%FSM*/; }; /*%FSM*/ @@ -164,24 +171,48 @@ class FSM priority = 1.000000; to="Loiter"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(time - _entityTime) > 30"/*%FSM*/; - action=/*%FSM*/"_entityTime = time;" \n + condition=/*%FSM*/"(diag_tickTime - _entityTime) > 30"/*%FSM*/; + action=/*%FSM*/"_entityTime = diag_tickTime;" \n "" \n "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n "_isSomeone = ({isPlayer _x} count _list) > 0;" \n "" \n "if (_isSomeone) then {" \n - " _timeA = time;" \n + " _timeA = diag_tickTime;" \n "};"/*%FSM*/; }; /*%FSM*/ + /*%FSM*/ + class moveToCompleted + { + priority = 0.000000; + to="Loiter"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"moveToCompleted _agent;" \n + ""/*%FSM*/; + action=/*%FSM*/"_pos = [_pos,10,90,1] call fn_selectRandomLocation;" \n + "_agent moveTo _pos;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Failed_to_move + { + priority = 0.000000; + to="Loiter"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"moveToFailed _agent;"/*%FSM*/; + action=/*%FSM*/"_pos = [_pos,10,90,1] call fn_selectRandomLocation;" \n + "_agent moveTo _pos;" \n + ""/*%FSM*/; + }; + /*%FSM*/ /*%FSM*/ class time_up { priority = 0.000000; to="End"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(time - _timeA) > 120 && !_isSomeone"/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _timeA) > 120 and !_isSomeone"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ diff --git a/SQF/dayz_code/system/fire_monitor.sqf b/SQF/dayz_code/system/fire_monitor.sqf index 981485792..1ee5ded44 100644 --- a/SQF/dayz_code/system/fire_monitor.sqf +++ b/SQF/dayz_code/system/fire_monitor.sqf @@ -1,23 +1,37 @@ private["_firePlace","_ok","_mags","_serial","_qty","_countr"]; _firePlace = _this; + while {alive _firePlace} do { - while {inflamed _firePlace && alive _fireplace} do { + while {inflamed _firePlace and alive _fireplace} do { //Use Wood _ok = false; _mags = getMagazineCargo _firePlace; clearMagazineCargoGlobal _firePlace; - clearWeaponCargoGlobal _firePlace; - _serial = (_mags select 0) find "PartWoodPile"; + + _fuel = ["PartWoodPile","ItemLog","ItemPlank"]; + _serial = -1; + { + private ["_find"]; + + _find = ((_mags select 0) find _x); + + if (_find >= 0) exitwith { _serial = _find; }; + + } count _fuel; + _qty = 0; + _classname = ""; if (_serial >= 0) then { + _classname = (_mags select 0) select _serial; _qty = (_mags select 1) select _serial; }; + _ok = false; if (_qty > 0) then { _qty = _qty - 1; _ok = true; if (_qty > 0) then { - _firePlace addMagazineCargoGlobal ["PartWoodPile",_qty]; + _firePlace addMagazineCargoGlobal [_classname,_qty]; }; }; if (_ok) then { @@ -33,7 +47,7 @@ while {alive _firePlace} do { _firePlace inflame false; }; }; - while {!inflamed _firePlace && alive _fireplace} do { + while {!inflamed _firePlace and alive _fireplace} do { //Wait uiSleep 1; }; diff --git a/SQF/dayz_code/system/fn_swarmagent.fsm b/SQF/dayz_code/system/fn_swarmagent.fsm new file mode 100644 index 000000000..71ffd6224 --- /dev/null +++ b/SQF/dayz_code/system/fn_swarmagent.fsm @@ -0,0 +1,362 @@ +/*%FSM*/ +/*%FSM*/ +/* +item0[] = {"init",0,250,-150.000000,-250.000000,-50.000000,-200.000000,0.000000,"init"}; +item1[] = {"End",1,250,175.000000,-250.000000,275.000000,-200.000000,0.000000,"End"}; +item2[] = {"Attack",4,218,-150.000000,425.000000,-50.000000,475.000000,0.000000,"Attack"}; +item3[] = {"Not_Alive",4,218,50.000000,300.000000,150.000000,350.000000,5.000000,"Not" \n "Alive"}; +item4[] = {"Nobody_Near",4,218,50.000000,350.000000,150.000000,400.000000,4.000000,"Nobody" \n "Near"}; +item5[] = {"",7,210,-29.000042,321.000000,-20.999958,329.000000,0.000000,""}; +item6[] = {"",7,210,-29.000042,370.999939,-20.999958,379.000061,0.000000,""}; +item7[] = {"true",8,218,-150.000000,-175.000000,-50.000000,-125.000000,0.000000,"true"}; +item8[] = {"Begin",2,250,-150.000000,-100.000000,-50.000000,-50.000000,0.000000,"Begin"}; +item9[] = {"Has_Target",4,218,-150.000000,125.000000,-50.000000,175.000000,1.000000,"Has" \n "Target"}; +item10[] = {"Chase",2,250,-150.000000,300.000000,-50.000000,350.000000,0.000000,"Chase"}; +item11[] = {"",7,210,221.000000,371.000000,229.000000,379.000000,0.000000,""}; +item12[] = {"moveToCompleted",4,218,-25.000000,200.000000,75.000000,250.000000,0.000000,"moveToCompleted"}; +item13[] = {"",7,210,221.000000,233.500000,229.000000,241.500000,0.000000,""}; +item14[] = {"",7,210,221.000000,321.000000,229.000000,329.000000,0.000000,""}; +item15[] = {"is_Dedicated",4,218,50.000000,-250.000000,150.000000,-200.000000,5.000000,"is" \n "Dedicated"}; +item16[] = {"Cleanup_",2,250,175.000000,150.000000,275.000000,200.000000,0.000000,"Cleanup?"}; +item17[] = {"nobody_around",4,218,175.000000,-75.000000,275.000000,-25.000000,0.000000,"nobody" \n "around"}; +item18[] = {"someone_here",4,218,300.000000,150.000000,400.000000,200.000000,0.000000,"someone" \n "here"}; +item19[] = {"wait",2,250,300.000000,75.000000,400.000000,125.000000,0.000000,"wait"}; +item20[] = {"time_up",4,218,300.000000,-75.000000,400.000000,-25.000000,0.000000,"time" \n "up"}; +item21[] = {"",7,210,346.000000,8.500000,354.000000,16.500000,0.000000,""}; +item22[] = {"",7,210,221.000000,8.500000,229.000000,16.500000,0.000000,""}; +item23[] = {"Time_Check",4,218,425.000000,75.000000,525.000000,125.000000,0.000000,"Time" \n "Check"}; +item24[] = {"",7,210,346.000000,-166.500000,354.000000,-158.500000,0.000000,""}; +item25[] = {"",7,210,221.000000,-166.500000,229.000000,-158.500000,0.000000,""}; +item26[] = {"deleted",4,218,425.000000,-75.000000,525.000000,-25.000000,0.000000,"deleted"}; +item27[] = {"",7,210,471.000000,-166.500000,479.000000,-158.500000,0.000000,""}; +item28[] = {"",7,210,471.000000,8.500000,479.000000,16.500000,0.000000,""}; +item29[] = {"Time_Check",4,4314,-275.000000,300.000000,-175.000000,350.000000,0.000000,"Time Check"}; +item30[] = {"____FAKE____",9,1200,0.000000,0.000000,0.000000,0.000000,0.000000,"____FAKE____"}; +link0[] = {0,7}; +link1[] = {0,15}; +link2[] = {2,10}; +link3[] = {3,14}; +link4[] = {4,11}; +link5[] = {5,3}; +link6[] = {5,6}; +link7[] = {6,4}; +link8[] = {7,8}; +link9[] = {8,9}; +link10[] = {9,10}; +link11[] = {10,2}; +link12[] = {10,5}; +link13[] = {10,29}; +link14[] = {11,14}; +link15[] = {13,16}; +link16[] = {14,13}; +link17[] = {15,1}; +link18[] = {16,18}; +link19[] = {16,22}; +link20[] = {17,25}; +link21[] = {18,19}; +link22[] = {19,21}; +link23[] = {19,23}; +link24[] = {20,24}; +link25[] = {21,20}; +link26[] = {21,22}; +link27[] = {21,28}; +link28[] = {22,17}; +link29[] = {23,19}; +link30[] = {24,25}; +link31[] = {25,1}; +link32[] = {26,27}; +link33[] = {27,24}; +link34[] = {28,26}; +link35[] = {29,10}; +link36[] = {12,30}; +link37[] = {30,12}; +globals[] = {25.000000,1,0,0,0,640,480,1,163,6316128,1,-438.144928,688.129517,520.129150,-284.928619,838,1030,1}; +window[] = {2,-1,-1,-1,-1,910,130,1338,130,3,856}; +*//*%FSM*/ +class FSM +{ + fsmName = "DayZ Zombie Combat Agent"; + class States + { + /*%FSM*/ + class init + { + name = "init"; + init = /*%FSM*/"_position = _this select 0;" \n + "_agent = _this select 1;" \n + "_target = _this select 2;" \n + "" \n + "" \n + "diag_log (""Agent Initialized: "" + str(_this));"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class is_Dedicated + { + priority = 5.000000; + to="End"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"isDedicated"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class true + { + priority = 0.000000; + to="Begin"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"dayz_clientPreload and !(isNull _agent)"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class End + { + name = "End"; + init = /*%FSM*/"if (!isDedicated) then {" \n + " if (!isNull _agent) then {" \n + " deleteVehicle _agent;" \n + " };" \n + "} else {" \n + " [_agent] call zombie_findOwner;" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + }; + }; + /*%FSM*/ + /*%FSM*/ + class Begin + { + name = "Begin"; + init = /*%FSM*/"_array = [];" \n + "" \n + "_bodyStay = 60;" \n + "" \n + "_timeN = time;" \n + "" \n + " _id = _agent addeventhandler [""HandleDamage"",{_this call local_zombieDamage}];" \n + "" \n + "//hint ""run local zombie"";" \n + "_isSomeone = true;" \n + "" \n + "_targetPos = [];" \n + "_countr = 0;" \n + "" \n + "//Spawn roaming script (individual to unit)" \n + "_entityTime = time;" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Has_Target + { + priority = 1.000000; + to="Chase"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!(isNull _target)"/*%FSM*/; + action=/*%FSM*/"_countr = 0;" \n + "_losCheck = 0;" \n + "_cantSee = false;" \n + "_agent forceSpeed 6;" \n + "_targetPos = getPosATL _target;"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Chase + { + name = "Chase"; + init = /*%FSM*/"_timeN = diag_tickTime;" \n + "_timeP = diag_tickTime;" \n + "" \n + "_isAlive = alive _agent;" \n + "_targetPos = getPosATL _target;" \n + "_agent moveTo _targetPos;" \n + "" \n + "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],dayz_canDelete];" \n + "_isSomeone = ({isPlayer _x} count _list) > 0;" \n + "" \n + "if (_agent distance _target > 10) then {" \n + " _agent setUnitPos ""middle"";" \n + "};" \n + "" \n + " "/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Not_Alive + { + priority = 5.000000; + to="Cleanup_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isAlive"/*%FSM*/; + action=/*%FSM*/"diag_log (""Not Alive"");" \n + "dayz_swarmSpawnZombies = dayz_swarmSpawnZombies - 1;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Nobody_Near + { + priority = 4.000000; + to="Cleanup_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isSomeone"/*%FSM*/; + action=/*%FSM*/"dayz_swarmSpawnZombies = dayz_swarmSpawnZombies - 1;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Time_Check + { + priority = 0.000000; + to="Chase"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _timeP) > 3"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Attack + { + priority = 0.000000; + to="Chase"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_agent distance _target < 3 AND (diag_tickTime - _timeN) > 1"/*%FSM*/; + action=/*%FSM*/"_vehicle = (vehicle player);" \n + "_hpList = _vehicle call vehicle_getHitpoints;" \n + "_hp = _hpList call BIS_fnc_selectRandom;" \n + "_wound = getText(configFile >> ""cfgVehicles"" >> (typeOf _vehicle) >> ""HitPoints"" >> _hp >> ""name"");" \n + "" \n + "[_agent, _wound] spawn player_zombieSwarmAttack;"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Cleanup_ + { + name = "Cleanup_"; + init = /*%FSM*/"_waitStart = time;" \n + "" \n + "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],dayz_canDelete];" \n + "_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class nobody_around + { + priority = 0.000000; + to="End"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isSomeone"/*%FSM*/; + action=/*%FSM*/"dayz_spawnZombies = dayz_spawnZombies - 1;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class someone_here + { + priority = 0.000000; + to="wait"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_isSomeone"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class wait + { + name = "wait"; + init = /*%FSM*/"_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],dayz_canDelete];" \n + "_isSomeone = ({isPlayer _x} count _list) > 0;" \n + "" \n + "_timeN = time;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class time_up + { + priority = 0.000000; + to="End"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(time - _waitStart) > 300"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class nobody_around + { + priority = 0.000000; + to="End"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isSomeone"/*%FSM*/; + action=/*%FSM*/"dayz_spawnZombies = dayz_spawnZombies - 1;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class deleted + { + priority = 0.000000; + to="End"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"isNull _agent;"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Time_Check + { + priority = 0.000000; + to="wait"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(time - _timeN) > 30"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class ____FAKE____ + { + name = "____FAKE____"; + init = /*%FSM*/""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class moveToCompleted + { + priority = 0.000000; + to="____FAKE____"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"moveToCompleted _agent;"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + }; + initState="init"; + finalStates[] = + { + "End" + }; +}; +/*%FSM*/ \ No newline at end of file diff --git a/SQF/dayz_code/system/handleGear.sqf b/SQF/dayz_code/system/handleGear.sqf index c0d20c94c..1b8adf2b0 100644 --- a/SQF/dayz_code/system/handleGear.sqf +++ b/SQF/dayz_code/system/handleGear.sqf @@ -1,3 +1,7 @@ +/* + written by Bohemia Interactive + modified with permission by DayZ Mod Team +*/ disableSerialization; private ["_control","_display","_temp","_event","_data","_x","_stopTheKey","_keyLeft","_i","_index","_size","_indices","_lbcontrol"]; private ["_key","_keyRight","_keyTop","_keyBottom","_secondColumn","_activateControl","_output","_doFilter"]; @@ -10,14 +14,16 @@ private ["_event","_data","_display","_control","_primaryWeaponControl","_IDCsAr IGUI_GEAR_filterInventory = (_activeFilter select 4); IGUI_GEAR_filterPistols = (_activeFilter select 5); IGUI_GEAR_filterPistolAmmo = (_activeFilter select 6); */ - + +_doFilter = false; + _filterSets = [ - //Primary Weapon, Secondary weapon, Ammo, Binocular, Inventory, Pistols, Pistols Ammo - [false,false,false,false,false,false,false], - [false,true,false,true,true,true,true], - [true,false,false,true,true,true,true], - [true,true,true,false,false,true,true], // all but pistol, pistols ammo - [true,true,true,true,true,true,true] + //Primary Weapon, Secondary weapon, Ammo, Binocular, Inventory, Pistols, Pistols Ammo + [false,false,false,false,false,false,false], + [false,true,false,true,true,true,true], + [true,false,false,true,true,true,true], + [true,true,true,false,false,true,true], // all but pistol, pistols ammo + [true,true,true,true,true,true,true] ]; _icons = [ @@ -30,122 +36,120 @@ _icons = [ _event = _this select 1; _data = _this select 0; - -_dofilter = false; +//diag_log [diag_ticktime, __FILE__, _this]; +_display = nil; /*-------------------------------------------*/ -if(typeName(_data select 0) == "DISPLAY")then -{ - _display = (_data select 0); +if (typeName(_data select 0) == "DISPLAY") then { + _display = (_data select 0); }; -if(typeName(_data select 0) == "CONTROL")then -{ - _control = (_data select 0); - _display = ctrlParent _control; +if (typeName(_data select 0) == "CONTROL") then { + _control = (_data select 0); + _display = ctrlParent _control; }; - /*-------------------------------------------*/ _lbSelectedItem = { - private ["_index","_selectedItem","_n"]; - _lbcontrol = _display displayctrl _lbIDC; - _index = lbCurSel _lbcontrol; - _selectedItem = ""; - _n = 0; - - while {(_selectedItem == "")&&(_n<6)} do { - _selectedItem = _lbcontrol lnbData [_index,1]; - uisleep 0.001; - _n = _n + 1; - }; + private ["_index","_selectedItem","_n"]; + _lbcontrol = _display displayctrl _lbIDC; + _index = lbCurSel _lbcontrol; + _selectedItem = ""; + _n = 0; - _selectedItem; + while {(_selectedItem == "")&&(_n<6)} do { + _selectedItem = _lbcontrol lnbData [_index,1]; + uisleep 0.001; + _n = _n + 1; + }; + + _selectedItem }; _arrowsEnable = { - private ["_index","_selectedItem"]; - - _lbcontrol = _display displayctrl _lbIDC; - - _controlLeftArrow = _display displayctrl 147; - _controlRightArrow = _display displayctrl 146; - _index = lbCurSel _lbcontrol; - _selectedItemCountLeft = _lbcontrol lnbText [_index,0]; - _selectedItemCountRight = _lbcontrol lnbText [_index,2]; + private ["_index","_selectedItemCountLeft"]; + + _lbcontrol = _display displayctrl _lbIDC; + + _controlLeftArrow = _display displayctrl 147; + _controlRightArrow = _display displayctrl 146; + _index = lbCurSel _lbcontrol; + _selectedItemCountLeft = _lbcontrol lnbText [_index,0]; + _selectedItemCountRight = _lbcontrol lnbText [_index,2]; }; _isWeapon = { - private ["_item","_return"]; - _item = _this select 0; - _return = (str(configfile >> "cfgWeapons" >> _item) != ""); - _return; + private ["_item","_return"]; + _item = _this select 0; + _return = (str(configfile >> "cfgWeapons" >> _item) != ""); + _return }; _isMagazine = { - private ["_item","_return"]; - _item = _this select 0; - _return = (str(configfile >> "cfgMagazines" >> _item) != ""); - _return; + private ["_item","_return"]; + _item = _this select 0; + _return = (str(configfile >> "cfgMagazines" >> _item) != ""); + _return }; _IDCsArray = [ - [107], - [121], - [108], - [107], - [122,123,124,125,126,127,128,129], - [107], - [107], - [107], - [109,110,111,112,113,114,115,116,117,118,119,120], - [109,110,111,112,113,114,115,116,117,118,119,120], - [108], - [107], - [130,131], - [107], - [107], - [107], - [107], - [134,135,136,137,138,139,140,141,142,143,144,145], - [107], - [107], - [107], - [107] + [107], + [121], + [108], + [107], + [122,123,124,125,126,127,128,129], + [107], + [107], + [107], + [109,110,111,112,113,114,115,116,117,118,119,120], + [109,110,111,112,113,114,115,116,117,118,119,120], + [108], + [107], + [130,131], + [107], + [107], + [107], + [107], + [134,135,136,137,138,139,140,141,142,143,144,145], + [107], + [107], + [107], + [107] ]; +/* _showAllIDCs = { + private ["_slotArray","_j","_i"]; + for [{_i=0},{_i-1 ) then { - _itemSlot = _display displayctrl (_slotArray select _j); - _itemSlot ctrlSetFade 0.0; - _itemSlot ctrlCommit 0.3; - - } else { - _itemSlot = _display displayctrl (_slotArray select _j); - _itemSlot ctrlSetFade 0.5; - _itemSlot ctrlCommit 0.3; - }; - }; + for [{_j=0},{_j-1 ) then { + _itemSlot = _display displayctrl (_slotArray select _j); + //_itemSlot ctrlSetFade 0.0; + //_itemSlot ctrlCommit 0.3; + } else { + _itemSlot = _display displayctrl (_slotArray select _j); + //_itemSlot ctrlSetFade 0.5; + //_itemSlot ctrlCommit 0.3; + }; + }; }; @@ -157,22 +161,24 @@ _higlightIDCs = { }; */ }; _returnSlotIDCs = { - _flags = (_this select 0); - _outputArray = []; - _sum = 0; - for [{_i=0},{_i> "cfgWeapons" >> _item >> "type"); - }; - if ([_item] call _isMagazine) then { - _return = getNumber(configfile >> "cfgMagazines" >> _item >> "type"); - }; -_return; + private ["_item", "_return"]; + _item = _this select 0; + _return = 0; + + if ([_item] call _isWeapon) then { + _return = getNumber(configfile >> "cfgWeapons" >> _item >> "type"); + }; + + if ([_item] call _isMagazine) then { + _return = getNumber(configfile >> "cfgMagazines" >> _item >> "type"); + }; + + _return }; _highlightIDCs = { _hlIDCs = _this select 0; - for [{_i=0},{_i=0}, {_i = _i - 1} ] do -{ + _val = _this select 0; + _bitArray = [0,0,0,0,0 ,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; + _n = 524288; - _valResult = _val mod _n; - if (_valResult != _val) then { - _bitArray set [_i, 1]; - }; - _n = _n / 2; - _val = _valResult; - }; - _bitArray + for [{_i=19},{_i>=0}, {_i = _i - 1} ] do + { + _valResult = _val mod _n; + + if (_valResult != _val) then { + _bitArray set [_i, 1]; + }; + + _n = _n / 2; + _val = _valResult; + }; + + _bitArray }; _highlightGearSlots ={ -// [] call _showAllIDCs; - _selectedItem = [] call _lbSelectedItem; - _selectedItemSlot = [_selectedItem] call _itemSlot; - _selectedItemSlotFlags = [_selectedItemSlot] call _returnBitArray; - _selectedItemSlotIDCs = [_selectedItemSlotFlags] call _returnSlotIDCs; - [_selectedItemSlotIDCs] call _higlightIDCs; + //[] call _showAllIDCs; + _selectedItem = [] call _lbSelectedItem; + _selectedItemSlot = [_selectedItem] call _itemSlot; + _selectedItemSlotFlags = [_selectedItemSlot] call _returnBitArray; + _selectedItemSlotIDCs = [_selectedItemSlotFlags] call _returnSlotIDCs; + [_selectedItemSlotIDCs] call _higlightIDCs; }; +/* _weaponsLBSetFocus = { _lbcontrol = _display displayctrl _lbIDC; /** Temporary disabled to prevent bug news:hov5k4$f6f$1@new-server.localdomain **/ //ctrlSetFocus _lbcontrol; -}; +}; */ _setFilterIcon = { - _ctrlIcon = _display displayctrl 148; - _ctrlIcon ctrlSetText (_icons select IGUI_GEAR_activeFilter); + _ctrlIcon = _display displayctrl 148; + _ctrlIcon ctrlSetText (_icons select IGUI_GEAR_activeFilter); }; _keyActions = { - _keyLeft = [203,327700,327686]; - _keyRight = [205,327696,327687]; - _keyTop = [200,327697,327684]; - _keyBottom = [208,327701,327685]; - _key = _data select 1; - if((_keyLeft find _key)>=0)then { - _control = _display displayctrl 146; - ctrlActivate _control; - _output = true; - }; - if((_keyRight find _key)>=0)then { - _control = _display displayctrl 147; - ctrlActivate _control; - _output = true; - }; - if((_keyTop find _key)>=0)then { - - }; - if((_keyBottom find _key)>=0)then { - - }; + _keyLeft = [203,327700,327686]; + _keyRight = [205,327696,327687]; + _keyTop = [200,327697,327684]; + _keyBottom = [208,327701,327685]; + _key = _data select 1; + + if ((_keyLeft find _key)>=0) then { + _control = _display displayctrl 146; + ctrlActivate _control; + _output = true; + }; + + if ((_keyRight find _key)>=0) then { + _control = _display displayctrl 147; + ctrlActivate _control; + _output = true; + }; +/* + if((_keyTop find _key)>=0)then { + + }; + + if((_keyBottom find _key)>=0)then { + + };*/ }; //_bitArray = [0,0,0,0,0 ,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; /* @@ -284,168 +302,184 @@ _keyActions = { */ _setFilterGlobals = { - _activeFilter = _this; - IGUI_GEAR_filterPrimaryWeapon = (_activeFilter select 0); - IGUI_GEAR_filterSecondaryWeapon = (_activeFilter select 1); - IGUI_GEAR_filterAmmo = (_activeFilter select 2); - IGUI_GEAR_filterBinocular = (_activeFilter select 3); - IGUI_GEAR_filterInventory = (_activeFilter select 4); - IGUI_GEAR_filterPistols = (_activeFilter select 5); - IGUI_GEAR_filterPistolAmmo = (_activeFilter select 6); + _activeFilter = _this; + IGUI_GEAR_filterPrimaryWeapon = (_activeFilter select 0); + IGUI_GEAR_filterSecondaryWeapon = (_activeFilter select 1); + IGUI_GEAR_filterAmmo = (_activeFilter select 2); + IGUI_GEAR_filterBinocular = (_activeFilter select 3); + IGUI_GEAR_filterInventory = (_activeFilter select 4); + IGUI_GEAR_filterPistols = (_activeFilter select 5); + IGUI_GEAR_filterPistolAmmo = (_activeFilter select 6); }; //1201 _highlightFilterIcons = { - for [{_i=0},{_i<6}, {_i = _i + 1} ] do - { - _control = _display displayctrl (1200 + _i); - _control ctrlSetTextColor [0.6000,0.8392,0.4706,1.0]; - }; - _control = _display displayctrl (1200 + _this); - _control ctrlSetTextColor [1,1,1,1]; + for [{_i=0},{_i<6}, {_i = _i + 1} ] do { + _control = _display displayctrl (1200 + _i); + _control ctrlSetTextColor [0.6000,0.8392,0.4706,1.0]; + }; + + _control = _display displayctrl (1200 + _this); + _control ctrlSetTextColor [1,1,1,1]; }; + _matchesFilter = { - private ["_itemValue","_itemBitArray"]; - _output = false; - - _itemValue = _this select 0; - _itemBitArray = [_itemValue] call _returnBitArray; - - - if (_itemValue == 1 && IGUI_GEAR_filterPrimaryWeapon) then { - _output = true; - }; - - if (_itemValue == 5 && IGUI_GEAR_filterPrimaryWeapon) then { - _output = true; - - }; - - if (_itemValue == 4 && IGUI_GEAR_filterSecondaryWeapon) then { - _output = true; - }; - - if (_itemValue == 2 && IGUI_GEAR_filterPistols) then { - _output = true; - }; - if (_itemValue == 16 && IGUI_GEAR_filterPistolAmmo) then { - _output = true; - }; - - if (_itemValue == 131072 && IGUI_GEAR_filterInventory) then { - _output = true; - }; - - if (_itemValue == 512 && IGUI_GEAR_filterAmmo) then { - _output = true; - }; - if (_itemValue == 256 && IGUI_GEAR_filterAmmo) then { - _output = true; - }; - - if (_itemValue == 4096 && IGUI_GEAR_filterBinocular) then { - _output = true; - }; - _output; + private ["_itemValue","_itemBitArray"]; + _output = false; + + _itemValue = _this select 0; + _itemBitArray = [_itemValue] call _returnBitArray; + + if (_itemValue == 1 && IGUI_GEAR_filterPrimaryWeapon) then { + _output = true; + }; + + if (_itemValue == 5 && IGUI_GEAR_filterPrimaryWeapon) then { + _output = true; + }; + + if (_itemValue == 4 && IGUI_GEAR_filterSecondaryWeapon) then { + _output = true; + }; + + if (_itemValue == 2 && IGUI_GEAR_filterPistols) then { + _output = true; + }; + + if (_itemValue == 16 && IGUI_GEAR_filterPistolAmmo) then { + _output = true; + }; + + if (_itemValue == 131072 && IGUI_GEAR_filterInventory) then { + _output = true; + }; + + if (_itemValue == 512 && IGUI_GEAR_filterAmmo) then { + _output = true; + }; + + if (_itemValue == 256 && IGUI_GEAR_filterAmmo) then { + _output = true; + }; + + if (_itemValue == 4096 && IGUI_GEAR_filterBinocular) then { + _output = true; + }; + + _output }; _filterItems = { - private ["_n","_itemType"]; - _deleteIndexes = []; - _lbcontrol = _display displayctrl _lbIDC; - _n = (lnbSize _lbcontrol) select 0; - _j = 0; - for [{_i=_n},{_i>=0}, {_i = _i - 1} ] do - { - _item = _lbcontrol lnbData [_i,1]; - _itemType = [_item] call _itemSlot; - - if ([_itemType] call _matchesFilter) then { - _j = _j + 1; - _deleteIndexes set [(_j-1), _i]; - }; - }; - LB_CTRL = _lbcontrol; - { - _lbcontrol lnbDeleteRow _x; - } count _deleteIndexes; + private ["_n","_itemType"]; + _deleteIndexes = []; + _lbcontrol = _display displayctrl _lbIDC; + _n = (lnbSize _lbcontrol) select 0; + _j = 0; + + for [{_i=_n},{_i>=0}, {_i = _i - 1} ] do { + _item = _lbcontrol lnbData [_i,1]; + _itemType = [_item] call _itemSlot; + + if ([_itemType] call _matchesFilter) then { + _j = _j + 1; + _deleteIndexes set [(_j-1), _i]; + }; + }; + + LB_CTRL = _lbcontrol; + + { + _lbcontrol lnbDeleteRow _x; + } count _deleteIndexes; }; _itemPicture = { - private ["_item"]; - _item = _this select 0; - - _return = ""; - - if ([_item] call _isWeapon) then { - _return = getText(configfile >> "cfgWeapons" >> _item >> "picture"); - }; - if ([_item] call _isMagazine) then { - _return = getText(configfile >> "cfgMagazines" >> _item >> "picture"); - }; - _return; + private ["_item"]; + _item = _this select 0; + _return = ""; + + if ([_item] call _isWeapon) then { + _return = getText(configfile >> "cfgWeapons" >> _item >> "picture"); + }; + + if ([_item] call _isMagazine) then { + _return = getText(configfile >> "cfgMagazines" >> _item >> "picture"); + }; + + _return }; _itemDescription = { - private ["_inputItem","_return"]; - _inputItem = _this select 0; - _return = ""; - if ([_inputItem] call _isWeapon) then { - _name = getText(configfile >> "cfgWeapons" >> _inputItem >> "descriptionShort"); - _return = (_name); - }; - - if ([_inputItem] call _isMagazine) then { - _name = getText(configfile >> "cfgMagazines" >> _inputItem >> "descriptionShort"); - _return = (_name); - }; - _return; + private ["_inputItem","_return"]; + _inputItem = _this select 0; + _return = ""; + + if ([_inputItem] call _isWeapon) then { + _name = getText(configfile >> "cfgWeapons" >> _inputItem >> "descriptionShort"); + _return = (_name); + }; + + if ([_inputItem] call _isMagazine) then { + _name = getText(configfile >> "cfgMagazines" >> _inputItem >> "descriptionShort"); + _return = (_name); + }; + + _return }; _itemName = { - private ["_item"]; - _item = _this select 0; - - _return = ""; - - if ([_item] call _isWeapon) then { - _name = getText(configfile >> "cfgWeapons" >> _item >> "displayName"); - _return = ( _name); - }; - - if ([_item] call _isMagazine) then { - _name = getText(configfile >> "cfgMagazines" >> _item >> "displayName"); - _return = ( _name); - }; - - _return; + private ["_item"]; + _item = _this select 0; + _return = ""; + + if ([_item] call _isWeapon) then { + _name = getText(configfile >> "cfgWeapons" >> _item >> "displayName"); + _return = ( _name); + }; + + if ([_item] call _isMagazine) then { + _name = getText(configfile >> "cfgMagazines" >> _item >> "displayName"); + _return = ( _name); + }; + + _return }; + _displayItemIcon = { - private ["_selectedItem","_itemPicturePath"]; - _selectedItem = [] call _lbSelectedItem; - _itemPicturePath = [_selectedItem] call _itemPicture; - _pictureControl = _display displayctrl 1104; - _pictureControl ctrlSetText _itemPicturePath; + private ["_selectedItem","_itemPicturePath"]; + _selectedItem = [] call _lbSelectedItem; + _itemPicturePath = [_selectedItem] call _itemPicture; + _pictureControl = _display displayctrl 1104; + _pictureControl ctrlSetText _itemPicturePath; }; _displayItemDescription = { - private ["_descriptionControl","_selectedItemDescription","_selectedItemN"]; - _selectedItemN = [] call _lbSelectedItem; - _selectedItemDescription = [_selectedItemN] call _itemDescription; - _descriptionControl = _display displayctrl 1106; - - _descriptionControl ctrlSetStructuredText parseText(_selectedItemDescription); + private ["_descriptionControl","_selectedItemDescription","_selectedItemN"]; + _selectedItemN = [] call _lbSelectedItem; + _selectedItemDescription = [_selectedItemN] call _itemDescription; + _descriptionControl = _display displayctrl 1106; + _descriptionControl ctrlSetStructuredText parseText(_selectedItemDescription); }; _displayItemName = { - private ["_nameControl","_itemDescription"]; - _selectedItem = [] call _lbSelectedItem; - _itemName = [_selectedItem] call _itemName; - _nameControl = _display displayctrl 1101; - _nameControl ctrlSetText _itemName; + private ["_nameControl","_itemDescription"]; + _selectedItem = [] call _lbSelectedItem; + _itemName = [_selectedItem] call _itemName; + _nameControl = _display displayctrl 1101; + _nameControl ctrlSetText _itemName; }; +_updateOnBack = { + private ["_onBackCtrl"]; + _onBackCtrl = _display displayCtrl 1209; + + if (dayz_onBack != "") then { + _onBackCtrl ctrlSetText ([dayz_onBack] call _itemPicture); + } else { + _onBackCtrl ctrlSetText ""; + }; +}; _output = true; _lbIDC = 105; @@ -453,48 +487,54 @@ _lbIDC = 105; switch _event do { case "initDialog": { - [] call _showAllIDCs; + //[] call _showAllIDCs; }; case "onLoad": { - [] call _weaponsLBSetFocus; + //[] call _weaponsLBSetFocus; [] call _arrowsEnable; [] call _displayItemIcon; [] call _displayItemName; [] call _displayItemDescription; - [] call _showAllIDCs; + //[] call _showAllIDCs; //[] call _arrowsEnable; //[] call _highlightGearSlots; }; //used for buyUnits - case "filter": { - IGUI_GEAR_activeFilter = IGUI_GEAR_activeFilter + 1; - if (IGUI_GEAR_activeFilter > ((count _filterSets)-1 )) then { - IGUI_GEAR_activeFilter = 0; - }; - _doFilter = true; - }; - + case "filter": { + IGUI_GEAR_activeFilter = IGUI_GEAR_activeFilter + 1; + + if (IGUI_GEAR_activeFilter > ((count _filterSets)-1 )) then { + IGUI_GEAR_activeFilter = 0; + }; + + _doFilter = true; + }; + //changing IGUI_GEAR_activeFilter, but not filter picture (used for buyGear) - case "filterNotSet": { - IGUI_GEAR_activeFilter = IGUI_GEAR_activeFilter + 1; - if (IGUI_GEAR_activeFilter > ((count _filterSets)-1 )) then { - IGUI_GEAR_activeFilter = 0; - }; - //_doFilter = true; - }; + case "filterNotSet": { + IGUI_GEAR_activeFilter = IGUI_GEAR_activeFilter + 1; + + if (IGUI_GEAR_activeFilter > ((count _filterSets)-1 )) then { + IGUI_GEAR_activeFilter = 0; + }; + + //_doFilter = true; + }; - case "filter_left": { - IGUI_GEAR_activeFilter = IGUI_GEAR_activeFilter - 1; - if (IGUI_GEAR_activeFilter < 0) then { - IGUI_GEAR_activeFilter = ((count _filterSets)-1 ); - }; - _doFilter = true; - }; + case "filter_left": { + IGUI_GEAR_activeFilter = IGUI_GEAR_activeFilter - 1; + + if (IGUI_GEAR_activeFilter < 0) then { + IGUI_GEAR_activeFilter = ((count _filterSets)-1 ); + }; + + _doFilter = true; + }; case "onFocus": { - [] call _weaponsLBSetFocus; + //[] call _weaponsLBSetFocus; //[] call _arrowsEnable; }; @@ -509,11 +549,9 @@ switch _event do { [] call _highlightGearSlots; }; case "onKillFocus": { - [] call _weaponsLBSetFocus; - }; - default { - + //[] call _weaponsLBSetFocus; }; + default {}; }; /* Filter removed, moving to engine */ @@ -524,5 +562,4 @@ if _doFilter then { }; -_output; -false; \ No newline at end of file +_output; \ No newline at end of file diff --git a/SQF/dayz_code/system/player_monitor.fsm b/SQF/dayz_code/system/player_monitor.fsm index 82f9ae158..467454f4c 100644 --- a/SQF/dayz_code/system/player_monitor.fsm +++ b/SQF/dayz_code/system/player_monitor.fsm @@ -1,176 +1,250 @@ /*%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[] = {"Has_PlayerID",4,218,-75.000000,175.000000,25.000000,225.000000,1.000000,"Has PlayerID"}; -item11[] = {"no_PlayerID",4,218,50.000000,150.000000,150.000000,200.000000,2.000000,"no PlayerID"}; -item12[] = {"ERROR__No_Player",2,250,175.000000,150.000000,275.000000,200.000000,0.000000,"ERROR:" \n "No PlayerID"}; -item13[] = {"Request",2,250,-75.000000,400.000000,25.000000,450.000000,0.000000,"Request"}; -item14[] = {"Response",4,218,-175.000000,450.000000,-75.000000,500.000000,0.000000,"Response"}; -item15[] = {"Parse_Login",2,250,-75.000000,500.000000,25.000000,550.000000,0.000000,"Parse Login"}; -item16[] = {"Hive_Bad",4,218,50.000000,500.000000,150.000000,550.000000,10.000000,"Hive" \n "Bad"}; -item17[] = {"ERROR__Wrong_HIVE",2,250,175.000000,500.000000,275.000000,550.000000,0.000000,"ERROR:" \n "Wrong HIVE" \n "Version"}; -item18[] = {"Hive_Ok",4,218,-175.000000,550.000000,-75.000000,600.000000,0.000000,"Hive" \n "Ok"}; -item19[] = {"Phase_One",2,250,-75.000000,600.000000,25.000000,650.000000,0.000000,"Phase One"}; -item20[] = {"Response",4,218,-175.000000,650.000000,-75.000000,700.000000,0.000000,"Response"}; -item21[] = {"Phase_Two",2,250,-75.000000,700.000000,25.000000,750.000000,0.000000,"Phase Two"}; -item22[] = {"Dead_Player",4,218,50.000000,700.000000,150.000000,750.000000,0.000000,"Dead" \n "Player"}; -item23[] = {"ERROR__Player_Already",2,250,175.000000,700.000000,275.000000,750.000000,0.000000,"ERROR:" \n "Player Already" \n "Dead"}; -item24[] = {"Alive",4,218,-175.000000,750.000000,-75.000000,800.000000,0.000000,"Alive"}; -item25[] = {"Position",2,250,-75.000000,800.000000,25.000000,850.000000,0.000000,"Position"}; -item26[] = {"Version_Ok",4,218,-175.000000,850.000000,-75.000000,900.000000,0.000000,"Version" \n "Ok"}; -item27[] = {"Load_In",2,250,-75.000000,1000.000000,25.000000,1050.000000,0.000000,"Load In"}; -item28[] = {"Bad_Version",4,218,50.000000,800.000000,150.000000,850.000000,0.000000,"Bad" \n "Version"}; -item29[] = {"ERROR__Bad_Versi",2,250,175.000000,800.000000,275.000000,850.000000,0.000000,"ERROR:" \n "Bad Version"}; -item30[] = {"Display_Ready",4,218,-175.000000,1050.000000,-75.000000,1100.000000,0.000000,"Display" \n "Ready"}; -item31[] = {"Preload_Display",2,250,-75.000000,1100.000000,25.000000,1150.000000,0.000000,"Preload" \n "Display"}; -item32[] = {"Preload_Done",4,218,-175.000000,1150.000000,-75.000000,1200.000000,0.000000,"Preload" \n "Done"}; -item33[] = {"Initialize",2,250,-75.000000,1200.000000,25.000000,1250.000000,0.000000,"Initialize"}; -item34[] = {"Finish",1,250,-75.000000,1300.000000,25.000000,1350.000000,0.000000,"Finish"}; -item35[] = {"True",8,218,25.000000,1250.000000,125.000000,1300.000000,0.000000,"True"}; -item36[] = {"Too_Long",4,218,300.000000,150.000000,400.000000,200.000000,0.000000,"Too" \n "Long"}; -item37[] = {"Too_Long",4,218,300.000000,500.000000,400.000000,550.000000,0.000000,"Too" \n "Long"}; -item38[] = {"Too_Long",4,218,300.000000,700.000000,400.000000,750.000000,0.000000,"Too" \n "Long"}; -item39[] = {"Too_Long",4,218,300.000000,800.000000,400.000000,850.000000,0.000000,"Too" \n "Long"}; -item40[] = {"Enable_Sim",2,250,-75.000000,-100.000000,25.000000,-50.000000,0.000000,"Enable Sim"}; -item41[] = {"Initialized",4,218,-175.000000,-150.000000,-75.000000,-100.000000,0.000000,"Initialized"}; -item42[] = {"New_Character",4,218,-325.000000,400.000000,-225.000000,450.000000,5.000000,"New" \n "Character"}; -item43[] = {"Gender_Selection",2,250,-575.000000,400.000000,-475.000000,450.000000,0.000000,"Gender Selection" \n "Dialog"}; -item44[] = {"Selected",4,218,-575.000000,475.000000,-475.000000,525.000000,0.000000,"Selected"}; -item45[] = {"Process",2,250,-575.000000,550.000000,-475.000000,600.000000,0.000000,"Process"}; -item46[] = {"version_check",4,218,50.000000,-100.000000,150.000000,-50.000000,2.000000,"version check"}; -item47[] = {"ERROR__version_c",2,250,175.000000,-100.000000,275.000000,-50.000000,0.000000,"ERROR:" \n "version check"}; -item48[] = {"Too_Long",4,218,300.000000,-100.000000,400.000000,-50.000000,0.000000,"Too" \n "Long"}; -item49[] = {"Stream",2,250,-75.000000,900.000000,25.000000,950.000000,0.000000,"Stream"}; -item50[] = {"Preloaded",4,218,-175.000000,950.000000,-75.000000,1000.000000,0.000000,"Preloaded"}; -item51[] = {"Retry",4,218,25.000000,375.000000,125.000000,425.000000,0.000000,"Retry"}; -item52[] = {"retry_",4,218,25.000000,425.000000,125.000000,475.000000,0.000000,"retry" \n ""}; -item53[] = {"Retry",2,250,125.000000,400.000000,225.000000,450.000000,0.000000,"Retry"}; -item54[] = {"auth_failed",4,218,250.000000,400.000000,350.000000,450.000000,0.000000,"auth failed"}; -item55[] = {"get_ready_to_clo",2,4346,400.000000,400.000000,500.000000,450.000000,0.000000,"get ready to close"}; -item56[] = {"sleep_",4,218,550.000000,400.000000,650.000000,450.000000,0.000000,"sleep" \n ""}; -item57[] = {"Disconnect",2,250,825.000000,400.000000,925.000000,450.000000,0.000000,"Disconnect"}; -item58[] = {"No_time_date",4,218,25.000000,1150.000000,125.000000,1200.000000,0.000000,"No time/date"}; -item59[] = {"ERROR__No_Date_",2,250,175.000000,1150.000000,275.000000,1200.000000,0.000000,"ERROR:" \n "No Date || Time"}; -item60[] = {"Too_Long",4,218,300.000000,1150.000000,400.000000,1200.000000,0.000000,"Too" \n "Long"}; -item61[] = {"get_ready_to_clo_1",2,250,450.000000,800.000000,550.000000,850.000000,0.000000,"get ready to close"}; -item62[] = {"sleep_",4,218,600.000000,800.000000,700.000000,850.000000,0.000000,"sleep" \n ""}; -item63[] = {"Server_Loading",2,250,-75.000000,250.000000,25.000000,300.000000,0.000000,"Server Loading"}; -item64[] = {"Too_Long",4,218,50.000000,250.000000,150.000000,300.000000,0.000000,"Too" \n "Long"}; -item65[] = {"Server_Ready",4,218,-75.000000,325.000000,25.000000,375.000000,0.000000,"Server Ready"}; -item66[] = {"New_Infected_Cha",4,218,-325.000000,475.000000,-225.000000,525.000000,5.000000,"New" \n "Infected" \n "Character"}; -item67[] = {"Player_Zombie__S",2,250,-450.000000,475.000000,-350.000000,525.000000,0.000000,"Player Zombie" \n " Selection"}; -item68[] = {"",7,210,-204.000000,521.000000,-196.000000,529.000000,0.000000,""}; -item69[] = {"",7,210,-204.000000,496.000000,-196.000000,504.000000,0.000000,""}; -item70[] = {"",7,210,-204.000000,421.000000,-196.000000,429.000000,0.000000,""}; -item71[] = {"",7,210,-404.000000,571.000000,-396.000000,579.000000,0.000000,""}; -item72[] = {"",7,210,871.000000,1171.000000,879.000000,1179.000000,0.000000,""}; -item73[] = {"",7,210,871.000000,821.000000,879.000000,829.000000,0.000000,""}; -item74[] = {"",7,210,871.000000,721.000000,879.000000,729.000000,0.000000,""}; -item75[] = {"",7,210,871.000000,521.000000,879.000000,529.000000,0.000000,""}; -item76[] = {"",7,210,871.000000,170.999985,879.000000,179.000015,0.000000,""}; -item77[] = {"",7,210,871.000000,-79.000000,879.000000,-71.000000,0.000000,""}; -item78[] = {"",7,210,871.000000,271.000000,879.000000,279.000000,0.000000,""}; +item0[] = {"init",0,250,-75.000000,-200.000000,25.000000,-150.000000,0.000000,"init"}; +item1[] = {"isServer",4,218,50.000000,-200.000000,150.000000,-150.000000,0.000000,"isServer"}; +item2[] = {"wait",2,250,50.000000,-125.000000,150.000000,-75.000000,0.000000,"wait"}; +item3[] = {"Allow_Connection",4,218,50.000000,-50.000000,150.000000,0.000000,0.000000,"Allow" \n "Connection"}; +item4[] = {"Loading",2,250,-75.000000,-50.000000,25.000000,0.000000,0.000000,"Loading"}; +item5[] = {"Client",4,218,-75.000000,-125.000000,25.000000,-75.000000,0.000000,"Client"}; +item6[] = {"player____null_player",4,218,-175.000000,100.000000,-75.000000,150.000000,0.000000,"player != null" \n "player == player"}; +item7[] = {"Collect",2,250,-75.000000,150.000000,25.000000,200.000000,0.000000,"Collect"}; +item8[] = {"Has_PlayerID",4,218,-175.000000,200.000000,-75.000000,250.000000,1.000000,"Has PlayerID"}; +item9[] = {"no_PlayerID",4,218,125.000000,150.000000,225.000000,200.000000,2.000000,"no PlayerID"}; +item10[] = {"ERROR__No_Player",2,250,325.000000,150.000000,425.000000,200.000000,0.000000,"ERROR:" \n "No PlayerID"}; +item11[] = {"Request",2,250,-75.000000,350.000000,25.000000,400.000000,0.000000,"Request"}; +item12[] = {"Response",4,218,-175.000000,400.000000,-75.000000,450.000000,0.000000,"Response"}; +item13[] = {"Parse_Login",2,250,-66.532227,557.409241,33.467773,607.409241,0.000000,"Parse Login"}; +item14[] = {"Hive_Bad",4,218,125.000000,550.000000,225.000000,600.000000,10.000000,"Hive" \n "Bad"}; +item15[] = {"ERROR__Wrong_HIVE",2,250,325.000000,550.000000,425.000000,600.000000,0.000000,"ERROR:" \n "Wrong HIVE" \n "Version"}; +item16[] = {"Character_Setup",4,218,-175.000000,600.000000,-75.000000,650.000000,0.000000,"Character" \n "Setup"}; +item17[] = {"Phase_One",2,250,-75.000000,650.000000,25.000000,700.000000,0.000000,"Phase One"}; +item18[] = {"Response",4,218,-175.000000,700.000000,-75.000000,750.000000,0.000000,"Response"}; +item19[] = {"Phase_Two",2,250,-75.000000,750.000000,25.000000,800.000000,0.000000,"Phase Two"}; +item20[] = {"Dead_Player",4,218,125.000000,750.000000,225.000000,800.000000,0.000000,"Dead" \n "Player"}; +item21[] = {"ERROR__Player_Already",2,250,325.000000,750.000000,425.000000,800.000000,0.000000,"ERROR:" \n "Player Already" \n "Dead"}; +item22[] = {"Alive",4,218,-175.000000,800.000000,-75.000000,850.000000,0.000000,"Alive"}; +item23[] = {"Position",2,250,-75.000000,850.000000,25.000000,900.000000,0.000000,"Position"}; +item24[] = {"Version_Ok",4,218,-175.000000,900.000000,-75.000000,950.000000,0.000000,"Version" \n "Ok"}; +item25[] = {"Load_In",2,250,-75.000000,1150.000000,25.000000,1200.000000,0.000000,"Load In"}; +item26[] = {"Bad_Version",4,218,125.000000,850.000000,225.000000,900.000000,0.000000,"Bad" \n "Version"}; +item27[] = {"ERROR__Bad_Versi",2,250,325.000000,850.000000,425.000000,900.000000,0.000000,"ERROR:" \n "Bad Version"}; +item28[] = {"Display_Ready",4,218,-175.000000,1200.000000,-75.000000,1250.000000,0.000000,"Display" \n "Ready"}; +item29[] = {"Preload_Display",2,250,-75.000000,1250.000000,25.000000,1300.000000,0.000000,"Preload" \n "Display"}; +item30[] = {"Preload_Done",4,218,-175.000000,1300.000000,-75.000000,1350.000000,0.000000,"Preload" \n "Done"}; +item31[] = {"Initialize",2,250,-75.000000,1350.000000,25.000000,1400.000000,0.000000,"Initialize"}; +item32[] = {"Finish",1,4346,-75.000000,1625.000000,25.000000,1675.000000,0.000000,"Finish"}; +item33[] = {"no_Time_Date",4,218,125.000000,950.000000,225.000000,1000.000000,0.000000,"no Time/Date"}; +item34[] = {"sleep",4,218,525.000000,150.000000,625.000000,200.000000,0.000000,"sleep"}; +item35[] = {"sleep",4,218,525.000000,550.000000,625.000000,600.000000,0.000000,"sleep"}; +item36[] = {"sleep",4,218,525.000000,750.000000,625.000000,800.000000,0.000000,"sleep"}; +item37[] = {"sleep",4,218,525.000000,850.000000,625.000000,900.000000,0.000000,"sleep"}; +item38[] = {"Enable_Sim",2,250,-75.000000,50.000000,25.000000,100.000000,0.000000,"Enable Sim"}; +item39[] = {"Initialized",4,218,-175.000000,0.000000,-75.000000,50.000000,0.000000,"Initialized"}; +item40[] = {"ERROR__Client_Files",2,250,325.000000,50.000000,425.000000,100.000000,0.000000,"ERROR:" \n "Client Files " \n "are missing missing"}; +item41[] = {"sleep_",4,218,525.000000,50.000000,625.000000,100.000000,0.000000,"sleep" \n ""}; +item42[] = {"Stream",2,250,-75.000000,1050.000000,25.000000,1100.000000,0.000000,"Stream"}; +item43[] = {"Preloaded",4,218,-175.000000,1100.000000,-75.000000,1150.000000,0.000000,"Preloaded"}; +item44[] = {"retry",4,218,25.000000,350.000000,100.000000,375.000000,0.000000,"retry"}; +item45[] = {"retry_",4,218,25.000000,375.000000,100.000000,400.000000,0.000000,"" \n "retry" \n ""}; +item46[] = {"Retry",2,250,100.000000,350.000000,200.000000,400.000000,0.000000,"Retry"}; +item47[] = {"auth_failed",4,218,225.000000,350.000000,300.000000,400.000000,0.000000,"auth failed"}; +item48[] = {"get_ready_to_clo",2,250,325.000000,350.000000,425.000000,400.000000,0.000000,"get ready to close"}; +item49[] = {"sleep_",4,218,525.000000,350.000000,625.000000,400.000000,0.000000,"sleep" \n ""}; +item50[] = {"Disconnect",2,250,775.000000,450.000000,875.000000,500.000000,0.000000,"Disconnect"}; +item51[] = {"Got_time_date",4,218,-175.000000,1000.000000,-75.000000,1050.000000,0.000000,"Got time/date"}; +item52[] = {"Date_or_Time_Send",2,250,-75.000000,950.000000,25.000000,1000.000000,0.000000,"Date or Time" \n "Send request"}; +item53[] = {"True",8,218,-75.000000,1425.000000,25.000000,1475.000000,0.000000,"True"}; +item54[] = {"Server_Loading",2,250,-75.000000,250.000000,25.000000,300.000000,0.000000,"Server Loading"}; +item55[] = {"Too_Long",4,218,125.000000,250.000000,225.000000,300.000000,0.000000,"Too" \n "Long"}; +item56[] = {"Server_Ready",4,218,-175.000000,300.000000,-75.000000,350.000000,0.000000,"Server Ready"}; +item57[] = {"New_Character_57",4,218,-265.625061,511.895081,-165.625061,561.895081,5.000000,"New" \n "Character" \n "57"}; +item58[] = {"Gender_Selection",2,250,-416.028381,547.882996,-316.028381,597.882996,0.000000,"Gender Selection" \n "Dialog" \n "58"}; +item59[] = {"Gender__Selected",4,218,-781.502197,569.707764,-681.502197,619.707764,0.000000,"Gender " \n "Selected" \n "59"}; +item60[] = {"Character_Type_6",2,250,-910.736084,548.941589,-810.736084,598.941589,0.000000,"Character" \n "Type" \n "60"}; +item61[] = {"Region_Selection",2,250,-878.676575,824.200928,-778.676575,874.200928,0.000000,"Region Selection" \n "Dialog" \n "61"}; +item62[] = {"Region_Selected",4,218,-503.676575,799.200928,-403.676575,849.200928,0.000000,"Region" \n "Selected" \n "62"}; +item63[] = {"Region_Process_6",2,250,-378.676575,824.200928,-278.676575,874.200928,0.000000,"Region Process" \n "63"}; +item64[] = {"",7,210,-955.710327,751.386963,-947.710388,759.386963,0.000000,""}; +item65[] = {"Spawn_Process_65",2,250,-493.892822,730.386963,-393.892792,780.386963,0.000000,"Spawn Process" \n "65"}; +item66[] = {"Selection_Enabled",4,218,-995.124756,890.905029,-895.124756,940.905029,0.000000,"Selection" \n "Enabled" \n "66"}; +item67[] = {"Selection_Disabled",4,218,-870.268494,730.386963,-770.268494,780.386963,0.000000,"Selection" \n "Disabled" \n "67"}; +item68[] = {"",7,210,-954.000061,571.000000,-946.000000,579.000000,0.000000,""}; +item69[] = {"",7,210,-955.710266,826.386963,-947.710327,834.386963,0.000000,""}; +item70[] = {"",7,210,-178.999969,746.000000,-171.000031,754.000000,0.000000,""}; +item71[] = {"",7,210,-178.999969,671.000000,-171.000031,679.000000,0.000000,""}; +item72[] = {"ERROR__Date_Time",2,250,325.000000,950.000000,425.000000,1000.000000,0.000000,"ERROR:" \n "Date/Time" \n "not synced!"}; +item73[] = {"sleep",4,218,525.000000,950.000000,625.000000,1000.000000,0.000000,"sleep"}; +item74[] = {"get_ready_to_clo_1",2,250,325.000000,250.000000,425.000000,300.000000,0.000000,"get ready to close"}; +item75[] = {"sleep_",4,218,525.000000,250.000000,625.000000,300.000000,0.000000,"sleep" \n ""}; +item76[] = {"pbo_s__are_missi",4,218,125.000000,50.000000,225.000000,100.000000,2.000000,"pbo's " \n "are missing"}; +item77[] = {"",7,210,821.000000,571.000000,829.000000,579.000000,0.000000,""}; +item78[] = {"",7,210,821.000000,771.000000,829.000000,779.000000,0.000000,""}; +item79[] = {"",7,210,821.000000,971.000000,829.000000,979.000000,0.000000,""}; +item80[] = {"",7,210,821.000000,871.000000,829.000000,879.000000,0.000000,""}; +item81[] = {"",7,210,821.000000,71.000000,829.000000,79.000000,0.000000,""}; +item82[] = {"",7,210,821.000000,171.000000,829.000000,179.000000,0.000000,""}; +item83[] = {"",7,210,821.000000,271.000000,829.000000,279.000000,0.000000,""}; +item84[] = {"Gender_Closed_84",4,218,-533.619141,502.772095,-433.619141,552.772095,0.000000,"Gender" \n "Closed" \n "84"}; +item85[] = {"reopen_Region_85",4,218,-878.676575,899.200928,-778.676575,949.200928,0.000000,"reopen" \n "Region" \n "85"}; +item86[] = {"Default_Male_215",4,218,-780.443726,509.122925,-680.443726,559.122925,0.000000,"Default" \n "Male" \n "215"}; +item87[] = {"Default_Region_2",4,218,-503.676575,849.200928,-403.676575,899.200928,0.000000,"Default" \n "Region" \n "217"}; +item88[] = {"",7,210,-129.000000,671.000000,-121.000000,679.000000,0.000000,""}; +item89[] = {"Gender_Opened_22",4,218,-535.736084,568.649292,-435.736084,618.649292,0.000000,"Gender" \n "Opened" \n "220"}; +item90[] = {"Waiting_for_Gender",2,250,-648.034363,545.766174,-548.034363,595.766174,0.000000,"Waiting for" \n "Gender Selection" \n "221"}; +item91[] = {"Region_Opened_22",4,218,-753.676575,799.200928,-653.676575,849.200928,0.000000,"Region" \n "Opened" \n "223"}; +item92[] = {"Waiting_for__Region",2,250,-628.676575,824.200928,-528.676575,874.200928,0.000000,"Waiting for " \n "Region Selection" \n "224"}; +item93[] = {"Reopen__Gender_2",4,218,-325.000000,475.000000,-225.000000,525.000000,0.000000,"Reopen" \n " Gender" \n "225"}; +item94[] = {"Region__Closed_2",4,218,-753.676575,849.200928,-653.676575,899.200928,0.000000,"Region " \n "Closed" \n "227"}; +item95[] = {"Client_Not_Ready",4,218,-225.000000,450.000000,-125.000000,500.000000,0.000000,"Client Not Ready"}; +item96[] = {"Update_player",2,250,-425.000000,375.000000,-325.000000,425.000000,0.000000,"Update player"}; +item97[] = {"sleep",4,218,-550.000000,375.000000,-450.000000,425.000000,0.000000,"sleep"}; +item98[] = {"",7,210,821.000000,371.000000,829.000000,379.000000,0.000000,""}; +item99[] = {"Ghost_System",2,250,-75.000000,450.000000,25.000000,500.000000,0.000000,"Ghost System"}; +item100[] = {"Client_Ready",4,218,-177.116943,496.824585,-77.116943,546.824585,0.000000,"Client Ready"}; +item101[] = {"Reset",2,250,-425.000000,325.000000,-325.000000,375.000000,0.000000,"Reset"}; +item102[] = {"Sleep",4,218,-550.000000,325.000000,-450.000000,375.000000,0.000000,"Sleep"}; +item103[] = {"",7,210,-279.000000,371.000000,-271.000000,379.000000,0.000000,""}; +item104[] = {"retry_Login",4,218,-250.000000,350.000000,-150.000000,400.000000,0.000000,"retry Login"}; +item105[] = {"",7,210,-379.000031,471.000000,-371.000000,479.000000,0.000000,""}; +item106[] = {"Finish_1",2,250,-75.000000,1500.000000,25.000000,1550.000000,0.000000,"Finish"}; +item107[] = {"dayz_preloadFini",4,218,50.000000,1550.000000,150.000000,1600.000000,0.000000,"dayz_preloadFinished"}; +item108[] = {"New_INFECTED_Character",4,218,-271.606934,571.673645,-171.606934,621.673645,5.000000,"New" \n "INFECTED Character" \n "258"}; +item109[] = {"Player_Zombie__S",2,250,-611.348511,641.870300,-521.348145,691.870300,0.000000,"Player Zombie" \n " Selection"}; +item110[] = {"",7,210,-955.744385,664.969482,-947.744385,672.969482,0.000000,""}; link0[] = {0,1}; link1[] = {0,5}; link2[] = {1,2}; link3[] = {2,3}; link4[] = {3,4}; -link5[] = {4,41}; +link5[] = {4,39}; link6[] = {5,4}; link7[] = {6,7}; link8[] = {7,8}; -link9[] = {8,9}; -link10[] = {9,10}; -link11[] = {9,11}; -link12[] = {10,63}; +link9[] = {7,9}; +link10[] = {8,54}; +link11[] = {9,10}; +link12[] = {10,34}; link13[] = {11,12}; -link14[] = {12,36}; -link15[] = {13,14}; -link16[] = {13,52}; -link17[] = {14,15}; -link18[] = {15,16}; -link19[] = {15,18}; -link20[] = {15,68}; -link21[] = {16,17}; -link22[] = {17,37}; -link23[] = {18,19}; -link24[] = {19,20}; -link25[] = {20,21}; -link26[] = {21,22}; -link27[] = {21,24}; -link28[] = {22,23}; -link29[] = {23,38}; -link30[] = {24,25}; -link31[] = {25,26}; -link32[] = {25,28}; -link33[] = {26,49}; -link34[] = {27,30}; -link35[] = {28,29}; -link36[] = {29,39}; -link37[] = {30,31}; -link38[] = {31,32}; -link39[] = {32,33}; -link40[] = {33,35}; -link41[] = {33,58}; -link42[] = {35,34}; -link43[] = {36,76}; -link44[] = {37,75}; -link45[] = {38,74}; -link46[] = {39,61}; -link47[] = {40,6}; -link48[] = {40,46}; -link49[] = {41,40}; +link14[] = {11,45}; +link15[] = {12,99}; +link16[] = {13,14}; +link17[] = {13,16}; +link18[] = {13,57}; +link19[] = {13,108}; +link20[] = {14,15}; +link21[] = {15,35}; +link22[] = {16,17}; +link23[] = {17,18}; +link24[] = {18,19}; +link25[] = {19,20}; +link26[] = {19,22}; +link27[] = {20,21}; +link28[] = {21,36}; +link29[] = {22,23}; +link30[] = {23,24}; +link31[] = {23,26}; +link32[] = {24,52}; +link33[] = {25,28}; +link34[] = {26,27}; +link35[] = {27,37}; +link36[] = {28,29}; +link37[] = {29,30}; +link38[] = {30,31}; +link39[] = {31,53}; +link40[] = {33,72}; +link41[] = {34,82}; +link42[] = {35,77}; +link43[] = {36,78}; +link44[] = {37,80}; +link45[] = {38,6}; +link46[] = {38,76}; +link47[] = {39,38}; +link48[] = {40,41}; +link49[] = {41,81}; link50[] = {42,43}; -link51[] = {43,44}; -link52[] = {44,45}; -link53[] = {45,71}; -link54[] = {46,47}; -link55[] = {47,48}; -link56[] = {48,77}; -link57[] = {49,50}; -link58[] = {50,27}; -link59[] = {51,13}; -link60[] = {52,53}; -link61[] = {53,51}; -link62[] = {53,54}; +link51[] = {43,25}; +link52[] = {44,11}; +link53[] = {45,46}; +link54[] = {46,44}; +link55[] = {46,47}; +link56[] = {47,48}; +link57[] = {48,49}; +link58[] = {49,98}; +link59[] = {51,42}; +link60[] = {52,33}; +link61[] = {52,51}; +link62[] = {53,106}; link63[] = {54,55}; -link64[] = {55,56}; -link65[] = {56,57}; -link66[] = {58,59}; -link67[] = {59,60}; -link68[] = {60,72}; -link69[] = {61,62}; -link70[] = {62,73}; -link71[] = {63,64}; -link72[] = {63,65}; -link73[] = {64,78}; -link74[] = {65,13}; -link75[] = {66,67}; -link76[] = {67,71}; -link77[] = {68,69}; -link78[] = {69,66}; -link79[] = {69,70}; -link80[] = {70,42}; -link81[] = {71,18}; -link82[] = {72,73}; -link83[] = {73,74}; -link84[] = {74,75}; -link85[] = {75,57}; -link86[] = {76,78}; -link87[] = {77,76}; -link88[] = {78,57}; -globals[] = {0.000000,0,0,0,0,640,480,1,143,6316128,1,65.308601,1078.151001,702.806824,15.855862,864,586,1}; -window[] = {0,-1,-1,-1,-1,992,234,1723,234,1,882}; +link64[] = {54,56}; +link65[] = {55,74}; +link66[] = {56,11}; +link67[] = {57,58}; +link68[] = {58,89}; +link69[] = {58,93}; +link70[] = {59,60}; +link71[] = {60,68}; +link72[] = {61,85}; +link73[] = {61,91}; +link74[] = {62,63}; +link75[] = {63,70}; +link76[] = {64,67}; +link77[] = {64,69}; +link78[] = {65,71}; +link79[] = {66,61}; +link80[] = {67,65}; +link81[] = {68,110}; +link82[] = {69,66}; +link83[] = {70,71}; +link84[] = {71,88}; +link85[] = {72,73}; +link86[] = {73,79}; +link87[] = {74,75}; +link88[] = {75,83}; +link89[] = {76,40}; +link90[] = {77,50}; +link91[] = {78,77}; +link92[] = {79,80}; +link93[] = {80,78}; +link94[] = {81,82}; +link95[] = {82,83}; +link96[] = {83,98}; +link97[] = {84,58}; +link98[] = {85,61}; +link99[] = {86,60}; +link100[] = {87,63}; +link101[] = {88,16}; +link102[] = {89,90}; +link103[] = {90,59}; +link104[] = {90,84}; +link105[] = {90,86}; +link106[] = {91,92}; +link107[] = {92,62}; +link108[] = {92,87}; +link109[] = {92,94}; +link110[] = {93,58}; +link111[] = {94,61}; +link112[] = {95,105}; +link113[] = {96,97}; +link114[] = {96,103}; +link115[] = {97,101}; +link116[] = {98,50}; +link117[] = {99,95}; +link118[] = {99,100}; +link119[] = {100,13}; +link120[] = {101,102}; +link121[] = {101,103}; +link122[] = {102,96}; +link123[] = {103,104}; +link124[] = {104,11}; +link125[] = {105,96}; +link126[] = {106,107}; +link127[] = {107,32}; +link128[] = {108,109}; +link129[] = {109,110}; +link130[] = {110,64}; +globals[] = {0.000000,0,0,0,0,640,480,3,262,6316128,1,-321.543945,357.690063,2264.614258,769.397766,452,995,1}; +window[] = {0,-1,-1,-1,-1,734,208,1228,208,1,470}; *//*%FSM*/ class FSM { @@ -185,22 +259,23 @@ class FSM init = /*%FSM*/"dayz_versionNo = getText(configFile >> ""CfgMods"" >> ""DayZ"" >> ""version"");" \n "_AuthAttempt = 0;" \n "" \n - "0 fadeSound 0;" \n - "//player setPosATL [-2148,6655,0];" \n - "//DayZ Mod 1.8.1;" \n - "" \n - "progressLoadingScreen 0.1;" \n - "0 cutText ["""",""BLACK""];" \n - "" \n + "dayz_loadScreenMsg = localize 'STR_AUTHENTICATING';" \n + "Dayz_loginCompleted = nil;" \n + "PVCDZ_plr_Login = [];" \n "_timeStart = diag_tickTime;" \n "_readytoAuth = false;" \n "_startCheck = 0;" \n - "_debug = DZEdebug;" \n + "_debug = 0;" \n + "_schedulerStarted=false;" \n + "_spawnSelection = 9;" \n "" \n - "if (_debug) then {" \n + "_timeNemGender = 0;" \n + "_timeNemRegion = 0;" \n + "" \n + "" \n + "if (_debug == 1) then {" \n "diag_log (""DAYZ: CLIENT IS RUNNING DAYZ_CODE "" + str(dayz_versionNo));" \n "};" \n - "" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links @@ -239,8 +314,8 @@ class FSM precondition = /*%FSM*/""/*%FSM*/; class Links { - /*%FSM*/ - class Allow_Conn + /*%FSM*/ + class Allow_Connection { itemno = 3; priority = 0.000000; @@ -258,148 +333,20 @@ class FSM { name = "Loading"; itemno = 4; - init = /*%FSM*/"endLoadingScreen;" \n - "if (_debug) then {" \n - "diag_log (""PLOGIN: Initating"");" \n - "};" \n + init = /*%FSM*/"dayz_loadScreenMsg = localize 'str_player_loading'; " \n "" \n - "dayz_loadScreenMsg = (localize ""str_player_13""); " \n - "" \n - "progressLoadingScreen 0.2;" \n - ""/*%FSM*/; + "if (_debug == 1) then {diag_log [diag_tickTime,'Loading'];};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Initialized { - itemno = 41; + itemno = 39; priority = 0.000000; to="Enable_Sim"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!isnil ""bis_fnc_init"""/*%FSM*/; - action=/*%FSM*/"dayz_forceSave = {" \n - "_gearSave = false;" \n - "" \n - "if (!dialog) then {" \n - " createGearDialog [player, ""RscDisplayGear""];" \n - " _gearSave = true;" \n - "};" \n - "" \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 - "" \n - "if (_gearSave) then {" \n - " closeDialog 0;" \n - "};" \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 - " _isInVehicle = vehicle player != player;" \n - " //_wpnDisabled = (getNumber (_config >> ""disableWeapons"")) == 1;" \n - " _currentModel = typeOf player;" \n - " _charPos = getPosATL player;" \n - " _playerPos = [round(direction player),_charPos];" \n - " " \n - " if (_onLadder || _isInVehicle || _isTerminal) then {" \n - " _currentAnim = """";" \n - " //If position to be updated, make sure it is at ground level!" \n - " if ((count _playerPos > 0) && !_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 - " dayz_Magazines = _magazineArray;" \n - " PVDZE_plr_Save = [player,dayz_Magazines,false,true];" \n - " publicVariableServer ""PVDZE_plr_Save"";" \n - " " \n - " if (isServer) then {" \n - " PVDZE_plr_Save call server_playerSync;" \n - " };" \n - " " \n - " dayz_lastSave = diag_tickTime;" \n - " dayz_Magazines = [];" \n - "};"/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Prepare - { - name = "Prepare"; - itemno = 7; - init = /*%FSM*/"if (_debug) then {" \n - "diag_log (""PLOGIN: Player Model Exists"");" \n - "};"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class player___player - { - itemno = 8; - priority = 0.000000; - to="Collect"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"player == player"/*%FSM*/; + condition=/*%FSM*/"!isnil ""BIS_MPF_InitDone"""/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ @@ -410,22 +357,21 @@ class FSM class Collect { name = "Collect"; - itemno = 9; - init = /*%FSM*/"if (_debug) then {" \n - "diag_log (""PLOGIN: Player Ready"");" \n - "};" \n - "dayz_loadScreenMsg = (localize ""str_player_13""); " \n + itemno = 7; + init = /*%FSM*/"" \n "" \n - "progressLoadingScreen 0.3;" \n + "dayz_loadScreenMsg = localize 'str_player_waiting_creation'; " \n "" \n - "_playerUID = [player] call FNC_GetPlayerUID;"/*%FSM*/; + "_playerUID = [player] call FNC_GetPlayerUID;" \n + "progressLoadingScreen 0.6;" \n + "if (_debug == 1) then {diag_log [diag_tickTime,'Collect'];};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class no_PlayerID { - itemno = 11; + itemno = 9; priority = 2.000000; to="ERROR__No_Player"; precondition = /*%FSM*/""/*%FSM*/; @@ -436,7 +382,7 @@ class FSM /*%FSM*/ class Has_PlayerID { - itemno = 10; + itemno = 8; priority = 1.000000; to="Server_Loading"; precondition = /*%FSM*/""/*%FSM*/; @@ -451,18 +397,18 @@ class FSM class ERROR__No_Player { name = "ERROR__No_Player"; - itemno = 12; - init = /*%FSM*/"endLoadingScreen;" \n - "selectNoPlayer;" \n + itemno = 10; + init = /*%FSM*/"selectNoPlayer;" \n "_myTime = diag_tickTime;" \n - "1 cutText [localize ""str_player_14"", ""PLAIN"",15];"/*%FSM*/; + "dayz_loadScreenMsg = localize 'str_player_no_playerid';" \n + ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { - /*%FSM*/ - class Too_Long + /*%FSM*/ + class sleep { - itemno = 36; + itemno = 34; priority = 0.000000; to="Disconnect"; precondition = /*%FSM*/""/*%FSM*/; @@ -477,25 +423,19 @@ class FSM class Request { name = "Request"; - itemno = 13; - init = /*%FSM*/"if (_debug) then {" \n - "diag_log (""PLOGIN: Requesting Authentication... ("" + _playerUID + "")"");" \n - "};" \n - "dayz_loadScreenMsg = (localize ""str_player_15"");" \n + itemno = 11; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Request'];};" \n "" \n - "progressLoadingScreen 0.7;" \n + "dayz_loadScreenMsg = localize 'str_player_request';" \n "" \n "_msg = [];" \n - "" \n - "PVDZE_plr_Login = [_playerUID,player];" \n - "publicVariableServer ""PVDZE_plr_Login"";" \n - "" \n - "if (isServer) then {" \n - " PVDZE_plr_Login call server_playerLogin;" \n - "};" \n - "" \n - "dayzPlayerLogin = [];" \n - "" \n + "progressLoadingScreen 0.65;" \n + "PVDZ_plr_Login1 = [_playerUID,player];" \n + "publicVariableServer ""PVDZ_plr_Login1"";" \n + "diag_log ['Sent to server: PVDZ_plr_Login1', PVDZ_plr_Login1]; " \n + "PVDZ_send = [player,""dayzSetDate"",[player]];" \n + "publicVariableServer ""PVDZ_send"";" \n + "diag_log ['Sent to server: PVDZ_send', PVDZ_send]; " \n "_myTime = diag_tickTime;" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; @@ -504,7 +444,7 @@ class FSM /*%FSM*/ class retry_ { - itemno = 52; + itemno = 45; priority = 0.000000; to="Retry"; precondition = /*%FSM*/""/*%FSM*/; @@ -515,12 +455,12 @@ class FSM /*%FSM*/ class Response { - itemno = 14; + itemno = 12; priority = 0.000000; - to="Parse_Login"; + to="Ghost_System"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"count (dayzPlayerLogin) > 1"/*%FSM*/; - action=/*%FSM*/"_msg = dayzPlayerLogin;"/*%FSM*/; + condition=/*%FSM*/"count (PVCDZ_plr_Login) > 1"/*%FSM*/; + action=/*%FSM*/"_msg = PVCDZ_plr_Login;"/*%FSM*/; }; /*%FSM*/ }; @@ -530,10 +470,9 @@ class FSM class Parse_Login { name = "Parse_Login"; - itemno = 15; - init = /*%FSM*/"dayz_authed = true;" \n - "" \n - "progressLoadingScreen 0.6;" \n + itemno = 13; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Parse_Login'];};" \n + "progressLoadingScreen 0.8;" \n "_charID = _msg select 0;" \n "_inventory = _msg select 1;" \n "_backpack = _msg select 2;" \n @@ -542,6 +481,7 @@ class FSM "//_state = _msg select 5;" \n "_version = _msg select 5;" \n "_model = _msg select 6;" \n + "_patch = {};" \n "" \n "_isHiveOk = false;" \n "_newPlayer = false;" \n @@ -554,11 +494,13 @@ class FSM " diag_log (""PLAYER RESULT: "" + str(_isHiveOk));" \n "};" \n "" \n - "dayz_loadScreenMsg = (localize ""str_player_17""); " \n - "progressLoadingScreen 0.8;" \n - "if (_debug) then {" \n + "dayz_loadScreenMsg = localize 'str_player_creating_character'; " \n + "if (_isHiveOk) then { if (!_schedulerStarted) then { _schedulerStarted=true; execVM '\z\addons\dayz_code\system\scheduler\sched_init.sqf'; }; };" \n + "if (_debug == 1) then {" \n "diag_log (""PLOGIN: authenticated with : "" + str(_msg));" \n + " diag_log [""player_monitor:Parse_Login _isHiveOk,_isNew,isnil preload, preload:"",_isHiveOk,_isNew,!isNil 'dayz_preloadFinished',dayz_preloadFinished];" \n "};" \n + "" \n "//Not Equal Failure" \n "" \n "if (isNil ""_model"") then {" \n @@ -574,7 +516,6 @@ class FSM "if (_model == ""Survivor1_DZ"") then {" \n " _model = ""Survivor2_DZ"";" \n "};" \n - "" \n "_isHack = false;" \n "if (_model == ""hacker"") then {" \n " _isHack = true;" \n @@ -585,7 +526,7 @@ class FSM /*%FSM*/ class Hive_Bad { - itemno = 16; + itemno = 14; priority = 10.000000; to="ERROR__Wrong_HIVE"; precondition = /*%FSM*/""/*%FSM*/; @@ -593,37 +534,39 @@ class FSM action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ - /*%FSM*/ - class New_Infected_Cha + /*%FSM*/ + class New_Character_57 { - itemno = 66; - priority = 5.000000; - to="Player_Zombie__S"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_isNew && _isInfected == 1"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class New_Character - { - itemno = 42; + itemno = 57; priority = 5.000000; to="Gender_Selection"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_isNew && _isInfected == 0"/*%FSM*/; + condition=/*%FSM*/"(_isNew and (_isInfected == 0) and !isNil 'dayz_preloadFinished') and {(dayz_preloadFinished)}"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ - /*%FSM*/ - class Hive_Ok + /*%FSM*/ + class New_INFECTED_Character { - itemno = 18; + itemno = 108; + priority = 5.000000; + to="Player_Zombie__S"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(_isNew and (_isInfected == 1) and !isNil 'dayz_preloadFinished') and {(dayz_preloadFinished)}"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Character_Setup + { + itemno = 16; priority = 0.000000; to="Phase_One"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isNew"/*%FSM*/; + action=/*%FSM*/"_timeNemRegion = nil;" \n + "_timeNemGender = nil;" \n + ""/*%FSM*/; }; /*%FSM*/ }; @@ -633,19 +576,18 @@ class FSM class ERROR__Wrong_HIVE { name = "ERROR__Wrong_HIVE"; - itemno = 17; - init = /*%FSM*/"endLoadingScreen;" \n - "selectNoPlayer;" \n - "" \n + itemno = 15; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'ERROR__Wrong_HIVE'];};" \n "_myTime = diag_tickTime;" \n - "1 cutText [(localize ""str_epoch_player_112""), ""PLAIN"",5];"/*%FSM*/; + "dayz_loadScreenMsg = localize 'str_player_wrong_hive';" \n + ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { - /*%FSM*/ - class Too_Long + /*%FSM*/ + class sleep { - itemno = 37; + itemno = 35; priority = 0.000000; to="Disconnect"; precondition = /*%FSM*/""/*%FSM*/; @@ -660,8 +602,9 @@ class FSM class Phase_One { name = "Phase_One"; - itemno = 19; - init = /*%FSM*/"if ((!isNil ""DZE_defaultSkin"") && _isNew && (_isInfected == 0)) then {" \n + itemno = 17; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Phase_One'];};" \n + "if ((!isNil ""DZE_defaultSkin"") && _isNew && (_isInfected == 0)) then {" \n " if (dayz_selectGender == ""Survivor2_DZ"") then {" \n " _rand = (DZE_defaultSkin select 0) call BIS_fnc_selectRandom;" \n " _model = getText (configFile >> ""CfgMagazines"" >> ""Skins"" >> _rand >> ""playerModel""); //MALE" \n @@ -679,9 +622,6 @@ class FSM "" \n "dayz_playerName = name player;" \n "_model call player_switchModel;" \n - "diag_log [ 'resetting keyboard events',(MISSION_ROOT+'keyboard.sqf')];" \n - "keyboard_keys = nil;" \n - "[controlNull, 1, false,false,false] call compile preprocessFileLineNumbers (MISSION_ROOT+'keyboard.sqf');" \n "" \n "gear_done= true;" \n "player allowDamage false;" \n @@ -694,8 +634,6 @@ class FSM "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 @@ -732,16 +670,16 @@ class FSM " };" \n " dayz_myBackpack addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)];" \n " _countr = _countr + 1;" \n - " } count _backpackWpnTypes;" \n + " } forEach _backpackWpnTypes;" \n " " \n " //Magazines" \n " _countr = 0;" \n " {" \n " if (_x == ""BoltSteel"") then { _x = ""WoodenArrow"" }; // Convert BoltSteel to WoodenArrow" \n - " if (_x == ""ItemTent"") then { _x = ""ItemTentOld"" };" \n + " if (_x == ""ItemBloodbag"") then { _x = ""bloodBagONEG"" }; // Convert ItemBloodbag into universal blood type/rh bag" \n " dayz_myBackpack addMagazineCargoGlobal [_x,(_backpackMagQty select _countr)];" \n " _countr = _countr + 1;" \n - " } count _backpackMagTypes;" \n + " } forEach _backpackMagTypes;" \n " " \n " dayz_myBackpackMags = getMagazineCargo dayz_myBackpack;" \n " dayz_myBackpackWpns = getWeaponCargo dayz_myBackpack;" \n @@ -760,29 +698,24 @@ class FSM " dayz_myBackpackMags = [];" \n " dayz_myBackpackWpns = [];" \n "};" \n - "" \n - "dayzPlayerLogin2 = [];" \n - "//[""PVDZE_plr_Login2"",[_charID,player,_playerUID]] call callRpcProcedure;" \n - "" \n - "PVDZE_plr_Login2 = [_charID,player,_playerUID];" \n - "publicVariableServer ""PVDZE_plr_Login2"";" \n - "" \n - "dayz_loadScreenMsg = ""Requesting Character data from server"";" \n - "progressLoadingScreen 0.9;" \n - "if (_debug) then {" \n - "diag_log ""Attempting Phase two..."";" \n - "};"/*%FSM*/; + "//dayzPlayerLogin2 = [];" \n + "PVCDZ_plr_Login2 = [];" \n + "PVDZ_plr_Login2 = [_charID,player,_playerUID,_spawnSelection];" \n + "publicVariableServer ""PVDZ_plr_Login2"";" \n + "diag_log ['Sent to server: PVDZ_plr_Login2', PVDZ_plr_Login2]; " \n + "dayz_loadScreenMsg = localize 'str_player_requesting_character';" \n + ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Response { - itemno = 20; + itemno = 18; priority = 0.000000; to="Phase_Two"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"count (dayzPlayerLogin2) > 0"/*%FSM*/; + condition=/*%FSM*/"count (PVCDZ_plr_Login2) > 0"/*%FSM*/; action=/*%FSM*/"_msg = player getVariable[""worldspace"",[]];"/*%FSM*/; }; /*%FSM*/ @@ -793,21 +726,24 @@ class FSM class Phase_Two { name = "Phase_Two"; - itemno = 21; - init = /*%FSM*/"dayz_loadScreenMsg = ""Character Data received from server""; " \n - "if (_debug) then {" \n - "diag_log ""Finished..."";" \n - "};" \n - "_worldspace = dayzPlayerLogin2 select 0;" \n - "_state = dayzPlayerLogin2 select 1;" \n + itemno = 19; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Phase_Two'];};dayz_loadScreenMsg = localize 'str_login_characterData'; " \n + "" \n + "_worldspace = PVCDZ_plr_Login2 select 0;" \n + "_state = PVCDZ_plr_Login2 select 1;" \n + "_playerAchievements = PVCDZ_plr_Login2 select 2;" \n + "" \n + "dayz_playerAchievements = _playerAchievements;" \n + " " \n + "PVDZ_serverStoreVar = [player,""Achievements"",_playerAchievements];" \n + "publicVariableServer ""PVDZ_serverStoreVar"";" \n + "diag_log ['Sent to server: PVDZ_serverStoreVar', PVDZ_serverStoreVar]; " \n + "player setVariable [""Achievements"",_playerAchievements,false];" \n + "" \n "" \n "_setDir = _worldspace select 0;" \n "_setPos = _worldspace select 1;" \n "" \n - "if (isNil ""freshSpawn"") then {" \n - " freshSpawn = 0;" \n - "};" \n - "" \n "if(dayz_paraSpawn && (freshSpawn == 2)) then {" \n " player setDir _setDir;" \n " player setPosATL [(_setPos select 0),(_setPos select 1),2000];" \n @@ -826,11 +762,11 @@ class FSM "{" \n " if (player getVariable[""hit_""+_x,false]) then { " \n " [player,_x,_x] spawn fnc_usec_damageBleed; " \n - " usecBleed = [player,_x,_x];" \n - " publicVariable ""usecBleed""; // draw blood stream on character, on all gameclients" \n + " PVDZ_hlt_Bleed = [player,_x,_x];" \n + " publicVariable ""PVDZ_hlt_Bleed""; // draw blood stream on character, on all gameclients" \n " };" \n - "} count USEC_typeOfWounds;" \n - "//Legs && Arm fractures" \n + "} forEach USEC_typeOfWounds;" \n + "//Legs and Arm fractures" \n "_legs = player getVariable [""hit_legs"",0];" \n "_arms = player getVariable [""hit_hands"",0];" \n "" \n @@ -850,55 +786,49 @@ class FSM "" \n "dayz_playerUID = _playerUID;" \n "" \n - "if ((_isNew) || (count _inventory == 0)) then {" \n - " //player is new, add initial loadout only if player is not pzombie" \n + "if ((_isNew) OR (count _inventory == 0)) then {" \n + " //player is new, add initial loadout" \n " if(!(player isKindOf ""PZombie_VB"")) then {" \n " _config = (configFile >> ""CfgSurvival"" >> ""Inventory"" >> ""Default"");" \n - " _mags = getArray (_config >> ""magazines"");" \n - " _wpns = getArray (_config >> ""weapons""); " \n + " _totalrndmags = getNumber (_config >> ""RandomMagazines"");" \n + " _rndmags = getArray (_config >> ""RandomPossibilitieMagazines"");" \n + " _countmags = 0; " \n + " _gmags = getArray (_config >> ""GuaranteedMagazines"");" \n + " _wpns = getArray (_config >> ""weapons"");" \n " _bcpk = getText (_config >> ""backpack"");" \n - " _bcpkItems = getText (_config >> ""backpackWeapon"");" \n - " if(!isNil ""DefaultMagazines"") then {" \n - " _mags = DefaultMagazines;" \n - " };" \n - " if(!isNil ""DefaultWeapons"") then {" \n - " _wpns = DefaultWeapons;" \n - " };" \n - " if(!isNil ""DefaultBackpack"") then {" \n - " _bcpk = DefaultBackpack;" \n - " };" \n - " if(!isNil ""DefaultBackpackItems"") then {" \n - " _bcpkItems = DefaultBackpackItems;" \n - " };" \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 + " _countmags = _countmags +1;" \n " };" \n - " } count _mags;" \n + " } forEach _gmags;" \n + "" \n + " while {_countmags < _totalrndmags} do {" \n + " _rndmag = _rndmags call BIS_fnc_selectRandom;" \n + " _isOK = isClass(configFile >> ""CfgMagazines"" >> _rndmag);" \n + " if (_isOK) then {" \n + " player addMagazine _rndmag;" \n + " _countmags = _countmags +1;" \n + " };" \n + " };" \n + "" \n " {" \n " _isOK = isClass(configFile >> ""CfgWeapons"" >> _x);" \n " if (_isOK) then {" \n " player addWeapon _x;" \n " };" \n - " } count _wpns;" \n - " " \n + " } forEach _wpns;" \n + " " \n " if (_bcpk != """") then {" \n - " player addBackpack _bcpk; " \n - " dayz_myBackpack = unitBackpack player;" \n - " };" \n - " if ((typeName _bcpkItems) == ""ARRAY"") then {" \n - " {" \n - " if (isClass(configFile >> ""CfgWeapons"" >> _x)) then {" \n - " dayz_myBackpack addWeaponCargoGlobal [_x,1];" \n - " } else {" \n - " dayz_myBackpack addMagazineCargoGlobal [_x, 1];" \n - " };" \n - " } count _bcpkItems;" \n - " } else {" \n - " if (_bcpkItems != """") then {" \n - " dayz_myBackpack addMagazineCargoGlobal [_bcpkItems, 1];" \n + " player addBackpack _bcpk; " \n + " dayz_myBackpack = unitBackpack player;" \n + "" \n + " if (_bcpkWpn != """") then {" \n + " dayz_myBackpack addWeaponCargoGlobal [_bcpkWpn,1];" \n " };" \n " };" \n " };" \n @@ -932,9 +862,10 @@ class FSM "r_player_blood = player getVariable[""USEC_BloodQty"",r_player_bloodTotal];" \n "" \n "//Hunger/Thirst" \n - "_messing = player getVariable[""messing"",[0,0]];" \n + "_messing = player getVariable[""messing"",[0,0,0]];" \n "dayz_hunger = _messing select 0;" \n "dayz_thirst = _messing select 1;" \n + "dayz_nutrition = _messing select 2;" \n "" \n "//player setVariable [""humanity"",-3000, true];"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; @@ -943,18 +874,18 @@ class FSM /*%FSM*/ class Alive { - itemno = 24; + itemno = 22; priority = 0.000000; to="Position"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!r_player_dead"/*%FSM*/; + condition=/*%FSM*/"!r_player_dead/* and !_isNew*/"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ /*%FSM*/ class Dead_Player { - itemno = 22; + itemno = 20; priority = 0.000000; to="ERROR__Player_Already"; precondition = /*%FSM*/""/*%FSM*/; @@ -969,18 +900,19 @@ class FSM class ERROR__Player_Already { name = "ERROR__Player_Already"; - itemno = 23; - init = /*%FSM*/"endLoadingScreen;" \n + itemno = 21; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'ERROR__Player_Already'];};" \n "selectNoPlayer;" \n "_myTime = diag_tickTime;" \n + "dayz_loadScreenMsg = localize 'str_login_alreadyDead';" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { - /*%FSM*/ - class Too_Long + /*%FSM*/ + class sleep { - itemno = 38; + itemno = 36; priority = 0.000000; to="Disconnect"; precondition = /*%FSM*/""/*%FSM*/; @@ -995,41 +927,17 @@ class FSM class Position { name = "Position"; - itemno = 25; - init = /*%FSM*/"//Location" \n - "_myLoc = getPosATL player;" \n - "" \n - "dayz_loadScreenMsg = ""Setup Completed, please wait..."";" \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 && !r_fracture_arms) then {" \n - " _ctrlFracture = _display displayCtrl 1203;" \n - " _ctrlFracture ctrlShow false;" \n - " };" \n - "};" \n - "" \n - "call ui_changeDisplay;"/*%FSM*/; + itemno = 23; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Position'];};" \n + "progressLoadingScreen 0.85;" \n + ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Bad_Version { - itemno = 28; + itemno = 26; priority = 0.000000; to="ERROR__Bad_Versi"; precondition = /*%FSM*/""/*%FSM*/; @@ -1040,9 +948,9 @@ class FSM /*%FSM*/ class Version_Ok { - itemno = 26; + itemno = 24; priority = 0.000000; - to="Stream"; + to="Date_or_Time_Send"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_version == dayz_versionNo"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; @@ -1055,35 +963,38 @@ class FSM class Load_In { name = "Load_In"; - itemno = 27; - init = /*%FSM*/"//Reveal action types" \n - "" \n - "{player reveal _x} count (nearestObjects [getPosATL player, dayz_reveal, 50]);" \n - "" \n - "dayz_clientPreload = true;" \n - "3 fadeSound 1;" \n - "1 cutText ["""", ""PLAIN""];" \n - "0 fadeMusic 0.5;" \n - "" \n - "//Check mission objects" \n - "{ " \n - " if (typeOf _x == ""RoadFlare"") then { " \n - " _id = [_x,0] spawn object_roadFlare " \n - " } else {" \n - " _id = [_x,1] spawn object_roadFlare " \n - " };" \n - " } count (allMissionObjects ""LitObject"");"/*%FSM*/; + itemno = 25; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Load_In'];};" \n + "progressLoadingScreen 0.95;" \n + "dayz_loadScreenMsg = localize 'str_player_setup_completed';" \n + "_torev4l=nearestObjects [_setPos, Dayz_plants + DayZ_GearedObjects + [""AllVehicles"",""WeaponHolder""], 50];" \n + "{ [_x,0] spawn object_roadFlare } forEach (allMissionObjects ""RoadFlare"");" \n + "{ [_x,1] spawn object_roadFlare } forEach (allMissionObjects ""ChemLight"");" \n + "{" \n + " _fadeFire = _x getVariable['fadeFire', true];" \n + " if (!_fadeFire) then {" \n + " nul = [_x,2,0,false,false] spawn BIS_Effects_Burn;" \n + " };" \n + "} forEach allMissionObjects ""SpawnableWreck"";" \n + "{deleteVehicle _x} forEach (_setPos nearEntities [""zZombie_Base"",30]);" \n + "player setDir _setDir;" \n + "player setPosATL _setPos;" \n + "player setVelocity [0,0,0.5];" \n + "{player reveal _x} forEach _torev4l;" \n + "dayz_myPosition = _setPos;" \n + "player setVariable ['BIS_noCoreConversations', true];" \n + "dayz_clientPreload = true;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Display_Ready { - itemno = 30; + itemno = 28; priority = 0.000000; to="Preload_Display"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!(isNull (findDisplay 46))"/*%FSM*/; + condition=/*%FSM*/"call sched_townGenerator_ready"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ @@ -1094,25 +1005,20 @@ class FSM class ERROR__Bad_Versi { name = "ERROR__Bad_Versi"; - itemno = 29; - init = /*%FSM*/"endLoadingScreen;" \n - "selectNoPlayer;" \n + itemno = 27; + init = /*%FSM*/"selectNoPlayer;" \n "_myTime = diag_tickTime;" \n - "" \n - "dayz_loadScreenMsg = ""You are running an incorrect version, please download update from dayzepoch.com."";" \n - "" \n - "1 cutText [format[localize ""str_player_18"",dayz_versionNo,_version], ""PLAIN""];" \n - "" \n - "progressLoadingScreen 0.5;"/*%FSM*/; + "dayz_loadScreenMsg = localize 'str_player_outdated';" \n + ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { - /*%FSM*/ - class Too_Long + /*%FSM*/ + class sleep { - itemno = 39; + itemno = 37; priority = 0.000000; - to="get_ready_to_clo_1"; + to="Disconnect"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"(diag_tickTime - _myTime) > 5"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; @@ -1125,37 +1031,27 @@ class FSM class Preload_Display { name = "Preload_Display"; - itemno = 31; - init = /*%FSM*/"dayz_lastCheckBit = 0;" \n + itemno = 29; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Preload_Display'];};" \n + "" \n + "dayz_lastCheckBit = 0;" \n "" \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[""PVDZE_player%1"",_playerUID];" \n - "call compile format[""PVDZE_player%1 = player;"",_playerUID];" \n - "////diag_log (format[""player%1 = player"",_playerUID]);" \n - "publicVariableServer _playerObjName;" \n + "player addEventHandler ['Respawn', player_death];" \n "" \n "//_state = player getVariable[""state"",[]];" \n "_currentWpn = """";" \n "_currentAnim = """";" \n - "if (count _state > 0) then {" \n + "if ((!isNil ""_state"") AND {(count _state > 1)}) 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 - " if ((count _state > 3) && DZE_FriendlySaving) then {" \n - " DZE_Friends = _state select 3;" \n - " }; " \n - "} else {" \n - " _currentWpn = ""Makarov"";" \n + " };rentWpn = ""Makarov"";" \n " _currentAnim = ""aidlpercmstpsraswpstdnon_player_idlesteady02"";" \n "};" \n "" \n @@ -1181,7 +1077,6 @@ class FSM "};" \n "" \n "reload player;" \n - "" \n "if (_currentAnim != """" && !dayz_paraSpawn) then {" \n " [objNull, player, rSwitchMove,_currentAnim] call RE;" \n "};" \n @@ -1206,26 +1101,26 @@ class FSM " };" \n "};" \n "" \n + "" \n "//Player control loop" \n "dayz_monitor1 = [] spawn {" \n - " while {true} do {" \n + " while {1 == 1} do { " \n + " //sleep (if (call player_zombieCheck) then {dayz_monitorPeriod/3} else {dayz_monitorPeriod});" \n " call player_zombieCheck;" \n " uiSleep 1;" \n " };" \n - "};" \n - "" \n - ""/*%FSM*/; + "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Preload_Done { - itemno = 32; + itemno = 30; priority = 0.000000; to="Initialize"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"dayz_preloadFinished"/*%FSM*/; + condition=/*%FSM*/"preloadCamera getPosATL player"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ @@ -1236,22 +1131,26 @@ class FSM class Initialize { name = "Initialize"; - itemno = 33; - init = /*%FSM*/"//Medical" \n - "dayz_medicalH = [] execVM ""\z\addons\dayz_code\medical\init_medical.sqf""; //Medical Monitor Script (client only)" \n + itemno = 31; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Initialize'];};" \n + "" \n + "if (!isNil ""dayzInfectedCamps"") then {" \n + " //diag_log (""Infected Camps: "" +str(dayzInfectedCamps));" \n + " dayzInfectedCamps call infectedcamps;" \n + "};" \n + "" \n + "//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 - "player enableSimulation true;" \n - "0 cutText ["""", ""BLACK IN"",3];" \n - "dayz_playerName = name player;" \n + "" \n + "" \n "" \n "//Add core tools" \n "player addWeapon ""Loot"";" \n - "player addWeapon ""Flare"";" \n "if ((currentWeapon player == """")) then { player action [""SWITCHWEAPON"", player,player,1]; };" \n "//load in medical details" \n "r_player_dead = player getVariable[""USEC_isDead"",false];" \n @@ -1262,12 +1161,25 @@ class FSM "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 + "r_player_bloodtype = player getVariable [""blood_type"", false];" \n + "r_player_rh = player getVariable [""rh_factor"", false];" \n "selfTransfusionTime = time; //time to keep for last self transfusion." \n "" \n """colorCorrections"" ppEffectEnable true;" \n """colorCorrections"" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1 min (4*r_player_blood/3/r_player_bloodTotal)], [1, 1, 1, 0.0]];" \n """colorCorrections"" ppEffectCommit 0;" \n "" \n + "dayz_musicH = [] spawn player_music;" \n + "dayzGearSave = true;" \n + "dayz_slowCheck = [] spawn player_spawn_2;" \n + "Dayz_logonTime = daytime;" \n + "Dayz_logonDate = dayz_Survived;" \n + "_position = getPosATL player;" \n + "_radius = 200;" \n + "//Current amounts" \n + "dayz_spawnZombies = {alive _x AND local _x} count (_position nearEntities [""zZombie_Base"",_radius]);" \n + "dayz_CurrentNearByZombies = {alive _x} count (_position nearEntities [""zZombie_Base"",_radius]);" \n + "dayzGearSave = true;" \n "dayz_gui = [] spawn {" \n " private[""_distance""];" \n " dayz_musicH = [] spawn player_music;" \n @@ -1295,30 +1207,20 @@ class FSM " };" \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 [([player] call FNC_GetPos), [""NameCityCapital"",""NameCity"",""NameVillage"",""NameLocal""],1000];" \n - "Dayz_logonTown = ""Wilderness"";" \n - "" \n - "if (count _nearestCity > 0) then {Dayz_logonTown = text (_nearestCity select 0)};" \n - "" \n - "_first = [_world,Dayz_logonTown,localize (""str_player_06"") + "" "" + str(_days)] spawn BIS_fnc_infoText;" \n + "//dayz_slowCheck = [] spawn player_spawn_2;" \n "" \n "Dayz_logonTime = daytime;" \n "Dayz_logonDate = dayz_Survived;" \n - "" \n - "dayz_animalCheck = [] spawn player_spawn_1;" \n - "" \n - "dayz_spawnCheck = [] spawn {" \n - " while {true} do {" \n - " [""both""] call player_spawnCheck;" \n - " uiSleep 8;" \n + "{ _x call fnc_veh_ResetEH; } forEach vehicles;" \n + "player allowDamage true;" \n + "player enableSimulation true;" \n + "private[""_fadeFire""];" \n + "{" \n + " _fadeFire = _x getVariable['fadeFire', true];" \n + " if (!_fadeFire) then {" \n + " _nul = [_x,2,0,false,false] spawn BIS_Effects_Burn;" \n " };" \n - "};" \n - "" \n + "} count entities ""SpawnableWreck"";" \n "dayz_Totalzedscheck = [] spawn {" \n " while {true} do {" \n " dayz_maxCurrentZeds = {alive _x} count entities ""zZombie_Base"";" \n @@ -1332,18 +1234,6 @@ class FSM " uiSleep 1;" \n " };" \n "};" \n - "" \n - "// TODO: questionably" \n - "{ _x call fnc_veh_ResetEH; } count vehicles;" \n - "" \n - "private[""_fadeFire""];" \n - "{" \n - " _fadeFire = _x getVariable['fadeFire', true];" \n - " if (!_fadeFire) then {" \n - " _nul = [_x,2,0,false,false] spawn BIS_Effects_Burn;" \n - " };" \n - "} count entities ""SpawnableWreck"";" \n - "" \n "// remove box " \n "[] spawn {" \n " private [""_counter""];" \n @@ -1355,29 +1245,22 @@ class FSM " uiSleep 1;" \n " _counter = _counter + 1;" \n " };" \n - "};"/*%FSM*/; + "};" \n + "diag_log [ 'resetting keyboard events',(MISSION_ROOT+'keyboard.sqf')];" \n + "keyboard_keys = nil;" \n + "[controlNull, 1, false,false,false] call compile preprocessFileLineNumbers (MISSION_ROOT+'keyboard.sqf');" \n + ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { - /*%FSM*/ - class No_time_date - { - itemno = 58; - priority = 0.000000; - to="ERROR__No_Date_"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!isNil ""PVDZE_plr_SetDate"""/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ /*%FSM*/ class True { - itemno = 35; + itemno = 53; priority = 0.000000; - to="Finish"; + to="Finish_1"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ @@ -1388,17 +1271,10 @@ class FSM class Finish { name = "Finish"; - itemno = 34; - init = /*%FSM*/"dayzGearSave = true;" \n - "dayz_myPosition = getPosATL player;" \n - "" \n - "//[""PVDZE_plr_LoginRecord"",[_playerUID,_charID,0]] call callRpcProcedure;" \n - "" \n - "PVDZE_plr_LoginRecord = [_playerUID,_charID,0];" \n - "publicVariableServer ""PVDZE_plr_LoginRecord"";" \n - "" \n - "endLoadingScreen;" \n - ""/*%FSM*/; + itemno = 32; + init = /*%FSM*/"diag_log 'player_forceSave called from fsm';" \n + "call player_forceSave;" \n + "endLoadingScreen;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { @@ -1409,114 +1285,72 @@ class FSM class Enable_Sim { name = "Enable_Sim"; - itemno = 40; - init = /*%FSM*/"if (_debug) then {" \n - "diag_log (""PLOGIN: Enable Sim"");" \n - "};" \n + itemno = 38; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Enable_Sim'];};" \n "" \n - "_myEpochAnim = getText(configFile >> ""CfgPatches"" >> ""dayz_anim"" >> ""dayzVersion"");" \n - "_myEpoch = getText(configFile >> ""CfgPatches"" >> ""dayz_epoch"" >> ""dayzVersion"");" \n + "_myAssets = getText(configFile >> ""CfgPatches"" >> ""dayz_communityassets"" >> ""dayzVersion"");" \n + "_mySfx = getNumber(configFile >> ""CfgPatches"" >> ""dayz_sfx"" >> ""dayzVersion"");" \n + "_myAnim = getNumber(configFile >> ""CfgPatches"" >> ""dayz_anim"" >> ""dayzVersion"");" \n "_myEpochB = getText(configFile >> ""CfgPatches"" >> ""dayz_epoch_b"" >> ""dayzVersion"");" \n - "_myEpochSfx = getText(configFile >> ""CfgPatches"" >> ""dayz_sfx"" >> ""dayzVersion"");" \n - "_myEpochDayZ = getText(configFile >> ""CfgPatches"" >> ""dayz"" >> ""dayzVersion"");" \n "" \n - "player enableSimulation true;"/*%FSM*/; + "/*" \n + "_myCCrossbow = getNumber(configFile >> ""CfgPatches"" >> ""community_crossbow"" >> ""dayzVersion"");" \n + "_myDayz = getNumber(configFile >> ""CfgPatches"" >> ""dayz"" >> ""dayzVersion"");" \n + "_myBuildings = getNumber(configFile >> ""CfgPatches"" >> ""dayz_buildings"" >> ""dayzVersion"");" \n + "_myCWeapons = getNumber(configFile >> ""CfgPatches"" >> ""dayz_communityweapons"" >> ""dayzVersion"");" \n + "_myEquip = getNumber(configFile >> ""CfgPatches"" >> ""dayz_equip"" >> ""dayzVersion"");" \n + "_mySFX = getNumber(configFile >> ""CfgPatches"" >> ""dayz_sfx"" >> ""dayzVersion"");" \n + "_myVechicles = getNumber(configFile >> ""CfgPatches"" >> ""dayz_vehicles"" >> ""dayzVersion"");" \n + "_myWeapons = getNumber(configFile >> ""CfgPatches"" >> ""dayz_weapons"" >> ""dayzVersion"");" \n + "*/" \n + "" \n + "if (_debug == 1) then {" \n + " diag_log format[""DayZ Version: DayZ_Anim: %1 DayZ_SFX: %2 DayZ_Assets: %3"",_myAnim, _mySfx,_myAssets];" \n + "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { - /*%FSM*/ - class version_check + /*%FSM*/ + class pbo_s__are_missi { - itemno = 46; + itemno = 76; priority = 2.000000; - to="ERROR__version_c"; + to="ERROR__Client_Files"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(_myEpochAnim != ""1.0.5"") || (_myEpoch != ""1.0.4.2"") || (_myEpochB != ""1.0.6"") || (_myEpochSfx != ""1.0.5"") || (_myEpochDayZ != ""1.0.5"")"/*%FSM*/; + condition=/*%FSM*/"(_myAnim != 1.8) || (_mySfx != 1.8) || (_myAssets != ""1.8.0.1"") || (_myEpochB != ""1.0.6"")"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ - /*%FSM*/ - class player_not_null + /*%FSM*/ + class player____null_player { itemno = 6; priority = 0.000000; - to="Prepare"; + to="Collect"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!isNull player"/*%FSM*/; + condition=/*%FSM*/"(!isNull player) and (player == player)"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ }; }; /*%FSM*/ - /*%FSM*/ - class Gender_Selection + /*%FSM*/ + class ERROR__Client_Files { - name = "Gender_Selection"; - itemno = 43; - init = /*%FSM*/"dayz_selectGender = ""Survivor2_DZ"";" \n - "1 cutText ["""", ""BLACK"",0];" \n - "endLoadingScreen;" \n - "createDialog ""RscDisplayGenderSelect"";" \n - "freshSpawn = 2;"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Selected - { - itemno = 44; - priority = 0.000000; - to="Process"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!dialog"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Process - { - name = "Process"; - itemno = 45; - init = /*%FSM*/"_model = dayz_selectGender;"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Hive_Ok - { - itemno = 18; - priority = 0.000000; - to="Phase_One"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class ERROR__version_c - { - name = "ERROR__version_c"; - itemno = 47; - init = /*%FSM*/"endLoadingScreen;" \n - "selectNoPlayer;" \n + name = "ERROR__Client_Files"; + itemno = 40; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'ERROR__Client_Files'];};selectNoPlayer;" \n "_myTime = diag_tickTime;" \n - "1 cutText [(localize ""str_epoch_player_113""), ""PLAIN"",15];" \n - "diag_log format [""VERSION CHECK: Anim:%1 Epoch:%2 EpochB:%3 Sfx:%4 DayZ:%5"",_myEpochAnim,_myEpoch,_myEpochB,_myEpochSfx,_myEpochDayZ];" \n + "dayz_loadScreenMsg = localize 'str_player_outdated';" \n ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { - /*%FSM*/ - class Too_Long + /*%FSM*/ + class sleep_ { - itemno = 48; + itemno = 41; priority = 0.000000; to="Disconnect"; precondition = /*%FSM*/""/*%FSM*/; @@ -1531,25 +1365,21 @@ class FSM class Stream { name = "Stream"; - itemno = 49; - init = /*%FSM*/"//stream in location" \n - "//[false] call stream_locationCheck;" \n - "" \n - "_zombies = (getPosATL player) nearEntities [""zZombie_Base"",25];" \n - "{deleteVehicle _x} count _zombies;" \n - "" \n - "endLoadingScreen;"/*%FSM*/; + itemno = 42; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Stream'];};" \n + "dayz_loadScreenMsg = localize 'str_login_spawningLocalObjects';" \n + ""/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Preloaded { - itemno = 50; + itemno = 43; priority = 0.000000; to="Load_In"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"preloadCamera _setPos"/*%FSM*/; + condition=/*%FSM*/"((!isNil 'dayz_plantSpawner_done') and {(dayz_plantSpawner_done == 2)})"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ @@ -1560,20 +1390,24 @@ class FSM class Retry { name = "Retry"; - itemno = 53; - init = /*%FSM*/"diag_log (""PLOGIN: Retrying Authentication... ("" + _playerUID + "")"");" \n - "dayz_loadScreenMsg = (localize ""str_player_14"");" \n + itemno = 46; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Retry'];};" \n + "dayz_loadScreenMsg = localize 'str_player_retrying';" \n "" \n "_AuthAttempt = _AuthAttempt +1;" \n "" \n - "_myTime = diag_tickTime;"/*%FSM*/; + "_myTime = diag_tickTime;" \n + "" \n + "if (_debug == 1) then {" \n + " diag_log (""PLOGIN: Retrying Authentication... ("" + _playerUID + "")"");" \n + "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class auth_failed { - itemno = 54; + itemno = 47; priority = 0.000000; to="get_ready_to_clo"; precondition = /*%FSM*/""/*%FSM*/; @@ -1581,10 +1415,10 @@ class FSM action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ - /*%FSM*/ - class Retry + /*%FSM*/ + class retry { - itemno = 51; + itemno = 44; priority = 0.000000; to="Request"; precondition = /*%FSM*/""/*%FSM*/; @@ -1599,20 +1433,19 @@ class FSM class get_ready_to_clo { name = "get_ready_to_clo"; - itemno = 55; - init = /*%FSM*/"diag_log (""PLOGIN: Authentication Failed ("" + _playerUID + "")"");" \n - "dayz_loadScreenMsg = (localize ""str_player_login_timeout"");" \n - "" \n - "progressLoadingScreen 1;" \n - "" \n - "_myTime = diag_tickTime;"/*%FSM*/; + itemno = 48; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'get_ready_to_clo'];};dayz_loadScreenMsg = localize 'str_player_authentication_failed';" \n + "_myTime = diag_tickTime;" \n + "if (_debug == 1) then {" \n + " diag_log (""PLOGIN: Authentication Failed ("" + _playerUID + "")"");" \n + "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class sleep_ { - itemno = 56; + itemno = 49; priority = 0.000000; to="Disconnect"; precondition = /*%FSM*/""/*%FSM*/; @@ -1627,73 +1460,58 @@ class FSM class Disconnect { name = "Disconnect"; - itemno = 57; - init = /*%FSM*/"endLoadingScreen;" \n + itemno = 50; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Disconnect'];};" \n "" \n - "// disable player interaction && move him off site" \n - "// player setPos [10,10,100000];" \n " player enableSimulation false;" \n "" \n - "diag_log (""End Mission"");" \n + "if (_debug == 1) then {" \n + " diag_log (""End Mission"");" \n + "};" \n "" \n - "//if (!isServer) then {" \n - " failMission ""LOSER"";" \n - " endMission ""END1""" \n - "//};"/*%FSM*/; + "failMission ""LOSER"";" \n + "endMission ""END1"";" \n + "" \n + "" \n + "dayz_authed = true;" \n + "dayz_clientPreload = true;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { }; }; /*%FSM*/ - /*%FSM*/ - class ERROR__No_Date_ + /*%FSM*/ + class Date_or_Time_Send { - name = "ERROR__No_Date_"; - itemno = 59; - init = /*%FSM*/"endLoadingScreen;" \n - "selectNoPlayer;" \n - "_myTime = diag_tickTime;" \n - "1 cutText [(localize ""str_epoch_player_114""), ""PLAIN"",5];"/*%FSM*/; + name = "Date_or_Time_Send"; + itemno = 52; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Date_or_Time_Send'];};" \n + "_myTime = diag_tickTime;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { - /*%FSM*/ - class Too_Long + /*%FSM*/ + class Got_time_date { - itemno = 60; + itemno = 51; priority = 0.000000; - to="Disconnect"; + to="Stream"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(diag_tickTime - _myTime) > 10"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!isNil ""dayzSetDate"""/*%FSM*/; + action=/*%FSM*/"diag_log ['Date & time received:', dayzSetDate];" \n + "setDate dayzSetDate;" \n + "diag_log ['Local date on this client:', date];"/*%FSM*/; }; /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class get_ready_to_clo_1 - { - name = "get_ready_to_clo_1"; - itemno = 61; - init = /*%FSM*/"//diag_log (""PLOGIN:Wrong DayZ Version ("" + dayz_versionNo + "")"");" \n - "diag_log format[localize ""str_player_18"",dayz_versionNo,_version];" \n - "" \n - "dayz_loadScreenMsg = ""You are running an incorrect version of DAYZ_CODE, please download this file from dayzepoch.com."";" \n - "" \n - "progressLoadingScreen 1;"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class sleep_ + /*%FSM*/ + class no_Time_Date { - itemno = 62; + itemno = 33; priority = 0.000000; - to="Disconnect"; + to="ERROR__Date_Time"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(diag_tickTime - _myTime) > 5"/*%FSM*/; + condition=/*%FSM*/"diag_tickTime - _myTime > 15"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ @@ -1704,20 +1522,21 @@ class FSM class Server_Loading { name = "Server_Loading"; - itemno = 63; - init = /*%FSM*/"_myTime = diag_tickTime;" \n - "dayz_loadScreenMsg = ""Waiting for server to start authentication"";" \n - "if (_debug) then {" \n - "diag_log ""PLOGIN: Waiting for server to start authentication"";" \n - "};" \n - "progressLoadingScreen 0.5;"/*%FSM*/; + itemno = 54; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Server_Loading'];};_myTime = diag_tickTime;" \n + "dayz_loadScreenMsg = localize 'str_player_waiting_start';" \n + "" \n + "if (_debug == 1) then {" \n + " diag_log (""Server Loading"");" \n + " diag_log (""PLOGIN: Waiting for server to start authentication"");" \n + "};"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { /*%FSM*/ class Server_Ready { - itemno = 65; + itemno = 56; priority = 0.000000; to="Request"; precondition = /*%FSM*/""/*%FSM*/; @@ -1728,11 +1547,494 @@ class FSM /*%FSM*/ class Too_Long { - itemno = 64; + itemno = 55; + priority = 0.000000; + to="get_ready_to_clo_1"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _myTime) > 120"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Gender_Selection + { + name = "Gender_Selection"; + itemno = 58; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Gender_Selection'];};" \n + "endLoadingScreen;" \n + "" \n + "_gender = createDialog 'RscDisplayGenderSelect';" \n + "" \n + "dayz_loadScreenMsg = localize 'STR_UI_GENDER_TITLE';" \n + "_timeNem=diag_tickTime;" \n + "_model = 'Survivor2_DZ';" \n + "dayz_preloadFinished=nil;//do not remove this"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Reopen__Gender_2 + { + itemno = 93; + priority = 0.000000; + to="Gender_Selection"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_gender"/*%FSM*/; + action=/*%FSM*/"closeDialog 0;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Gender_Opened_22 + { + itemno = 89; + priority = 0.000000; + to="Waiting_for_Gender"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_gender"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Character_Type_6 + { + name = "Character_Type_6"; + itemno = 60; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Character_Type_6'];};" \n + "" \n + "_model = dayz_selectGender;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Selection_Enabled + { + itemno = 66; + priority = 0.000000; + to="Region_Selection"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"dayz_spawnselection == 1"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Selection_Disabled + { + itemno = 67; + priority = 0.000000; + to="Spawn_Process_65"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"dayz_spawnselection == 0"/*%FSM*/; + action=/*%FSM*/"_spawnSelection=9;"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Region_Selection + { + name = "Region_Selection"; + itemno = 61; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Region_Selection'];};" \n + "endLoadingScreen;" \n + "" \n + "_timeNem=diag_tickTime;" \n + "_region = createDialog ""RscDisplaySpawnSelecter"";" \n + "" \n + "dayz_loadScreenMsg = localize 'str_login_spawnLocation';" \n + "_timeNem=diag_tickTime;_spawnSelection = 9;" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Region_Opened_22 + { + itemno = 91; + priority = 0.000000; + to="Waiting_for__Region"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_region"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class reopen_Region_85 + { + itemno = 85; + priority = 0.000000; + to="Region_Selection"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_region"/*%FSM*/; + action=/*%FSM*/"closeDialog 0;"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Region_Process_6 + { + name = "Region_Process_6"; + itemno = 63; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Region_Process_6, region selected:',_spawnSelection];};" \n + "_isNew = false;" \n + "_spawnSelection = dayz_selectRegion;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Character_Setup + { + itemno = 16; + priority = 0.000000; + to="Phase_One"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isNew"/*%FSM*/; + action=/*%FSM*/"_timeNemRegion = nil;" \n + "_timeNemGender = nil;" \n + ""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Spawn_Process_65 + { + name = "Spawn_Process_65"; + itemno = 65; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Spawn_Process_65'];};" \n + "_isNew = false;" \n + "dayz_selectRegion = 9;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Character_Setup + { + itemno = 16; + priority = 0.000000; + to="Phase_One"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isNew"/*%FSM*/; + action=/*%FSM*/"_timeNemRegion = nil;" \n + "_timeNemGender = nil;" \n + ""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class ERROR__Date_Time + { + name = "ERROR__Date_Time"; + itemno = 72; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'ERROR__Date_Time'];};_myTime = diag_tickTime;" \n + "" \n + "diag_log format[""Date and time not synced""];" \n + "dayz_loadScreenMsg = localize 'str_player_desync';" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class sleep + { + itemno = 73; priority = 0.000000; to="Disconnect"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(diag_tickTime - _myTime) > 120"/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _myTime) > 5"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class get_ready_to_clo_1 + { + name = "get_ready_to_clo_1"; + itemno = 74; + init = /*%FSM*/"diag_log ""Server authentication time out! Disconnect and try again!"";" \n + "dayz_loadScreenMsg = localize 'str_login_authentTimeout';" \n + "_myTime = diag_tickTime;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class sleep_ + { + itemno = 75; + priority = 0.000000; + to="Disconnect"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _myTime) > 2"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Waiting_for_Gender + { + name = "Waiting_for_Gender"; + itemno = 90; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Waiting_for_Gender'];};" \n + "" \n + "_timeNemGender = diag_tickTime;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Gender_Closed_84 + { + itemno = 84; + priority = 0.000000; + to="Gender_Selection"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"dayz_DisplayGenderSelect and !dialog"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Default_Male_215 + { + itemno = 86; + priority = 0.000000; + to="Character_Type_6"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"((diag_tickTime - _timeNemGender) > 60)"/*%FSM*/; + action=/*%FSM*/"dayz_selectGender = ""Survivor2_DZ"";"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Gender__Selected + { + itemno = 59; + priority = 0.000000; + to="Character_Type_6"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!dayz_DisplayGenderSelect"/*%FSM*/; + action=/*%FSM*/"_model = uiNameSpace getVariable 'dayz_selectGender';" \n + "" \n + "closeDialog 0;" \n + "" \n + "//startLoadingScreen ['','RscDisplayLoadCustom'];"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Waiting_for__Region + { + name = "Waiting_for__Region"; + itemno = 92; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Waiting_for__Region'];};" \n + "" \n + "_timeNemRegion = diag_tickTime;" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Default_Region_2 + { + itemno = 87; + priority = 0.000000; + to="Region_Process_6"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"((diag_tickTime - _timeNemRegion) > 60)"/*%FSM*/; + action=/*%FSM*/"dayz_selectRegion = 9;" \n + "" \n + "closeDialog 0;" \n + "" \n + "//startLoadingScreen ['','RscDisplayLoadCustom'];"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Region__Closed_2 + { + itemno = 94; + priority = 0.000000; + to="Region_Selection"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"dayz_DisplaySpawnSelecter and !dialog"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Region_Selected + { + itemno = 62; + priority = 0.000000; + to="Region_Process_6"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!dayz_DisplaySpawnSelecter"/*%FSM*/; + action=/*%FSM*/"_spawnSelection=uiNameSpace getVariable 'dayz_selectRegion';" \n + "closeDialog 0;" \n + "//startLoadingScreen ['','RscDisplayLoadCustom'];"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Update_player + { + name = "Update_player"; + itemno = 96; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Update_player'];};" \n + "dayz_loadScreenMsg = format[ localize 'str_player_ghost', _timeOut];" \n + "" \n + "_myTime = diag_tickTime;" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class retry_Login + { + itemno = 104; + priority = 0.000000; + to="Request"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_timeOut < 1"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class sleep + { + itemno = 97; + priority = 0.000000; + to="Reset"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _myTime) > 1"/*%FSM*/; + action=/*%FSM*/"_timeOut = _timeOut - 1;"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Ghost_System + { + name = "Ghost_System"; + itemno = 99; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Ghost_System'];};dayz_loadScreenMsg = localize 'str_login_ghostedPlayer';" \n + "" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Client_Ready + { + itemno = 100; + priority = 0.000000; + to="Parse_Login"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"//isNil ""PVCDZ_plr_Ghost""" \n + "" \n + "!(isNil ""PVCDZ_plr_PlayerAccepted"")"/*%FSM*/; + action=/*%FSM*/"PVCDZ_plr_PlayerAccepted = nil;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Client_Not_Ready + { + itemno = 95; + priority = 0.000000; + to="Update_player"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!(isNil ""PVCDZ_plr_Ghost"")"/*%FSM*/; + action=/*%FSM*/"_timeOut = (round (PVCDZ_plr_Ghost select 0));" \n + "PVCDZ_plr_Ghost = nil;"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Reset + { + name = "Reset"; + itemno = 101; + init = /*%FSM*/"" \n + "dayz_loadScreenMsg = format [localize 'str_player_ghost', _timeOut];" \n + "" \n + "_myTime = diag_tickTime;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class retry_Login + { + itemno = 104; + priority = 0.000000; + to="Request"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_timeOut < 1"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Sleep + { + itemno = 102; + priority = 0.000000; + to="Update_player"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _myTime) > 1"/*%FSM*/; + action=/*%FSM*/"_timeOut = _timeOut - 1;"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Finish_1 + { + name = "Finish_1"; + itemno = 106; + init = /*%FSM*/"if (_debug == 1) then {diag_log [diag_tickTime,'Finish'];};PVDZ_plr_LoginRecord = [_playerUID,_charID,0];" \n + "progressLoadingScreen 1;" \n + "publicVariableServer ""PVDZ_plr_LoginRecord"";" \n + "diag_log ['Sent to server: PVDZ_plr_LoginRecord', PVDZ_plr_LoginRecord]; " \n + "_world = toUpper(worldName); //toUpper(getText (configFile >> ""CfgWorlds"" >> (worldName) >> ""description""));" \n + "_nearestCity = nearestLocations [getPos player, [""NameCityCapital"",""NameCity"",""NameVillage"",""NameLocal""],1000];" \n + "Dayz_logonTown = ""Wilderness"";" \n + "if (count _nearestCity > 0) then {Dayz_logonTown = text (_nearestCity select 0)};" \n + "[_world,Dayz_logonTown,format[localize ""str_player_06"",dayz_Survived]] spawn { sleep 5; _this spawn BIS_fnc_infoText;};" \n + "dayzGearSave = true;" \n + "dayz_myPosition = getPosATL player;" \n + "Dayz_loginCompleted = true;" \n + "" \n + "//Other Counters" \n + " dayz_currentGlobalAnimals = count entities ""CAAnimalBase"";" \n + " dayz_currentGlobalZombies = count entities ""zZombie_Base"";"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class dayz_preloadFini + { + itemno = 107; + priority = 0.000000; + to="Finish"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"dayz_preloadFinished"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ @@ -1743,24 +2045,36 @@ class FSM class Player_Zombie__S { name = "Player_Zombie__S"; - itemno = 67; + itemno = 109; init = /*%FSM*/"_zssupported = [""pz_policeman"",""pz_suit1"",""pz_suit2"",""pz_worker1"",""pz_worker2"",""pz_worker3"",""pz_doctor"",""pz_teacher"",""pz_hunter"",""pz_villager1"",""pz_villager2"",""pz_villager3"",""pz_priest""];" \n "_model = (_zssupported select floor(random(count _zssupported)));" \n - "freshSpawn = 1;"/*%FSM*/; + "freshSpawn = 1;" \n + "dayz_preloadFinished=nil;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { - /*%FSM*/ - class Hive_Ok + /*%FSM*/ + class Selection_Enabled { - itemno = 18; + itemno = 66; priority = 0.000000; - to="Phase_One"; + to="Region_Selection"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; + condition=/*%FSM*/"dayz_spawnselection == 1"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ + /*%FSM*/ + class Selection_Disabled + { + itemno = 67; + priority = 0.000000; + to="Spawn_Process_65"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"dayz_spawnselection == 0"/*%FSM*/; + action=/*%FSM*/"_spawnSelection=9;"/*%FSM*/; + }; + /*%FSM*/ }; }; /*%FSM*/ diff --git a/SQF/dayz_code/system/player_monitor.sqf b/SQF/dayz_code/system/player_monitor.sqf index 1a462d50e..a45824a04 100644 --- a/SQF/dayz_code/system/player_monitor.sqf +++ b/SQF/dayz_code/system/player_monitor.sqf @@ -1,7 +1,7 @@ -if (isServer) then { +/*if (isServer) then { waitUntil{dayz_preloadFinished}; }; -_id = [] execFSM "\z\addons\dayz_code\system\player_monitor.fsm"; +_id = [] execFSM "\z\addons\dayz_code\system\player_monitor.fsm";*/ if (DZE_R3F_WEIGHT) then { _void = [] execVM "\z\addons\dayz_code\external\R3F_Realism\R3F_Realism_Init.sqf"; }; \ No newline at end of file diff --git a/SQF/dayz_code/system/player_spawn_1.sqf b/SQF/dayz_code/system/player_spawn_1.sqf index 44cd0ff32..1507632b7 100644 --- a/SQF/dayz_code/system/player_spawn_1.sqf +++ b/SQF/dayz_code/system/player_spawn_1.sqf @@ -1,3 +1,10 @@ +// moved to dayz_code/system/scheduler/sched_playerActions.sqf +// moved to dayz_code/system/scheduler/sched_spawncheck.sqf +// moved to dayz_code/system/scheduler/sched_newDay.sqf + + + +/* private ["_handle","_cursor","_delMe","_first","_town","_day","_world","_nearestCity"]; _timer = diag_tickTime; _timer1 = diag_tickTime; @@ -72,4 +79,5 @@ while {true} do { //wait uiSleep 0.001; -}; \ No newline at end of file +}; +*/ \ No newline at end of file diff --git a/SQF/dayz_code/system/player_spawn_2.sqf b/SQF/dayz_code/system/player_spawn_2.sqf index de041b963..30110b51d 100644 --- a/SQF/dayz_code/system/player_spawn_2.sqf +++ b/SQF/dayz_code/system/player_spawn_2.sqf @@ -1,37 +1,154 @@ -private ["_refObj","_size","_vel","_speed","_hunger","_thirst","_result","_factor","_distance","_lastTemp","_rnd","_listTalk","_id","_messTimer","_combatdisplay","_combatcontrol","_timeleft","_inVehicle","_lastUpdate","_foodVal","_thirstVal","_lowBlood","_startcombattimer","_combattimeout","_isPZombie","_outsideMap","_radsound","_bloodloss","_radTimer","_currentBlood","_wpnType","_dayzMags"]; +private ["_hunger","_thirst","_timeOut","_result","_randomSpot","_distance","_mylastPos","_lastTemp","_rnd","_listTalk","_messTimer","_PlayerNearby","_ZedsNearby","_saveTime"]; disableSerialization; - +_timeOut = 0; _messTimer = 0; -_radTimer = 0; _lastTemp = dayz_temperatur; - +_debug = getMarkerpos "respawn_west"; _isPZombie = player isKindOf "PZombie_VB"; +_timer = diag_tickTime; +_timer1 = diag_tickTime; +_spawnCheck = diag_tickTime; +_timer2 = diag_Ticktime; +_timer5 = diag_Ticktime; +_timer10 = diag_Ticktime; +_timer30 = diag_Ticktime; +_timer150 = diag_ticktime; + +_forceHumanity = false; + +_runonce = false; + +_timerMonitor = diag_ticktime; + player setVariable ["temperature",dayz_temperatur,true]; player setVariable["friendlies",DZE_Friends,true]; dayz_myLoad = (((count dayz_myBackpackMags) * 0.2) + (count dayz_myBackpackWpns)) + (((count dayz_myMagazines) * 0.1) + (count dayz_myWeapons * 0.5)); -while {true} do { +[player,0] call player_humanityChange; + +//player addMagazine "Hatchet_swing"; +//player addWeapon "MeleeHatchet"; + +while {1 == 1} do { + _start = diag_tickTime; //Initialize - _refObj = vehicle player; + _refObj = vehicle player; _factor = 0.6; _inVehicle = (_refObj != player); - // _size = (sizeOf typeOf _refObj) * _factor; - _vel = velocity player; - _speed = (round((_vel distance [0,0,0]) * 3.5)) min 18; + _size = (sizeOf typeOf _refObj) * 0.6; + _vel = velocity player; + _speed = round((_vel distance [0,0,0]) * 3.5); + _saveTime = (playersNumber west * 2) + 10; + + //reset rating always + if (((rating player) > 0) or ((rating player) < 0)) then { + player setUnitRank "PRIVATE"; + }; - // dayz_areaAffect = _size; +dayz_myLoad = (((count dayz_myBackpackMags) * 0.2) + (count dayz_myBackpackWpns)) + (((count dayz_myMagazines) * 0.1) + (count dayz_myWeapons * 0.5)); + + //reset position + _randomSpot = true; + _tempPos = getPosATL player; + _distance = _debug distance _tempPos; + if (_distance < 2000) then { + _randomSpot = false; + }; + _distance = [0,0,0] distance _tempPos; + if (_distance < 500) then { + _randomSpot = false; + }; + if (!isNil "_mylastPos") then { + _distance = _mylastPos distance _tempPos; + if (_distance > 400) then { + _randomSpot = false; + }; + }; + if (_randomSpot) then { + _mylastPos = _tempPos; + }; + if (!isNil "_mylastPos") then { + dayz_mylastPos = _mylastPos; + }; + dayz_areaAffect = _size; + + if (_speed > 0.1) then { + _timeOut = _timeOut + 1; + }; + + if (_timeOut > 150) then { + _humanity = player getVariable ["humanity",0]; + if (_humanity < 1 or _forceHumanity) then { + if (vehicle player != player) then { + [player, round(_timeOut / 10)] call player_humanityChange; + _forceHumanity = false; + } else { + _humanity = _humanity + round(_timeOut / 10); + player setVariable["humanity",_humanity,true]; + _forceHumanity = true; + }; + }; + _timeOut = 0; + }; + +/* + if ((Dayz_loginCompleted) && (diag_tickTime < 25)) then { + + [player,0] call player_humanityChange; + + diag_log ("Running"); + _timer10 = diag_Ticktime; + }; +*/ + + //reset OpenTarget variable if the timer has run out. + if (OpenTarget_Time > 0 && {diag_tickTime - OpenTarget_Time >= dayz_OpenTarget_TimerTicks}) then + { + player setVariable ["OpenTarget",false,true]; + }; + + if ((diag_tickTime - _timer150) > 60) then { + //Digest Food. + if (r_player_foodstack > 0) then { r_player_foodstack = r_player_foodstack - 1; }; + + _timer150 = diag_ticktime; + }; + + if ((diag_tickTime - _timer) > 300) then { + + //Other Counters + dayz_currentGlobalAnimals = count entities "CAAnimalBase"; + dayz_currentGlobalZombies = count entities "zZombie_Base"; + + //Animals + //[] call player_animalCheck; + + _timer = diag_tickTime; + }; + + //Every 30 seconds force the client to update the server of all medical Values + if ((diag_tickTime - _timer30) > 30) then { + [] spawn { + _medical = player call player_sumMedical; + + PVDZ_playerMedicalSync = [player,_medical]; + publicVariableServer "PVDZ_playerMedicalSync"; + }; + _timer30 = diag_tickTime; + }; + //Record Check - _lastUpdate = time - dayZ_lastPlayerUpdate; + _lastUpdate = diag_ticktime - dayZ_lastPlayerUpdate; if (_lastUpdate > 8) then { //POSITION? - _distance = dayz_myPosition distance _refObj; + _distance = dayz_myPosition distance player; if (_distance > 10) then { //Player has moved - dayz_myPosition = getPosATL _refObj; + dayz_myPosition = getPosATL player; // Check for radiation DZE_InRadiationZone = false; @@ -41,39 +158,74 @@ while {true} do { if((_outsideMap || DZE_Quarantine) && !r_player_dead && !isNull (findDisplay 46)) then { DZE_InRadiationZone = true; }; - player setVariable["posForceUpdate",true,true]; dayz_unsaved = true; - dayZ_lastPlayerUpdate = time; + dayZ_lastPlayerUpdate = diag_ticktime; }; }; - - //Hunger - _hunger = +((((r_player_bloodTotal - r_player_blood) / r_player_bloodTotal) * 5) + _speed + dayz_myLoad) * 3; - if (time - dayz_panicCooldown < 120) then { + + _hunger = (abs((((r_player_bloodTotal - r_player_blood) / r_player_bloodTotal) * 5) + _speed + dayz_myLoad) * 3); + if (diag_ticktime - dayz_panicCooldown < 120) then { _hunger = _hunger * 2; }; - dayz_hunger = dayz_hunger + (_hunger / 60); + dayz_hunger = dayz_hunger + (_hunger / 60); //60 Updated to 80 + dayz_hunger = (dayz_hunger min SleepFood) max 0; - //Thirst + if (dayz_hunger >= SleepFood) then { + if (r_player_blood < 10) then { + _id = [player,"starve"] spawn player_death; + }; + }; + +//Thirst _thirst = 2; + if (_refObj == player) then { + _thirst = (_speed + 4) * 3; + }; if (!_inVehicle) then { _thirst = (_speed + 4) * 3; }; - dayz_thirst = dayz_thirst + (_thirst / 60) * (dayz_temperatur / dayz_temperaturnormal); //TeeChange Temperatur effects added Max Effects: -25% && + 16.6% waterloss + dayz_thirst = dayz_thirst + (_thirst / 85) * (dayz_temperatur / dayz_temperaturnormal); //TeeChange Temperatur effects added Max Effects: -25% and + 16.6% waterloss + dayz_thirst = (dayz_thirst min SleepWater) max 0; + if (dayz_thirst >= SleepWater) then { + if (r_player_blood < 10) then { + _id = [player,"dehyd"] spawn player_death; + }; + }; + + //diag_log format ["playerSpawn2 %1/%2",dayz_hunger,dayz_thirst]; + + //Calories + if (dayz_nutrition > 0) then { + _Nutrition = dayz_nutrition; + _hunger = (abs((((r_player_bloodTotal - r_player_blood) / r_player_bloodTotal) * 5) + _speed + dayz_myLoad) * 3); + _thirst = 2; if (_refObj == player) then {_thirst = (_speed + 4) * 3;}; + _NutritionLoss = _Nutrition - (((_thirst / 1000) + (_hunger / 1000)) * (dayz_temperatur / dayz_temperaturnormal)); + r_player_Nutrition = [_NutritionLoss]; + } else { + r_player_Nutrition = [0]; + }; + dayz_nutrition = r_player_Nutrition select 0; + //Temperatur - 2 call player_temp_calculation; //2 = sleep time of this loop //TeeChange - if ((_lastTemp - dayz_temperatur) > 0.75 || (_lastTemp - dayz_temperatur) < -0.75 ) then { - player setVariable ["temperature",dayz_temperatur,true]; + 2 call player_temp_calculation; //2 = sleep time of this loop //TeeChange + if ((_lastTemp - dayz_temperatur) > 0.75 or (_lastTemp - dayz_temperatur) < -0.75 ) then { + player setVariable ["temperature",dayz_temperatur,false]; + + PVDZ_serverStoreVar = [player,"temperature",dayz_temperatur]; + publicVariableServer "PVDZ_serverStoreVar"; + _lastTemp = dayz_temperatur; }; + dayz_temperatur = (dayz_temperatur min dayz_temperaturmax) max dayz_temperaturmin; //can get nearby infection if (!r_player_infected && !_isPZombie) then { - //Infectionriskstart - if (dayz_temperatur < ((80 / 100) * (dayz_temperaturnormal - dayz_temperaturmin) + dayz_temperaturmin)) then { //TeeChange - _listTalk = (getPosATL _refObj) nearEntities ["CAManBase",8]; + // Infectionriskstart + if (dayz_temperatur < ((80 / 100) * (dayz_temperaturnormal - dayz_temperaturmin) + dayz_temperaturmin)) then { //TeeChange + private "_listTalk"; + _listTalk = _mylastPos nearEntities ["CAManBase",8]; // { if (_x getVariable["USEC_infected",false]) then { _rnd = (random 1) * (((dayz_temperaturnormal - dayz_temperatur) * (100 /(dayz_temperaturnormal - dayz_temperaturmin)))/ 50); //TeeChange @@ -86,7 +238,7 @@ while {true} do { }; }; } count _listTalk; - if (dayz_temperatur < ((50 / 100) * (dayz_temperaturnormal - dayz_temperaturmin) + dayz_temperaturmin)) then { //TeeChange + if (dayz_temperatur < ((50 / 100) * (dayz_temperaturnormal - dayz_temperaturmin) + dayz_temperaturmin)) then { //TeeChange _rnd = (random 1) * (((dayz_temperaturnormal - dayz_temperatur) * (100 /(dayz_temperaturnormal - dayz_temperaturmin)))/ 25); //TeeChange if (_rnd < 0.05) then { _rnd = random 1; @@ -97,48 +249,16 @@ while {true} do { }; }; }; - }; + }; - //If has infection reduce blood cough && add shake + //If has infection reduce blood cough and add shake if (r_player_infected) then { if !(player getVariable["USEC_infected",false]) then { player setVariable["USEC_infected",true,true]; }; - _rnd = ceil (random 8); - [player,"cough",_rnd,false,9] call dayz_zombieSpeak; - - if (_rnd < 3) then { - addCamShake [2, 1, 25]; - }; - if (r_player_blood > 3000) then { - r_player_blood = r_player_blood - 3; - }; - }; - - //Pain Shake Effects - if (r_player_inpain && !r_player_unconscious) then { - playSound "breath_1"; - addCamShake [2, 1, 25]; - }; - - //Hunger Effect - _foodVal = dayz_statusArray select 0; - _thirstVal = dayz_statusArray select 1; - if (_thirstVal <= 0) then { - _result = r_player_blood - 10; - if (_result < 0) then { - _id = [player,"dehyd"] spawn player_death; - } else { - r_player_blood = _result; - }; - }; - if (_foodVal <= 0) then { - _result = r_player_blood - 10; - if (_result < 0) then { - _id = [player,"starve"] spawn player_death; - } else { - r_player_blood = _result; + if (r_player_blood < 3) then { + _id = [player,"sick"] spawn player_death; }; }; @@ -172,91 +292,181 @@ while {true} do { _radTimer = 0; }; - // Health uptick when healty not thirsty || hungry - if (_foodVal >= 0.9 && _thirstVal >= 0.9) then { - if (!r_player_infected && !r_player_inpain && !r_player_injured && !DZE_InRadiationZone) then { - _result = r_player_blood + 10; - if (_result >= r_player_bloodTotal) then { - r_player_blood = r_player_bloodTotal; - } else { - r_player_blood = _result; + // Regen some blood if player is well fed and resting + // Attention: regen _result must not trigger the "up" arrow of the blood icon + if (r_player_blood < 12000 and dayz_hunger < SleepFood + and dayz_thirst < SleepWater and !r_player_injured + and !r_player_infected and !(r_player_Sepsis select 0) + and !r_player_unconscious) then { + _result = (1-(dayz_hunger + dayz_thirst)/(SleepWater + SleepFood)); + switch (1==1) do { + case (_result < 0.25) : {}; // not well fed + case ((toArray(animationState player) select 5) == 112) : { // prone + _result = _result * (1 + 10 * (12000 - r_player_blood) / 12000); + }; + case (speed player < 1) : { // still + _result = _result * (1 + 4 * sqrt((12000 - r_player_blood) / 12000)); + }; + default { // moving }; }; + r_player_bloodregen = r_player_bloodregen + _result; + }; + + if (r_player_blood > 12000) then { + r_player_blood = 12000; }; - //Record low blood + //Record low bloow _lowBlood = player getVariable ["USEC_lowBlood", false]; - if ((r_player_blood < r_player_bloodTotal) && !_lowBlood) then { + if ((r_player_blood < r_player_bloodTotal) and !_lowBlood) then { player setVariable["USEC_lowBlood",true,true]; }; //Broadcast Hunger/Thirst _messTimer = _messTimer + 1; - if (_messTimer > 15) then { + if (_messTimer > 60) then { _messTimer = 0; - player setVariable ["messing",[dayz_hunger,dayz_thirst],true]; - }; - - // Update blood only if PVAR does not match GVAR. - _currentBlood = player getVariable ["USEC_BloodQty", 12000]; - if (_currentBlood != r_player_blood) then { - player setVariable["USEC_BloodQty",r_player_blood,true]; + player setVariable ["messing",[dayz_hunger,dayz_thirst,dayz_nutrition],false]; + + PVDZ_serverStoreVar = [player,"messing",[dayz_hunger,dayz_thirst,dayz_nutrition]]; + publicVariableServer "PVDZ_serverStoreVar"; }; //Save Checker - if (dayz_unsaved) then { - if ((time - dayz_lastSave) > DZE_SaveTime) then { - _dayzMags = if (!isNil "dayz_Magazines" && {typeName dayz_Magazines == "ARRAY"} && {count dayz_Magazines > 0}) then {dayz_Magazines} else {magazines player}; - PVDZE_plr_Save = [player,_dayzMags,false,false]; - publicVariableServer "PVDZE_plr_Save"; + if (dayz_unsaved or ((diag_ticktime - dayz_lastSave) > 300)) then { + if ((diag_ticktime - dayz_lastSave) > _saveTime) then { + + PVDZ_plr_Save = [player,nil,false,dayz_playerAchievements]; + publicVariableServer "PVDZ_plr_Save"; + + PVDZ_serverStoreVar = [player,"Achievements",dayz_playerAchievements]; + publicVariableServer "PVDZ_serverStoreVar"; + player setVariable ["Achievements",dayz_playerAchievements,false]; + + if (isServer) then { + PVDZ_plr_Save call server_playerSync; + }; + dayz_unsaved = false; - dayz_lastSave = time; - dayz_Magazines = []; + dayz_lastSave = diag_ticktime; }; }; - // If in combat, display counter && restrict logout - _startcombattimer = player getVariable["startcombattimer",0]; - if (_startcombattimer == 1) then { - player setVariable["combattimeout", time + 30, true]; - player setVariable["startcombattimer", 0]; - dayz_combat = 1; - }; + // sort out pickup actions + _isOK = (pickupInit and !canPickup) or (!pickupInit and canPickup); - _combattimeout = player getVariable["combattimeout",0]; - if (_combattimeout > 0) then { - _timeleft = _combattimeout - time; - if (_timeleft > 0) then { - //hintSilent format["In Combat: %1",round(_timeleft)]; - } else { - //hintSilent "Not in Combat"; - player setVariable["combattimeout", 0, true]; - dayz_combat = 0; - _combatdisplay = uiNamespace getVariable 'DAYZ_GUI_display'; - _combatcontrol = _combatdisplay displayCtrl 1307; - _combatcontrol ctrlShow true; + if (_isOK) then { + if (pickupInit and !canPickup) then { + canPickup = true; + pickupInit = false; }; } else { - //hintSilent "Not in Combat"; - dayz_combat = 0; - _combatdisplay = uiNamespace getVariable 'DAYZ_GUI_display'; - _combatcontrol = _combatdisplay displayCtrl 1307; - _combatcontrol ctrlShow true; + // reset + canPickup = false; + pickupInit = true; + }; + + _PlayerNearby = false; + _ZedsNearby = false; + if ({isPlayer _x} count (player nearEntities ["AllVehicles", 5]) > 1) then { + _PlayerNearby = true; + }; + if (count (player nearEntities ["zZombie_Base", 10]) > 0) then { + _ZedsNearby = true; + }; + + _startcombattimer = player getVariable["startcombattimer", 0]; + if (_startcombattimer == 1 || _PlayerNearby) then { + player setVariable["combattimeout", diag_tickTime + 30, false]; + player setVariable["startcombattimer", 0, false]; + } else { + if (_ZedsNearby) then { + player setVariable["combattimeout", diag_tickTime + 10, false]; + player setVariable["startcombattimer", 0, false]; + }; + }; + //setGroupIconsVisible [false,false]; + //clearGroupIcons group player; + + sleep 2; + + _myPos = player getVariable["lastPos",[]]; + if (count _myPos > 0) then { + player setVariable["lastPos",_mylastPos, true]; + player setVariable["lastPos",[]]; }; //Melee Weapons ammo fix - if(isNil {login_ammochecked}) then { - login_ammochecked = true; - _wpnType = primaryWeapon player; - _ismelee = (gettext (configFile >> "CfgWeapons" >> _wpnType >> "melee")); - if (_ismelee == "true") then { - call dayz_meleeMagazineCheck; - }; - }; + if(isNil {login_ammochecked}) then { + login_ammochecked = true; + _wpnType = primaryWeapon player; + _ismelee = (getNumber (configFile >> "CfgWeapons" >> _wpnType >> "melee") == 1); + if (_ismelee) then { + call dayz_meleeMagazineCheck; + }; + }; + + if ((diag_tickTime - _timer1) > 10) then { + _position = getPosATL player; + _zeds = _position nearEntities ["zZombie_Base",200]; + dayz_spawnZombies = 0; + dayz_CurrentNearByZombies = 0; + //Current amounts + { + if (alive _x) then { + if (local _x) then { + dayz_spawnZombies = dayz_spawnZombies + 1; + }; + dayz_CurrentNearByZombies = dayz_CurrentNearByZombies + 1; + }; + } count _zeds; + + //dayz_spawnZombies = {alive _x AND local _x} count (_position nearEntities ["zZombie_Base",400]); + //dayz_CurrentNearByZombies = {alive _x} count (_position nearEntities ["zZombie_Base",400]); + dayz_currentWeaponHolders = count (_position nearObjects ["ReammoBox",200]); + + //Remove empty cardborad box's << this needs to be changed moved (action menu or close button) + { + //get contents + _weapons = getWeaponCargo _x; + diag_log (str(_weapons)); + _magazines = getMagazineCargo _x; + diag_log (str(_magazines)); + _backpacks = getBackpackCargo _x; + diag_log (str(_backpacks)); + + if ((count (_weapons select 0) < 1) and (count (_magazines select 0) < 1) and (count (_backpacks select 0) < 1)) then { + + //remove vehicle, Need to ask server to remove. + PVDZ_obj_Delete = [_x,player]; + diag_log (str(PVDZ_obj_Delete)); + publicVariableServer "PVDZ_obj_Delete"; + }; + + } count (_position nearObjects ["CardboardBox",10]); + + _timer1 = diag_tickTime; + }; + + //Two primary guns pickup exploit fix + if ((primaryWeapon player != "") && (!(primaryWeapon player in MeleeWeapons)) && (dayz_onBack != "") && (!(dayz_onBack in MeleeWeapons)) && (isNull (findDisplay 106)) && + (animationState player != "amovpknlmstpslowwrfldnon_amovpknlmstpsraswrfldnon" OR animationState player != "amovpercmstpslowwrfldnon_amovpercmstpsraswrfldnon" OR animationState player != "amovpercmstpslowwrfldnon_amovpercmstpsraswrfldnon")) then { + cutText [localize "str_player_ammo_2primary","PLAIN DOWN"]; + player playActionNow "stop"; + player action ["dropWeapon", player, primaryWeapon player]; + //sleep 3; + //["gear"] call player_switchWeapon; + //sleep 1; + }; - // Blood Effects - "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, (r_player_blood/r_player_bloodTotal)], [1, 1, 1, 0.0]]; - "colorCorrections" ppEffectCommit 0; - - uiSleep 2; -}; + //Crowbar ammo fix + //"MeleeCrowbar" call dayz_meleeMagazineCheck; + _stop = diag_tickTime; + /* + if ((diag_tickTime - _timerMonitor) > 60) then { + diag_log format ["Loop Monitor - Spawn2: %1, DA: %2, UA: %3, SA: %4",(_stop - _start),(diag_tickTime - (player getVariable "damageActions")),(diag_tickTime - (player getVariable "upgradeActions")),(diag_tickTime - (player getVariable "selfActions"))]; + _timerMonitor = diag_ticktime; + }; + */ +}; \ No newline at end of file diff --git a/SQF/dayz_code/system/progress_monitor.sqf b/SQF/dayz_code/system/progress_monitor.sqf new file mode 100644 index 000000000..503bc3467 --- /dev/null +++ b/SQF/dayz_code/system/progress_monitor.sqf @@ -0,0 +1,26 @@ +private["_display","_control1","_control2"]; +disableSerialization; +//diag_log "DEBUG: loadscreen guard started."; + +_timeoutStart=diag_ticktime; +while {true} do { + if (diag_ticktime - _timeoutStart >= 120) exitWith { + 1 cutText [localize "str_player_login_timeout", "PLAIN DOWN"]; + sleep 5; + endMission "END1"; + }; + if ((!isNil "Dayz_loginCompleted") and {(Dayz_loginCompleted)}) exitWith { + //diag_log [ __FILE__, __LINE__, "End loop"]; + }; + _display = uiNameSpace getVariable "BIS_loadingScreen"; + if ((!isNil "_display") and {(dayz_loadScreenMsg != "" )}) then { + _control1 = _display displayctrl 8400; + _control1 ctrlSetText dayz_loadScreenMsg; + }; + _control2 = _display displayctrl 102; + _control2 ctrlSetText format["%1",floor(diag_ticktime - _timeoutStart)]; + + sleep 0.2; + //diag_log [ __FILE__, __LINE__, "Looping..."]; +}; + diff --git a/SQF/dayz_code/system/server_monitor.sqf b/SQF/dayz_code/system/server_monitor.sqf index 508d87390..26be72c7a 100644 --- a/SQF/dayz_code/system/server_monitor.sqf +++ b/SQF/dayz_code/system/server_monitor.sqf @@ -1,2 +1,2 @@ -waitUntil{!isnil "bis_fnc_init"}; -execVM "\z\addons\dayz_server\system\server_monitor.sqf"; \ No newline at end of file +//waitUntil{!isnil "bis_fnc_init"}; +//execVM "\z\addons\dayz_server\system\server_monitor.sqf"; \ No newline at end of file diff --git a/SQF/dayz_code/system/zombie_agent.fsm b/SQF/dayz_code/system/zombie_agent.fsm index 8560ca6e3..46626f975 100644 --- a/SQF/dayz_code/system/zombie_agent.fsm +++ b/SQF/dayz_code/system/zombie_agent.fsm @@ -1,707 +1,956 @@ -/*%FSM*/ +/*%FSM*/ /*%FSM*/ /* -item0[] = {"init",0,250,-75.000000,-250.000000,25.000000,-200.000000,0.000000,"init"}; +item0[] = {"init",0,250,50.000000,-400.000000,150.000000,-350.000000,0.000000,"init"}; item1[] = {"End",1,250,175.000000,-250.000000,275.000000,-200.000000,0.000000,"End"}; item2[] = {"wait",4,218,-75.000000,0.000000,25.000000,50.000000,0.000000,"wait"}; item3[] = {"Looking_for_Targ",2,250,-75.000000,75.000000,25.000000,125.000000,0.000000,"Looking for" \n "Target"}; -item4[] = {"Not_Alive",4,218,0.000000,300.000000,100.000000,350.000000,5.000000,"Not" \n "Alive"}; -item5[] = {"Nobody_Near",4,218,0.000000,375.000000,100.000000,425.000000,4.000000,"Nobody" \n "Near"}; -item6[] = {"loiter",4,218,-325.000000,0.000000,-225.000000,50.000000,0.000000,"loiter"}; -item7[] = {"Loiter",2,250,-325.000000,75.000000,-225.000000,125.000000,0.000000,"Loiter"}; -item8[] = {"In_Position",4,218,-200.000000,75.000000,-100.000000,125.000000,1.000000,"In Position"}; -item9[] = {"",7,210,-29.000042,321.000000,-20.999958,329.000000,0.000000,""}; -item10[] = {"",7,210,-29.000042,395.999939,-20.999958,404.000061,0.000000,""}; -item11[] = {"true",8,218,-75.000000,-175.000000,25.000000,-125.000000,0.000000,"true"}; -item12[] = {"Begin",2,250,-75.000000,-100.000000,25.000000,-50.000000,0.000000,"Begin"}; -item13[] = {"",7,210,-29.000006,-29.000004,-20.999996,-20.999996,0.000000,""}; -item14[] = {"",7,210,-279.000061,-29.000004,-270.999969,-20.999996,0.000000,""}; -item15[] = {"",7,210,-254.000046,146.000000,-245.999954,154.000000,0.000000,""}; -item16[] = {"Has_Target",4,218,-150.000000,225.000000,-50.000000,275.000000,1.000000,"Has" \n "Target"}; -item17[] = {"Chase",2,4346,-150.000000,300.000000,-50.000000,350.000000,0.000000,"Chase"}; -item18[] = {"Time_Check",4,218,50.000000,75.000000,150.000000,125.000000,0.000000,"Time" \n "Check"}; -item19[] = {"",7,210,-29.000006,146.000000,-20.999996,154.000000,0.000000,""}; -item20[] = {"",7,210,-29.000006,196.000000,-20.999996,204.000000,0.000000,""}; -item21[] = {"",7,210,-104.000000,196.000000,-95.999992,204.000000,0.000000,""}; -item22[] = {"Time_Check",4,218,-450.000000,75.000000,-350.000000,125.000000,0.000000,"Time" \n "Check"}; -item23[] = {"Time_Check",4,218,-275.000000,300.000000,-175.000000,350.000000,0.000000,"Time" \n "Check"}; -item24[] = {"No_Target",4,218,-275.000000,375.000000,-175.000000,425.000000,3.000000,"No" \n "Target"}; -item25[] = {"",7,210,-479.000000,396.000000,-471.000000,404.000000,0.000000,""}; -item26[] = {"",7,210,-479.000000,146.000000,-471.000000,154.000000,0.000000,""}; -item27[] = {"",7,210,221.000000,321.000000,229.000000,329.000000,0.000000,""}; -item28[] = {"",7,210,221.000000,396.000000,229.000000,404.000000,0.000000,""}; -item29[] = {"Cleanup_",2,250,175.000000,200.000000,275.000000,250.000000,0.000000,"Cleanup?"}; -item30[] = {"nobody_around",4,218,175.000000,-25.000000,275.000000,25.000000,0.000000,"nobody" \n "around"}; -item31[] = {"",7,210,-104.000023,396.000000,-95.999992,404.000000,0.000000,""}; -item32[] = {"cant_see",4,218,-275.000000,450.000000,-175.000000,500.000000,2.000000,"cant" \n "see"}; -item33[] = {"Finish_Move",2,250,-275.000000,525.000000,-175.000000,575.000000,0.000000,"Finish" \n "Move"}; -item34[] = {"finished",4,218,-425.000000,525.000000,-325.000000,575.000000,1.000000,"finished"}; -item35[] = {"",7,210,-479.000000,546.000000,-471.000000,554.000000,0.000000,""}; -item36[] = {"",7,210,-29.000002,546.000000,-20.999998,554.000000,0.000000,""}; -item37[] = {"",7,210,-304.000000,146.000000,-296.000000,154.000000,0.000000,""}; -item38[] = {"someone_here",4,218,300.000000,200.000000,400.000000,250.000000,0.000000,"someone" \n "here"}; -item39[] = {"wait",2,250,300.000000,125.000000,400.000000,175.000000,0.000000,"wait"}; -item40[] = {"time_up",4,218,300.000000,-25.000000,400.000000,25.000000,0.000000,"time" \n "up"}; -item41[] = {"",7,210,346.000000,95.999992,354.000000,104.000000,0.000000,""}; -item42[] = {"",7,210,221.000000,96.000008,229.000000,103.999977,0.000000,""}; -item43[] = {"Time_Check",4,218,425.000000,125.000000,525.000000,175.000000,0.000000,"Time" \n "Check"}; -item44[] = {"",7,210,346.000000,-79.000000,354.000000,-71.000000,0.000000,""}; -item45[] = {"",7,210,221.000000,-79.000000,229.000000,-71.000000,0.000000,""}; -item46[] = {"too_long",4,218,-425.000000,600.000000,-325.000000,650.000000,0.000000,"too long"}; -item47[] = {"",7,210,-229.000000,621.000000,-221.000000,629.000000,0.000000,""}; -item48[] = {"",7,210,-479.000000,621.000000,-471.000000,629.000000,0.000000,""}; -item49[] = {"Reset_Targeting",2,250,-525.000000,325.000000,-425.000000,375.000000,0.000000,"Reset" \n "Targeting"}; -item50[] = {"true",8,218,-525.000000,250.000000,-425.000000,300.000000,0.000000,"true"}; -item51[] = {"deleted",4,218,425.000000,-25.000000,525.000000,25.000000,0.000000,"deleted"}; -item52[] = {"",7,210,471.000000,-79.000000,479.000000,-71.000000,0.000000,""}; -item53[] = {"",7,210,471.000000,95.999977,479.000000,104.000023,0.000000,""}; -item54[] = {"",7,210,-104.000000,471.000000,-95.999992,479.000000,0.000000,""}; -item55[] = {"player_check",4,218,-450.000000,0.000000,-350.000000,50.000000,0.000000,"player" \n "check"}; -item56[] = {"player_check",4,218,50.000000,0.000000,150.000000,50.000000,0.000000,"player" \n "check"}; -item57[] = {"is_Dedicated",4,218,50.000000,-250.000000,150.000000,-200.000000,5.000000,"is" \n "Dedicated"}; -link0[] = {0,11}; -link1[] = {0,57}; +item4[] = {"Not_Alive",4,218,25.000000,375.000000,125.000000,425.000000,5.000000,"Not" \n "Alive"}; +item5[] = {"Nobody_Near",4,218,25.000000,450.000000,125.000000,500.000000,6.000000,"Nobody" \n "Near"}; +item6[] = {"loiter",4,218,-400.000000,0.000000,-300.000000,50.000000,0.000000,"loiter"}; +item7[] = {"Loiter",2,250,-400.000000,75.000000,-300.000000,125.000000,0.000000,"Loiter"}; +item8[] = {"",7,210,-29.000042,396.000000,-20.999958,404.000000,0.000000,""}; +item9[] = {"",7,210,-29.000042,470.999939,-20.999958,479.000061,0.000000,""}; +item10[] = {"true",8,218,-75.000000,-400.000000,25.000000,-350.000000,0.000000,"true"}; +item11[] = {"Begin",2,250,-75.000000,-150.000000,25.000000,-100.000000,0.000000,"Begin"}; +item12[] = {"",7,210,-29.000006,-29.000004,-20.999996,-20.999996,0.000000,""}; +item13[] = {"",7,210,-354.000092,-29.000004,-345.999908,-20.999996,0.000000,""}; +item14[] = {"",7,210,-329.000031,208.500000,-321.000000,216.500000,0.000000,""}; +item15[] = {"Has_Target",4,218,-150.000000,275.000000,-50.000000,325.000000,5.000000,"Has" \n "Target"}; +item16[] = {"Chase",2,250,-150.000000,375.000000,-50.000000,425.000000,0.000000,"Chase"}; +item17[] = {"Time_Check",4,218,50.000000,75.000000,150.000000,125.000000,1.000000,"Time" \n "Check"}; +item18[] = {"",7,210,-29.000006,208.500000,-20.999996,216.500000,0.000000,""}; +item19[] = {"",7,210,-29.000006,296.000000,-20.999996,304.000031,0.000000,""}; +item20[] = {"Time_Check",4,218,-275.000000,75.000000,-175.000000,125.000000,0.000000,"Time" \n "Check"}; +item21[] = {"Check",8,218,-300.000000,300.000000,-200.000000,350.000000,1.000000,"Check"}; +item22[] = {"No_Target",4,218,-400.000000,450.000000,-300.000000,500.000000,3.000000,"No" \n "Target"}; +item23[] = {"",7,210,-479.000000,471.000000,-471.000000,479.000000,0.000000,""}; +item24[] = {"",7,210,-479.000000,208.500000,-471.000000,216.500000,0.000000,""}; +item25[] = {"",7,210,221.000000,396.000000,229.000000,404.000000,0.000000,""}; +item26[] = {"",7,210,221.000000,471.000000,229.000000,479.000000,0.000000,""}; +item27[] = {"Cleanup_",2,250,175.000000,200.000000,275.000000,250.000000,0.000000,"Cleanup?"}; +item28[] = {"nobody_around",4,218,175.000000,-25.000000,275.000000,25.000000,0.000000,"nobody" \n "around"}; +item29[] = {"",7,210,-104.000023,471.000000,-95.999985,479.000000,0.000000,""}; +item30[] = {"cant_see",4,218,-275.000000,575.000000,-175.000000,625.000000,2.000000,"cant" \n "see"}; +item31[] = {"Finish_Move",2,250,-275.000000,650.000000,-175.000000,700.000000,0.000000,"Finish" \n "Move"}; +item32[] = {"finished",4,218,-425.000000,650.000000,-325.000000,700.000000,1.000000,"finished"}; +item33[] = {"",7,210,-479.000000,671.000000,-471.000000,679.000000,0.000000,""}; +item34[] = {"",7,210,-29.000002,671.000000,-20.999998,679.000000,0.000000,""}; +item35[] = {"",7,210,-404.000000,208.500000,-396.000000,216.500000,0.000000,""}; +item36[] = {"someone_here",4,218,300.000000,200.000000,400.000000,250.000000,0.000000,"someone" \n "here"}; +item37[] = {"wait",2,250,300.000000,125.000000,400.000000,175.000000,0.000000,"wait"}; +item38[] = {"time_up",4,218,300.000000,-25.000000,400.000000,25.000000,0.000000,"time" \n "up"}; +item39[] = {"",7,210,346.000000,95.999992,354.000000,104.000000,0.000000,""}; +item40[] = {"",7,210,221.000000,96.000008,229.000000,103.999977,0.000000,""}; +item41[] = {"Time_Check",4,218,425.000000,125.000000,525.000000,175.000000,0.000000,"Time" \n "Check"}; +item42[] = {"",7,210,346.000000,-79.000000,354.000000,-71.000000,0.000000,""}; +item43[] = {"",7,210,221.000000,-79.000000,229.000000,-71.000000,0.000000,""}; +item44[] = {"too_long",4,218,-425.000000,725.000000,-325.000000,775.000000,0.000000,"too long"}; +item45[] = {"",7,210,-229.000000,746.000000,-221.000000,754.000000,0.000000,""}; +item46[] = {"",7,210,-479.000000,746.000000,-471.000000,754.000000,0.000000,""}; +item47[] = {"Reset_Targeting",2,250,-525.000000,325.000000,-425.000000,375.000000,0.000000,"Reset" \n "Targeting"}; +item48[] = {"true",8,218,-525.000000,250.000000,-425.000000,300.000000,0.000000,"true"}; +item49[] = {"deleted",4,218,425.000000,-25.000000,525.000000,25.000000,0.000000,"deleted"}; +item50[] = {"",7,210,471.000000,-79.000000,479.000000,-71.000000,0.000000,""}; +item51[] = {"",7,210,471.000000,95.999977,479.000000,104.000023,0.000000,""}; +item52[] = {"",7,210,-104.000000,596.000000,-95.999992,604.000000,0.000000,""}; +item53[] = {"player_check",4,218,-525.000000,75.000000,-425.000000,125.000000,2.000000,"player" \n "check"}; +item54[] = {"player_check",4,218,50.000000,0.000000,150.000000,50.000000,2.000000,"player" \n "check"}; +item55[] = {"is_Dedicated",4,218,50.000000,-250.000000,150.000000,-200.000000,5.000000,"is" \n "Dedicated"}; +item56[] = {"MoveCompleted_",4,218,-525.000000,-75.000000,-425.000000,-25.000000,3.000000,"MoveCompleted "}; +item57[] = {"Failed_Move",4,218,-675.000000,-100.000000,-575.000000,-50.000000,3.000000,"Failed Move"}; +item58[] = {"Target_Dead",4,218,-275.000000,500.000000,-175.000000,550.000000,3.000000,"Target Dead"}; +item59[] = {"",7,210,-479.000000,521.000000,-471.000000,529.000000,0.000000,""}; +item60[] = {"Start_Attack",4,218,-725.000000,175.000000,-625.000000,225.000000,0.000000,"Start Attack"}; +item61[] = {"End_Attack",4,218,-725.000000,100.000000,-625.000000,150.000000,0.000000,"End Attack"}; +item62[] = {"TargetMoved",4,218,50.000000,300.000000,150.000000,350.000000,3.000000,"TargetMoved"}; +item63[] = {"Not_moving",4,218,-300.000000,150.000000,-200.000000,200.000000,1.000000,"Not moving"}; +item64[] = {"TimeOut",8,4314,-300.000000,375.000000,-200.000000,425.000000,2.000000,"TimeOut"}; +item65[] = {"____FAKE____",9,32,0.000000,0.000000,0.000000,0.000000,0.000000,"____FAKE____"}; +link0[] = {0,10}; +link1[] = {0,55}; link2[] = {2,3}; -link3[] = {3,18}; -link4[] = {3,19}; -link5[] = {3,56}; -link6[] = {4,27}; -link7[] = {5,28}; +link3[] = {3,17}; +link4[] = {3,18}; +link5[] = {3,54}; +link6[] = {4,25}; +link7[] = {5,26}; link8[] = {6,7}; -link9[] = {7,8}; -link10[] = {7,15}; -link11[] = {7,22}; -link12[] = {7,55}; -link13[] = {8,7}; -link14[] = {9,4}; -link15[] = {9,10}; -link16[] = {10,5}; -link17[] = {11,12}; +link9[] = {7,14}; +link10[] = {7,20}; +link11[] = {7,53}; +link12[] = {8,4}; +link13[] = {8,9}; +link14[] = {9,5}; +link15[] = {10,11}; +link16[] = {11,12}; +link17[] = {12,2}; link18[] = {12,13}; -link19[] = {13,2}; -link20[] = {13,14}; -link21[] = {14,6}; -link22[] = {15,19}; -link23[] = {16,17}; -link24[] = {17,9}; -link25[] = {17,23}; -link26[] = {17,31}; -link27[] = {18,3}; -link28[] = {19,20}; -link29[] = {20,9}; -link30[] = {20,21}; -link31[] = {21,16}; -link32[] = {22,7}; -link33[] = {23,17}; -link34[] = {24,25}; -link35[] = {25,49}; -link36[] = {26,37}; -link37[] = {27,29}; -link38[] = {28,27}; -link39[] = {29,38}; -link40[] = {29,42}; -link41[] = {30,45}; -link42[] = {31,24}; -link43[] = {31,54}; -link44[] = {32,33}; -link45[] = {33,34}; -link46[] = {33,36}; -link47[] = {33,47}; -link48[] = {34,35}; -link49[] = {35,25}; -link50[] = {36,10}; -link51[] = {37,7}; -link52[] = {38,39}; -link53[] = {39,41}; -link54[] = {39,43}; -link55[] = {40,44}; -link56[] = {41,40}; -link57[] = {41,42}; -link58[] = {41,53}; -link59[] = {42,30}; -link60[] = {43,39}; -link61[] = {44,45}; -link62[] = {45,1}; -link63[] = {46,48}; -link64[] = {47,46}; -link65[] = {48,35}; -link66[] = {49,50}; -link67[] = {50,26}; -link68[] = {51,52}; -link69[] = {52,44}; -link70[] = {53,51}; -link71[] = {54,32}; -link72[] = {55,7}; -link73[] = {56,3}; -link74[] = {57,1}; -globals[] = {25.000000,1,0,0,0,640,480,1,98,6316128,1,-542.928589,768.370728,784.378479,-389.521301,983,910,1}; -window[] = {2,-1,-1,-1,-1,962,182,1390,182,3,1001}; +link19[] = {13,6}; +link20[] = {14,18}; +link21[] = {15,16}; +link22[] = {16,8}; +link23[] = {16,29}; +link24[] = {16,64}; +link25[] = {17,3}; +link26[] = {18,19}; +link27[] = {19,8}; +link28[] = {19,15}; +link29[] = {20,7}; +link30[] = {22,23}; +link31[] = {23,47}; +link32[] = {24,35}; +link33[] = {25,27}; +link34[] = {26,25}; +link35[] = {27,36}; +link36[] = {27,40}; +link37[] = {28,43}; +link38[] = {29,22}; +link39[] = {29,52}; +link40[] = {29,58}; +link41[] = {30,31}; +link42[] = {31,32}; +link43[] = {31,34}; +link44[] = {31,45}; +link45[] = {32,33}; +link46[] = {33,59}; +link47[] = {34,9}; +link48[] = {35,7}; +link49[] = {36,37}; +link50[] = {37,39}; +link51[] = {37,41}; +link52[] = {38,42}; +link53[] = {39,38}; +link54[] = {39,40}; +link55[] = {39,51}; +link56[] = {40,28}; +link57[] = {41,37}; +link58[] = {42,43}; +link59[] = {43,1}; +link60[] = {44,46}; +link61[] = {45,44}; +link62[] = {46,33}; +link63[] = {47,48}; +link64[] = {48,24}; +link65[] = {49,50}; +link66[] = {50,42}; +link67[] = {51,49}; +link68[] = {52,30}; +link69[] = {53,7}; +link70[] = {54,3}; +link71[] = {55,1}; +link72[] = {58,59}; +link73[] = {59,23}; +link74[] = {64,16}; +link75[] = {21,65}; +link76[] = {65,21}; +link77[] = {56,65}; +link78[] = {65,56}; +link79[] = {57,65}; +link80[] = {65,57}; +link81[] = {60,65}; +link82[] = {65,60}; +link83[] = {61,65}; +link84[] = {65,61}; +link85[] = {62,65}; +link86[] = {65,62}; +link87[] = {63,65}; +link88[] = {65,63}; +globals[] = {0.000000,0,0,0,0,640,480,1,157,6316128,1,-710.729492,237.694336,750.737427,47.068176,806,1004,1}; +window[] = {2,-1,-1,-1,-1,805,104,1312,104,3,824}; *//*%FSM*/ class FSM { - fsmName = "DayZ Zombie Agent"; - class States - { - /*%FSM*/ - class init - { - name = "init"; - init = /*%FSM*/"_position = _this select 0;" \n - "_agent = _this select 1;" \n - "_secondHand = false;" \n - "" \n - "if (count _this > 2) then {" \n - " _secondHand = true;" \n - " //diag_log (""Second Hand Zombie Initialized: "" + str(_this));" \n - "};"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class is_Dedicated + fsmName = "DayZ Zombie Agent"; + class States { - priority = 5.000000; - to="End"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"isDedicated"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; + /*%FSM*/ + class init + { + name = "init"; + itemno = 0; + init = /*%FSM*/"_position = _this select 0;" \n + "_agent = _this select 1;" \n + "_secondHand = false;" \n + "" \n + "if (count _this > 2) then {" \n + " _secondHand = true;" \n + " //diag_log (""Second Hand Zombie Initialized: "" + str(_this));" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class is_Dedicated + { + itemno = 55; + priority = 5.000000; + to="End"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"isDedicated"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class true + { + itemno = 10; + priority = 0.000000; + to="Begin"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"dayz_clientPreload and !(isNull _agent)"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class End + { + name = "End"; + itemno = 1; + init = /*%FSM*/"if (!isDedicated) then {" \n + " if (!isNull _agent) then {" \n + " deleteVehicle _agent;" \n + " //dayz_spawnZombies = dayz_spawnZombies - 1;" \n + " };" \n + "} else {" \n + " [_agent] call zombie_findOwner;" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + }; + }; + /*%FSM*/ + /*%FSM*/ + class Looking_for_Targ + { + name = "Looking_for_Targ"; + itemno = 3; + init = /*%FSM*/"_isAlive = alive _agent;" \n + "_target = _agent call zombie_findTargetAgent;" \n + "_timeN = diag_tickTime;" \n + "" \n + "_newDest = _agent getVariable [""myDest"",getposATL _agent];" \n + "if (!isNil ""_newDest"") then {" \n + " if (_newDest distance _myDest > 0) then {" \n + " _myDest = _newDest;" \n + " _agent moveTo _myDest;" \n + " _agent forceSpeed 2;" \n + " };" \n + "};" \n + "" \n + "//diag_log (""Zombie "" + str(_agent) + "" Wait "");"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Nobody_Near + { + itemno = 5; + priority = 6.000000; + to="Cleanup_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isSomeone"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Has_Target + { + itemno = 15; + priority = 5.000000; + to="Chase"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!(isNull _target)"/*%FSM*/; + action=/*%FSM*/"//Leader cries out" \n + "if (_isSomeone) then {" \n + " [_agent,""spotted"",0,false] call dayz_zombieSpeak;" \n + "};" \n + "" \n + "if (!_hasMoved) then {" \n + " _agent setVariable[""doLoiter"",true,true];" \n + "};" \n + "" \n + "//Lets see if we can get the AI to stop running away before heading to the player" \n + "_agent moveTo (getposATL _agent);" \n + "" \n + "_countr = 0;" \n + "_losCheck = 0;" \n + "_agroCheck = 0;" \n + "_cantSee = false;" \n + "_cantSeeAnything = false;" \n + "" \n + "" \n + "//diag_log (""Has Target"");"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Not_Alive + { + itemno = 4; + priority = 5.000000; + to="Cleanup_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isAlive"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class player_check + { + itemno = 54; + priority = 2.000000; + to="Looking_for_Targ"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _entityTime) > 30"/*%FSM*/; + action=/*%FSM*/"_entityTime = diag_tickTime;" \n + "" \n + "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n + "_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Time_Check + { + itemno = 17; + priority = 1.000000; + to="Looking_for_Targ"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _timeN) > 1"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Loiter + { + name = "Loiter"; + itemno = 7; + init = /*%FSM*/"_isAlive = alive _agent;" \n + "_timeN = diag_tickTime;" \n + "" \n + "//Look for target" \n + "_target = _agent call zombie_findTargetAgent;" \n + "" \n + "//Check for alert var" \n + "_newDest = _agent getVariable [""myDest"",nil];" \n + "" \n + "if ((moveToCompleted _agent) or (moveToFailed _agent) or (Speed _agent == 0)) then { " \n + " _myDest = [_agent,_position] call zombie_loiter;" \n + "};" \n + "" \n + "" \n + "//Change location to alert" \n + "if (!isNil ""_newDest"") then {" \n + " if (_newDest distance _myDest > 0) then {" \n + " _myDest = _newDest;" \n + " };" \n + "};" \n + "" \n + "" \n + "//Move to location" \n + "" \n + "if (_myDest distance (getposATL _agent) > 3) then {" \n + " //diag_log format[""Loiter - %1 - [%2,%3] - Range %4"",(typeof _agent),_myDest,_movingTo,(_myDest distance _movingTo)];" \n + "" \n + " _agent moveTo _myDest;" \n + "};" \n + "" \n + "//hintSilent (""loitering..."" + str(_agent distance (_agent getVariable [""myDest"",getposATL _agent])));" \n + "" \n + "if (_secondHand) then {" \n + " diag_log (""Zombie "" + str(_agent) + "" Loiter "" + "" distance: "" + str(_newDest distance _myDest));" \n + " _agent doMove (getPosATL player);" \n + " _agent moveTo (getPosATL player);" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Nobody_Near + { + itemno = 5; + priority = 6.000000; + to="Cleanup_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isSomeone"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Has_Target + { + itemno = 15; + priority = 5.000000; + to="Chase"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!(isNull _target)"/*%FSM*/; + action=/*%FSM*/"//Leader cries out" \n + "if (_isSomeone) then {" \n + " [_agent,""spotted"",0,false] call dayz_zombieSpeak;" \n + "};" \n + "" \n + "if (!_hasMoved) then {" \n + " _agent setVariable[""doLoiter"",true,true];" \n + "};" \n + "" \n + "//Lets see if we can get the AI to stop running away before heading to the player" \n + "_agent moveTo (getposATL _agent);" \n + "" \n + "_countr = 0;" \n + "_losCheck = 0;" \n + "_agroCheck = 0;" \n + "_cantSee = false;" \n + "_cantSeeAnything = false;" \n + "" \n + "" \n + "//diag_log (""Has Target"");"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Not_Alive + { + itemno = 4; + priority = 5.000000; + to="Cleanup_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isAlive"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class player_check + { + itemno = 53; + priority = 2.000000; + to="Loiter"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _entityTime) > 30"/*%FSM*/; + action=/*%FSM*/"_entityTime = diag_tickTime;" \n + "" \n + "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n + "_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Time_Check + { + itemno = 20; + priority = 0.000000; + to="Loiter"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _timeN) > 1"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Begin + { + name = "Begin"; + itemno = 11; + init = /*%FSM*/"_hasMoved = _agent getVariable[""doLoiter"",true];" \n + "" \n + "_myDest = [_agent,_position] call zombie_loiter;" \n + "_newDest = nil;" \n + "_movingTo = _myDest;" \n + "_array = [];" \n + "_waypoint = [];" \n + "" \n + "_agentReset = false;" \n + "" \n + "_bodyStay = 60;" \n + "" \n + "_agent disableAI ""FSM"";" \n + "_timeN = diag_tickTime;" \n + "" \n + "_agent setBehaviour ""CARELESS"";" \n + "" \n + " _id = _agent addeventhandler [""HandleDamage"",{_this call local_zombieDamage}];" \n + "" \n + "//hint ""run local zombie"";" \n + "_isSomeone = true;" \n + "" \n + "_target = objNull;" \n + "_targetPos = [];" \n + "_countr = 0;" \n + "" \n + "//Spawn roaming script (individual to unit)" \n + "_entityTime = diag_tickTime;" \n + "" \n + "_isCarrier = false;" \n + "_chance = round(random 12);" \n + "if ((_chance % 4) == 0) then {" \n + " _isCarrier = true;" \n + "};" \n + "" \n + "//Debug" \n + "if (_secondHand) then {" \n + " diag_log (""Zombie Brain Initialized "" + str(_agent) + "" doLoiter: "" + str(_doLoiter));" \n + " [_agent,_position] call zombie_loiter;" \n + " _myDest = _agent getVariable [""myDest"",getposATL _agent];" \n + "" \n + "};" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class loiter + { + itemno = 6; + priority = 0.000000; + to="Loiter"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_hasMoved"/*%FSM*/; + action=/*%FSM*/"_myDest = [_agent,_position] call zombie_loiter;" \n + "_agent forceSpeed 2;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class wait + { + itemno = 2; + priority = 0.000000; + to="Looking_for_Targ"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_hasMoved"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Chase + { + name = "Chase"; + itemno = 16; + init = /*%FSM*/"_timeN = diag_tickTime;" \n + "" \n + "_agent forceSpeed (_agent getVariable [""speedLimit"", 3]);" \n + "" \n + "_target = _agent call zombie_findTargetAgent;" \n + "_targetPos = getPosATL _target;" \n + "_isAlive = alive _agent;" \n + "_isTargetAlive = alive _target;" \n + "" \n + "//Move to location" \n + "if (_movingTo distance _targetPos > 2) then {" \n + " //diag_log format[""Chase - %1 - [%2,%3] - Range %4"",(typeof _agent),_myDest,_movingTo,(_myDest distance _movingTo)];" \n + "" \n + " _agent moveTo _targetPos;" \n + "_speed = if (!isNil ""DZE_slowZombies"" && {DZE_slowZombies}) then { 2 } else { 10 };" \n + "_agent forceSpeed _speed;" \n + " _movingTo = _targetPos;" \n + "};" \n + "" \n + "if ((moveToCompleted _agent) or (Speed _agent == 0) or ((_agent distance _target) <= 2)) then {" \n + " _agroCheck= _agroCheck + 1;" \n + "" \n + " //Check if LOS" \n + " if ((_agroCheck % 6) == 0) then {" \n + " _agroCheck = 0;" \n + " _cantSee = [_target,_agent] call dayz_losCheck;" \n + " _target = _agent call zombie_findTargetAgent;" \n + " };" \n + "};" \n + "" \n + "" \n + "//diag_log format[""%1"",(typeof _agent)];"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Nobody_Near + { + itemno = 5; + priority = 6.000000; + to="Cleanup_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isSomeone"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Not_Alive + { + itemno = 4; + priority = 5.000000; + to="Cleanup_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isAlive"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class No_Target + { + itemno = 22; + priority = 3.000000; + to="Reset_Targeting"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(isNull _target)"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Target_Dead + { + itemno = 58; + priority = 3.000000; + to="Reset_Targeting"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isTargetAlive"/*%FSM*/; + action=/*%FSM*/"_timeN = diag_tickTime;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class cant_see + { + itemno = 30; + priority = 2.000000; + to="Finish_Move"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_cantSee"/*%FSM*/; + action=/*%FSM*/"//diag_log (""Cant See"");"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class TimeOut + { + itemno = 64; + priority = 2.000000; + to="Chase"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _timeN) > 3" \n + ""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Cleanup_ + { + name = "Cleanup_"; + itemno = 27; + init = /*%FSM*/"_waitStart = diag_tickTime;" \n + "" \n + "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n + "_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class nobody_around + { + itemno = 28; + priority = 0.000000; + to="End"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isSomeone"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class someone_here + { + itemno = 36; + priority = 0.000000; + to="wait"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_isSomeone"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Finish_Move + { + name = "Finish_Move"; + itemno = 31; + init = /*%FSM*/"_timeN = diag_tickTime;" \n + "" \n + "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n + "_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Nobody_Near + { + itemno = 5; + priority = 6.000000; + to="Cleanup_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isSomeone"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class finished + { + itemno = 32; + priority = 1.000000; + to="Reset_Targeting"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_agent distance _targetPos < 3"/*%FSM*/; + action=/*%FSM*/"//diag_log (""Finished"");"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class too_long + { + itemno = 44; + priority = 0.000000; + to="Reset_Targeting"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _timeN) > 20"/*%FSM*/; + action=/*%FSM*/"//diag_log (""Timeout"");"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class wait + { + name = "wait"; + itemno = 37; + init = /*%FSM*/"_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n + "_isSomeone = ({isPlayer _x} count _list) > 0;" \n + "" \n + "_timeN = diag_tickTime;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class time_up + { + itemno = 38; + priority = 0.000000; + to="End"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _waitStart) > 300"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class nobody_around + { + itemno = 28; + priority = 0.000000; + to="End"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isSomeone"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class deleted + { + itemno = 49; + priority = 0.000000; + to="End"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"isNull _agent;"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Time_Check + { + itemno = 41; + priority = 0.000000; + to="wait"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _timeN) > 30"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Reset_Targeting + { + name = "Reset_Targeting"; + itemno = 47; + init = /*%FSM*/"// reset stance to favorite one" \n + "_agent setUnitPos (_agent getVariable [""stance"", ""UP""]);" \n + "" \n + "//Lets move" \n + "_myDest = [_agent,_position] call zombie_loiter;" \n + "" \n + "//Local" \n + "_agent setVariable [""localtargets"",[],false];" \n + "" \n + "//Remote" \n + "_remotetargets = [];" \n + "_remotetargets = _agent getVariable [""remotetargets"",[]];" \n + "" \n + "//Clear remote on reset" \n + "if (count _remotetargets > 0) then {" \n + " _agent setVariable [""remotetargets"",[],true];" \n + "};" \n + "" \n + "//Clear Target" \n + "_target = objNull;" \n + "" \n + "//force Speed" \n + "_agent forceSpeed 2;" \n + "" \n + "" \n + "//diag_log (""Agent reset"");" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class true + { + itemno = 48; + priority = 0.000000; + to="Loiter"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/"//diag_log (""Reset"");" \n + "" \n + ""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class ____FAKE____ + { + name = "____FAKE____"; + itemno = 65; + init = /*%FSM*/""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class MoveCompleted_ + { + itemno = 56; + priority = 3.000000; + to="____FAKE____"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"moveToCompleted _agent;" \n + "//_agent distance (_agent getVariable [""myDest"",getposATL _agent]) < 3"/*%FSM*/; + action=/*%FSM*/"_myDest = [_agent,_position] call zombie_loiter;" \n + "//_myDest = _agent getVariable [""myDest"",getposATL _agent];"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Failed_Move + { + itemno = 57; + priority = 3.000000; + to="____FAKE____"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"moveToFailed _agent;"/*%FSM*/; + action=/*%FSM*/"_myDest = [_agent,_position] call zombie_loiter;" \n + "//_myDest = _agent getVariable [""myDest"",getposATL _agent];" \n + ""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class TargetMoved + { + itemno = 62; + priority = 3.000000; + to="____FAKE____"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(((_agent distance _target) >= 3) and ((diag_tickTime - _timeN) > 1))" \n + ""/*%FSM*/; + action=/*%FSM*/"diag_log (""TargetMoved"");"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Not_moving + { + itemno = 63; + priority = 1.000000; + to="____FAKE____"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(Speed _agent == 0)" \n + ""/*%FSM*/; + action=/*%FSM*/"_myDest = [_agent,_position] call zombie_loiter;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Check + { + itemno = 21; + priority = 1.000000; + to="____FAKE____"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"((_agent distance _target) >= 2)" \n + ""/*%FSM*/; + action=/*%FSM*/"// reset stance to favorite one" \n + "//if (_agent distance _targetPos > 5) then {" \n + "// _agent setUnitPos (_agent getVariable [""stance"", ""UP""]);" \n + "//};" \n + "" \n + "//diag_log (""Reset Chase"");" \n + "" \n + "/*" \n + "if (_agent distance _targetPos < 5) then {" \n + " //Stand up" \n + " _agent setUnitPos ""UP"";" \n + "};" \n + "*/" \n + ""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class End_Attack + { + itemno = 61; + priority = 0.000000; + to="____FAKE____"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _timeAttack) > 0.3"/*%FSM*/; + action=/*%FSM*/"[_agent, ""zombie""] spawn player_zombieAttack;" \n + "_agent setVariable[""lastAttack"", diag_tickTime];"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Start_Attack + { + itemno = 60; + priority = 0.000000; + to="____FAKE____"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"((local _target) and (_agent distance _target <= 3.3) and ((diag_tickTime - _last) > 2) and (_delta < 1.5) and (_delta > -1.5) and (alive _target))"/*%FSM*/; + action=/*%FSM*/"[_agent, ""zombie""] spawn player_attackdelay;" \n + "_agent setVariable[""lastAttack"", diag_tickTime];" \n + "" \n + "_timeAttack = diag_ticktime;"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ }; - /*%FSM*/ - /*%FSM*/ - class true + initState="init"; + finalStates[] = { - priority = 0.000000; - to="Begin"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"dayz_clientPreload && !(isNull _agent)"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; + "End", }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class End - { - name = "End"; - init = /*%FSM*/"if (!isDedicated) then {" \n - " if (!isNull _agent) then {" \n - " deleteVehicle _agent;" \n - " };" \n - "} else {" \n - " [_agent] call zombie_findOwner;" \n - "};"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - }; - }; - /*%FSM*/ - /*%FSM*/ - class Looking_for_Targ - { - name = "Looking_for_Targ"; - init = /*%FSM*/"_isAlive = alive _agent;" \n - "_target = _agent call zombie_findTargetAgent;" \n - "_timeN = time;" \n - "" \n - "_newDest = _agent getVariable [""myDest"",getposATL _agent];" \n - "if (!isNil ""_newDest"") then {" \n - " if (_newDest distance _myDest > 0) then {" \n - " _myDest = _newDest;" \n - " _agent moveTo _myDest;" \n - " _agent forceSpeed 2;" \n - " };" \n - "};" \n - "" \n - "//diag_log (""Zombie "" + str(_agent) + "" Wait "");"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Not_Alive - { - priority = 5.000000; - to="Cleanup_"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!_isAlive"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Nobody_Near - { - priority = 4.000000; - to="Cleanup_"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!_isSomeone"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Has_Target - { - priority = 1.000000; - to="Chase"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!(isNull _target)"/*%FSM*/; - action=/*%FSM*/"//Leader cries out" \n - "if (_isSomeone) then {" \n - " [_agent,""spotted"",0,false] call dayz_zombieSpeak;" \n - "};" \n - "if (!_hasMoved) then {" \n - " _agent setVariable[""doLoiter"",true,true];" \n - "};" \n - "_countr = 0;" \n - "_losCheck = 0;" \n - "_cantSee = false;"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class player_check - { - priority = 0.000000; - to="Looking_for_Targ"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(time - _entityTime) > 30"/*%FSM*/; - action=/*%FSM*/"_entityTime = time;" \n - "" \n - "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n - "_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Time_Check - { - priority = 0.000000; - to="Looking_for_Targ"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(time - _timeN) > 1"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Loiter - { - name = "Loiter"; - init = /*%FSM*/"_isAlive = alive _agent;" \n - "_target = _agent call zombie_findTargetAgent;" \n - "" \n - "_agent forceSpeed 2;" \n - "" \n - "_newDest = _agent getVariable [""myDest"",getposATL _agent];" \n - "if (!isNil ""_newDest"") then {" \n - " if (_newDest distance _myDest > 0) then {" \n - " _myDest = _newDest;" \n - " _agent moveTo _myDest;" \n - " _agent forceSpeed 2;" \n - " };" \n - "};" \n - "" \n - "_timeN = time;" \n - "" \n - "//hintSilent (""loitering..."" + str(_agent distance (_agent getVariable [""myDest"",getposATL _agent])));" \n - "" \n - "if (_secondHand) then {" \n - " diag_log (""Zombie "" + str(_agent) + "" Loiter "" + "" distance: "" + str(_newDest distance _myDest));" \n - " _agent doMove (getPosATL player);" \n - " _agent moveTo (getPosATL player);" \n - "};"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Not_Alive - { - priority = 5.000000; - to="Cleanup_"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!_isAlive"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Nobody_Near - { - priority = 4.000000; - to="Cleanup_"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!_isSomeone"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Has_Target - { - priority = 1.000000; - to="Chase"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!(isNull _target)"/*%FSM*/; - action=/*%FSM*/"//Leader cries out" \n - "if (_isSomeone) then {" \n - " [_agent,""spotted"",0,false] call dayz_zombieSpeak;" \n - "};" \n - "if (!_hasMoved) then {" \n - " _agent setVariable[""doLoiter"",true,true];" \n - "};" \n - "_countr = 0;" \n - "_losCheck = 0;" \n - "_cantSee = false;"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class In_Position - { - priority = 1.000000; - to="Loiter"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_agent distance (_agent getVariable [""myDest"",getposATL _agent]) < 3"/*%FSM*/; - action=/*%FSM*/"[_agent,_position] call zombie_loiter;" \n - "_myDest = _agent getVariable [""myDest"",getposATL _agent];" \n - ""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class player_check - { - priority = 0.000000; - to="Loiter"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(time - _entityTime) > 30"/*%FSM*/; - action=/*%FSM*/"_entityTime = time;" \n - "" \n - "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n - "_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Time_Check - { - priority = 0.000000; - to="Loiter"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(time - _timeN) > 1"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Begin - { - name = "Begin"; - init = /*%FSM*/"_doLoiter = _agent getVariable[""doLoiter"",true];" \n - "" \n - "_myDest = _position;" \n - "_newDest = _position;" \n - "_array = [];" \n - "" \n - "_bodyStay = 60;" \n - "" \n - "_hasMoved = _doLoiter;" \n - "" \n - "_agent disableAI ""FSM"";" \n - "_agent setBehaviour ""CARELESS"";" \n - "_agent setCombatMode ""RED"";" \n - "_agent setSkill 0;" \n - "" \n - "_newDest = getPosATL _agent;" \n - "_timeN = time;" \n - "" \n - " _id = _agent addeventhandler [""HandleDamage"",{_this call local_zombieDamage}];" \n - "" \n - "//hint ""run local zombie"";" \n - "_isSomeone = true;" \n - "" \n - "_target = objNull;" \n - "_targetPos = [];" \n - "_countr = 0;" \n - "" \n - "//Spawn roaming script (individual to unit)" \n - "_entityTime = time;" \n - "" \n - "//Debug" \n - "if (_secondHand) then {" \n - " diag_log (""Zombie Brain Initialized "" + str(_agent) + "" doLoiter: "" + str(_doLoiter));" \n - " [_agent,_position] call zombie_loiter;" \n - " _myDest = _agent getVariable [""myDest"",getposATL _agent];" \n - "" \n - "};" \n - ""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class loiter - { - priority = 0.000000; - to="Loiter"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_hasMoved"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class wait - { - priority = 0.000000; - to="Looking_for_Targ"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!_hasMoved"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Chase - { - name = "Chase"; - init = /*%FSM*/"_timeN = time;" \n - "" \n - "if (speed _agent < 0.1) then {_countr = _countr + 1} else {_countr = 0};" \n - "_target = _agent call zombie_findTargetAgent;" \n - "_isAlive = alive _agent;" \n - "_targetPos = getPosATL _target;" \n - "" \n - "" \n - "//Move to target" \n - "_agent moveTo _targetPos;" \n - "_speed = if (!isNil ""DZE_slowZombies"" && {DZE_slowZombies}) then { 2 } else { 10 };" \n - "_agent forceSpeed _speed;" \n - "" \n - "if (_losCheck == 2) then {" \n - " _losCheck = 0;" \n - " _cantSee = [_agent,_target] call dayz_losCheck;" \n - "};" \n - ""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Not_Alive - { - priority = 5.000000; - to="Cleanup_"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!_isAlive"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Nobody_Near - { - priority = 4.000000; - to="Cleanup_"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!_isSomeone"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class No_Target - { - priority = 3.000000; - to="Reset_Targeting"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(isNull _target)"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class cant_see - { - priority = 2.000000; - to="Finish_Move"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_cantSee"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Time_Check - { - priority = 0.000000; - to="Chase"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(time - _timeN) > 1"/*%FSM*/; - action=/*%FSM*/"_losCheck = _losCheck + 1;"/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Cleanup_ - { - name = "Cleanup_"; - init = /*%FSM*/"_waitStart = time;" \n - "" \n - "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n - "_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class nobody_around - { - priority = 0.000000; - to="End"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!_isSomeone"/*%FSM*/; - action=/*%FSM*/"dayz_spawnZombies = dayz_spawnZombies - 1;"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class someone_here - { - priority = 0.000000; - to="wait"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_isSomeone"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Finish_Move - { - name = "Finish_Move"; - init = /*%FSM*/"_timeN = time;" \n - "" \n - "_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n - "_isSomeone = ({isPlayer _x} count _list) > 0;"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Nobody_Near - { - priority = 4.000000; - to="Cleanup_"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!_isSomeone"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class finished - { - priority = 1.000000; - to="Reset_Targeting"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_agent distance _targetPos < 1"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class too_long - { - priority = 0.000000; - to="Reset_Targeting"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(time - _timeN) > 10"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class wait - { - name = "wait"; - init = /*%FSM*/"_list = (getposATL _agent) nearEntities [[""CAManBase"",""AllVehicles""],300];" \n - "_isSomeone = ({isPlayer _x} count _list) > 0;" \n - "" \n - "_timeN = time;"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class time_up - { - priority = 0.000000; - to="End"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(time - _waitStart) > 300"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class nobody_around - { - priority = 0.000000; - to="End"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!_isSomeone"/*%FSM*/; - action=/*%FSM*/"dayz_spawnZombies = dayz_spawnZombies - 1;"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class deleted - { - priority = 0.000000; - to="End"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"isNull _agent;"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Time_Check - { - priority = 0.000000; - to="wait"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(time - _timeN) > 30"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Reset_Targeting - { - name = "Reset_Targeting"; - init = /*%FSM*/"if (!isNull _target) then {" \n - " _targetPos = getPosATL _target;" \n - " _agent setVariable [""myDest"",_targetPos];" \n - " _agent moveTo _targetPos;" \n - "};" \n - "" \n - "_agent setVariable [""targets"",[],true];" \n - "_target = objNull;" \n - ""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class true - { - priority = 0.000000; - to="Loiter"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - }; - initState="init"; - finalStates[] = - { - "End", - }; }; -/*%FSM*/ +/*%FSM*/ \ No newline at end of file diff --git a/SQF/dayz_code/system/zombie_wildagent.fsm b/SQF/dayz_code/system/zombie_wildagent.fsm new file mode 100644 index 000000000..7b213d0c9 --- /dev/null +++ b/SQF/dayz_code/system/zombie_wildagent.fsm @@ -0,0 +1,575 @@ +/*%FSM*/ +/*%FSM*/ +/* +item0[] = {"init",0,250,-325.000000,-275.000000,-225.000000,-225.000000,0.000000,"init"}; +item1[] = {"End",1,250,175.000000,-275.000000,275.000000,-225.000000,0.000000,"End"}; +item2[] = {"Not_Alive",4,218,50.000000,300.000000,150.000000,350.000000,5.000000,"Not" \n "Alive"}; +item3[] = {"loiter",4,218,-325.000000,0.000000,-225.000000,50.000000,0.000000,"loiter"}; +item4[] = {"Loiter",2,4346,-325.000000,125.000000,-225.000000,175.000000,0.000000,"Loiter"}; +item5[] = {"",7,210,-29.000042,321.000000,-20.999960,329.000000,0.000000,""}; +item6[] = {"true",8,218,-325.000000,-175.000000,-225.000000,-125.000000,0.000000,"true"}; +item7[] = {"Begin",2,250,-325.000000,-100.000000,-225.000000,-50.000000,0.000000,"Begin"}; +item8[] = {"Has_Target",4,218,-150.000000,225.000000,-50.000000,275.000000,1.000000,"Has" \n "Target"}; +item9[] = {"Chase",2,250,-150.000000,300.000000,-50.000000,350.000000,0.000000,"Chase"}; +item10[] = {"",7,210,-29.000006,146.000000,-20.999996,154.000000,0.000000,""}; +item11[] = {"",7,210,-29.000006,196.000000,-20.999996,204.000000,0.000000,""}; +item12[] = {"",7,210,-104.000000,196.000000,-95.999992,204.000000,0.000000,""}; +item13[] = {"Time_Check",4,218,-250.000000,50.000000,-150.000000,100.000000,0.000000,"Time" \n "Check"}; +item14[] = {"Time_Check",4,218,-275.000000,300.000000,-175.000000,350.000000,0.000000,"Time" \n "Check"}; +item15[] = {"No_Target",4,218,-275.000000,375.000000,-175.000000,425.000000,3.000000,"No" \n "Target"}; +item16[] = {"",7,210,-479.000000,396.000000,-471.000000,404.000000,0.000000,""}; +item17[] = {"",7,210,-479.000000,146.000000,-471.000000,154.000000,0.000000,""}; +item18[] = {"",7,210,221.000000,321.000000,229.000000,329.000000,0.000000,""}; +item19[] = {"Cleanup_",2,250,175.000000,200.000000,275.000000,250.000000,0.000000,"Cleanup?"}; +item20[] = {"",7,210,-104.000023,396.000000,-95.999992,404.000000,0.000000,""}; +item21[] = {"cant_see",4,218,-275.000000,450.000000,-175.000000,500.000000,2.000000,"cant" \n "see"}; +item22[] = {"Finish_Move",2,250,-275.000000,525.000000,-175.000000,575.000000,0.000000,"Finish" \n "Move"}; +item23[] = {"finished",4,218,-400.000000,525.000000,-300.000000,575.000000,1.000000,"finished"}; +item24[] = {"",7,210,-479.000000,546.000000,-471.000000,554.000000,0.000000,""}; +item25[] = {"time_up",4,218,175.000000,-25.000000,275.000000,25.000000,0.000000,"time" \n "up"}; +item26[] = {"",7,210,271.000000,96.000000,279.000000,104.000008,0.000000,""}; +item27[] = {"",7,210,221.000000,96.000008,229.000000,103.999977,0.000000,""}; +item28[] = {"",7,210,271.000000,-79.000000,279.000000,-71.000000,0.000000,""}; +item29[] = {"",7,210,221.000000,-79.000000,229.000000,-71.000000,0.000000,""}; +item30[] = {"too_long",4,218,-400.000000,600.000000,-300.000000,650.000000,0.000000,"too long"}; +item31[] = {"",7,210,-229.000000,621.000000,-221.000000,629.000000,0.000000,""}; +item32[] = {"",7,210,-479.000000,621.000000,-471.000000,629.000000,0.000000,""}; +item33[] = {"Reset_Targeting",2,250,-525.000000,325.000000,-425.000000,375.000000,0.000000,"Reset" \n "Targeting"}; +item34[] = {"true",8,218,-525.000000,200.000000,-425.000000,250.000000,0.000000,"true"}; +item35[] = {"deleted",4,218,225.000000,0.000000,325.000000,50.000000,0.000000,"deleted"}; +item36[] = {"",7,210,-104.000000,471.000000,-95.999992,479.000000,0.000000,""}; +item37[] = {"moveToCompleted",4,218,-400.000000,50.000000,-300.000000,100.000000,1.000000,"moveToCompleted "}; +item38[] = {"Failed_to_move",4,218,-550.000000,-75.000000,-450.000000,-25.000000,2.000000,"Failed to move"}; +item39[] = {"Second_Hand",4,218,-200.000000,-275.000000,-100.000000,-225.000000,0.000000,"Second Hand"}; +item40[] = {"End_1",1,250,-75.000000,-275.000000,25.000000,-225.000000,0.000000,"End"}; +item41[] = {"",7,210,-4.000000,-79.000000,4.000000,-71.000000,0.000000,""}; +item42[] = {"",7,210,-4.000000,146.000000,4.000000,154.000000,0.000000,""}; +item43[] = {"isLocal",4,218,25.000000,125.000000,125.000000,175.000000,5.000000,"isLocal"}; +item44[] = {"",7,210,71.000000,-254.000000,79.000000,-246.000000,0.000000,""}; +item45[] = {"____FAKE____",9,1800,0.000000,0.000000,0.000000,0.000000,0.000000,"____FAKE____"}; +link0[] = {0,6}; +link1[] = {0,39}; +link2[] = {2,18}; +link3[] = {3,4}; +link4[] = {4,10}; +link5[] = {4,13}; +link6[] = {4,37}; +link7[] = {5,2}; +link8[] = {6,7}; +link9[] = {7,3}; +link10[] = {7,41}; +link11[] = {8,9}; +link12[] = {9,5}; +link13[] = {9,14}; +link14[] = {9,20}; +link15[] = {10,11}; +link16[] = {10,42}; +link17[] = {11,5}; +link18[] = {11,12}; +link19[] = {12,8}; +link20[] = {13,4}; +link21[] = {14,9}; +link22[] = {15,16}; +link23[] = {16,33}; +link24[] = {17,4}; +link25[] = {18,19}; +link26[] = {19,27}; +link27[] = {20,15}; +link28[] = {20,36}; +link29[] = {21,22}; +link30[] = {22,23}; +link31[] = {22,31}; +link32[] = {23,24}; +link33[] = {24,16}; +link34[] = {25,29}; +link35[] = {26,35}; +link36[] = {27,25}; +link37[] = {27,26}; +link38[] = {28,29}; +link39[] = {29,1}; +link40[] = {30,32}; +link41[] = {31,30}; +link42[] = {32,24}; +link43[] = {33,34}; +link44[] = {34,17}; +link45[] = {35,28}; +link46[] = {36,21}; +link47[] = {37,4}; +link48[] = {39,40}; +link49[] = {41,42}; +link50[] = {42,43}; +link51[] = {43,44}; +link52[] = {44,40}; +link53[] = {38,45}; +link54[] = {45,38}; +globals[] = {25.000000,1,0,0,0,640,480,1,128,6316128,1,-571.718994,323.614502,673.426392,-311.286346,581,1030,1}; +window[] = {2,-1,-1,-1,-1,831,52,1260,52,3,599}; +*//*%FSM*/ +class FSM +{ + fsmName = "DayZ Zombie Wild Agent"; + class States + { + /*%FSM*/ + class init + { + name = "init"; + init = /*%FSM*/"_position = _this select 0;" \n + "_agent = _this select 1;" \n + "" \n + "_secondHand = false;" \n + "" \n + "" \n + "if (count _this > 2) then {" \n + " //_secondHand = true;" \n + " diag_log (""Second Hand Zombie Initialized: "" + str(_this));" \n + "};" \n + "" \n + "" \n + "diag_log (""Agent Initialized: "" + str(_this));"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Second_Hand + { + priority = 0.000000; + to="End_1"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"count _this > 2"/*%FSM*/; + action=/*%FSM*/"diag_log (""Second Hand"");"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class true + { + priority = 0.000000; + to="Begin"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!(isNull _agent)"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class End + { + name = "End"; + init = /*%FSM*/"if (!isNull _agent) then {" \n + " deleteVehicle _agent;" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + }; + }; + /*%FSM*/ + /*%FSM*/ + class Loiter + { + name = "Loiter"; + init = /*%FSM*/"_isAlive = alive _agent;" \n + "_isLocal = local _agent;" \n + "" \n + "_target = _agent call compile preprocessFileLineNumbers ""\z\addons\dayz_code\compile\zombie_findTargetAgent.sqf"";" \n + "" \n + "_agent moveTo _pos;" \n + "_agent forceSpeed 2;" \n + "" \n + "//if (_runonce) then {" \n + "// _agent moveTo _pos;" \n + "// _runonce = false;" \n + "//};" \n + "" \n + "_timeN = diag_tickTime;" \n + "" \n + "diag_log format [""Agent: %1, Distance: %2, Location: %3"",_agent,(_agent distance _pos),_pos];" \n + "" \n + "if (!_isLocal) then {" \n + "diag_log (""State ID: 6"");" \n + "diag_log (str(_pos));" \n + "diag_log (str(_this));" \n + "diag_log (str(_agent));" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Not_Alive + { + priority = 5.000000; + to="Cleanup_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isAlive"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class isLocal + { + priority = 5.000000; + to="End_1"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isLocal"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Has_Target + { + priority = 1.000000; + to="Chase"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!(isNull _target)"/*%FSM*/; + action=/*%FSM*/"//Leader cries out" \n + "" \n + "if (!_hasMoved) then {" \n + " _agent setVariable[""doLoiter"",true,true];" \n + "};" \n + "_countr = 0;" \n + "_losCheck = 0;" \n + "_advLosCheck = 0;" \n + "_cantSee = false;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class moveToCompleted + { + priority = 1.000000; + to="Loiter"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"moveToCompleted _agent"/*%FSM*/; + action=/*%FSM*/"//_pos = [_position,20,100,1,0,10,0] call BIS_fnc_findSafePos;" \n + "_pos = [_position,20,100,1] call fn_selectRandomLocation;" \n + "" \n + "" \n + "if (!_isLocal) then {" \n + "diag_log (""State ID: 49"");" \n + "};"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Time_Check + { + priority = 0.000000; + to="Loiter"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _timeN) > 30"/*%FSM*/; + action=/*%FSM*/"_pos = [_position,20,100,1] call fn_selectRandomLocation;"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Begin + { + name = "Begin"; + init = /*%FSM*/"//_doLoiter = _agent getVariable[""doLoiter"",true];" \n + "" \n + "_array = [];" \n + "" \n + "_isLocal = local _agent;" \n + "" \n + "_runonce = true;" \n + "" \n + "_bodyStay = 60;" \n + "" \n + "_hasMoved = true;" \n + "" \n + "_agent disableAI ""FSM"";" \n + "_newDest = getPosATL _agent;" \n + "_timeN = time;" \n + "" \n + " _id = _agent addeventhandler [""HandleDamage"",{_this call local_zombieDamage}];" \n + "" \n + "_target = objNull;" \n + "_targetPos = [];" \n + "_countr = 0;" \n + "" \n + "//Spawn roaming script (individual to unit)" \n + "_entityTime = diag_tickTime;" \n + "_timeR = diag_tickTime;" \n + "" \n + "" \n + "diag_log (""State ID: 10"");" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class isLocal + { + priority = 5.000000; + to="End_1"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isLocal"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class loiter + { + priority = 0.000000; + to="Loiter"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_hasMoved"/*%FSM*/; + action=/*%FSM*/"//_pos = [_position,20,100,1,0,10,0] call BIS_fnc_findSafePos;" \n + "_pos = [_position,20,100,1] call fn_selectRandomLocation;" \n + ""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Chase + { + name = "Chase"; + init = /*%FSM*/"_timeN = diag_tickTime;" \n + "" \n + "if (speed _agent < 0.1) then {_countr = _countr + 1} else {_countr = 0};" \n + "_target = _agent call zombie_findTargetAgent;" \n + "_isAlive = alive _agent;" \n + "_targetPos = getPosATL _target;" \n + "" \n + "//Move to target" \n + "if (_agent distance _target > 2.2) then {" \n + " _agent moveTo _targetPos;" \n + " _agent forceSpeed 6;" \n + "};" \n + "" \n + "//Check if LOS" \n + "if (_losCheck == 5) then {" \n + " _losCheck = 0;" \n + " _cantSee = [_agent,_target] call dayz_losCheck;" \n + "};" \n + "" \n + "if (_cantSee) then {" \n + " _advLosCheck = _advLosCheck +1;" \n + "};" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Not_Alive + { + priority = 5.000000; + to="Cleanup_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!_isAlive"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class No_Target + { + priority = 3.000000; + to="Reset_Targeting"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(isNull _target)"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class cant_see + { + priority = 2.000000; + to="Finish_Move"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_advLosCheck > 5"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Time_Check + { + priority = 0.000000; + to="Chase"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _timeN) > 1"/*%FSM*/; + action=/*%FSM*/"// reset stance to favorite one" \n + "if (_agent distance _target > 5) then {" \n + " _agent setUnitPos (_agent getVariable [""stance"", ""UP""]);" \n + "};" \n + "" \n + "//LOS Tick" \n + "_losCheck = _losCheck + 1;" \n + "" \n + "if (_agent distance _target <= 2.2) then {" \n + " _dir = [_agent,_target] call BIS_Fnc_dirTo;" \n + " _agent setDir _dir;" \n + "" \n + "// _agentPos = getPosATL _agent;" \n + "// _agent moveTo _agentPos;" \n + " _agent forceSpeed 0;" \n + "" \n + " if (speed _agent == 0) then {" \n + " _losCheck = _losCheck + 1;" \n + " };" \n + "};" \n + "" \n + "if (_agent distance _target > 2.2 AND _agent distance _target < 5) then {" \n + " //Stand up" \n + " _agent setUnitPos ""UP"";" \n + "};"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Cleanup_ + { + name = "Cleanup_"; + init = /*%FSM*/"_waitStart = diag_tickTime;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class deleted + { + priority = 0.000000; + to="End"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"isNull _agent;"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class time_up + { + priority = 0.000000; + to="End"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _waitStart) > 300"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Finish_Move + { + name = "Finish_Move"; + init = /*%FSM*/"_timeN = diag_tickTime;" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class finished + { + priority = 1.000000; + to="Reset_Targeting"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_agent distance _targetPos < 3"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class too_long + { + priority = 0.000000; + to="Reset_Targeting"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _timeN) > 10"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Reset_Targeting + { + name = "Reset_Targeting"; + init = /*%FSM*/"// reset stance to favorite one" \n + "_agent setUnitPos (_agent getVariable [""stance"", ""UP""]);" \n + "" \n + "if (!isNull _target) then {" \n + " _targetPos = getPosATL _target;" \n + " _agent setVariable [""myDest"",_targetPos];" \n + " _agent moveTo _targetPos;" \n + "};" \n + "" \n + "//Local" \n + "_agent setVariable [""localtargets"",[],false];" \n + "" \n + "//Remote" \n + "_remotetargets = [];" \n + "_remotetargets = _agent getVariable [""remotetargets"",[]];" \n + "" \n + "//Clear remote on reset" \n + "if (count _remotetargets > 0) then" \n + "{" \n + " _agent setVariable [""remotetargets"",[],true];" \n + "};" \n + "" \n + "//Clear Target" \n + "_target = objNull;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class true + { + priority = 0.000000; + to="Loiter"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class End_1 + { + name = "End_1"; + init = /*%FSM*/""/*%FSM*/; + precondition = /*%FSM*/"diag_log (""End State"");"/*%FSM*/; + class Links + { + }; + }; + /*%FSM*/ + /*%FSM*/ + class ____FAKE____ + { + name = "____FAKE____"; + init = /*%FSM*/""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Failed_to_move + { + priority = 2.000000; + to="____FAKE____"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"moveToFailed _agent"/*%FSM*/; + action=/*%FSM*/"//_pos = [_position,20,100,1,0,10,0] call BIS_fnc_findSafePos;" \n + "" \n + "if (!_isLocal) then {" \n + "diag_log (""State ID: 50"");" \n + "};"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + }; + initState="init"; + finalStates[] = + { + "End", + "End_1" + }; +}; +/*%FSM*/ \ No newline at end of file