From 2bda70b516c4a53753293e018d98fced534d0391 Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Sun, 22 Jun 2014 17:20:51 -0500 Subject: [PATCH] 1.8 code merge needed here and revert x2 limit change --- SQF/dayz_code/init/variables.sqf | 2 +- SQF/dayz_code/medical/init_medical.sqf | 4 -- SQF/dayz_code/system/player_spawn_1.sqf | 96 ++++++++++++++++--------- 3 files changed, 63 insertions(+), 39 deletions(-) diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index 6e3ffe921..59ba6e25a 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -700,7 +700,7 @@ if(!isDedicated) then { //Used to limit overall zed counts dayz_tickTimeOffset = 0; dayz_currentWeaponHolders = 0; - dayz_maxMaxWeaponHolders = 160; + dayz_maxMaxWeaponHolders = 80; dayz_maxCurrentZeds = 0; dayz_inVehicle = false; dayz_Magazines = []; diff --git a/SQF/dayz_code/medical/init_medical.sqf b/SQF/dayz_code/medical/init_medical.sqf index 6074d2929..5c03aac80 100644 --- a/SQF/dayz_code/medical/init_medical.sqf +++ b/SQF/dayz_code/medical/init_medical.sqf @@ -60,10 +60,6 @@ while {true} do { sleep 1; [] spawn fnc_med_publicBlood; }; - - //Add player actions - [] call fnc_usec_damageActions; - [] call fnc_usec_selfActions; //Low Blood Effects if (!r_player_unconscious) then { diff --git a/SQF/dayz_code/system/player_spawn_1.sqf b/SQF/dayz_code/system/player_spawn_1.sqf index 0501c40ee..82a4bb740 100644 --- a/SQF/dayz_code/system/player_spawn_1.sqf +++ b/SQF/dayz_code/system/player_spawn_1.sqf @@ -1,47 +1,75 @@ private ["_handle","_cursor","_delMe","_first","_town","_day","_world","_nearestCity"]; +_timer = diag_tickTime; +_timer1 = diag_tickTime; +_spawnCheck = diag_tickTime; +_timer2 = diag_Ticktime; +_NewDay = diag_tickTime; + while {true} do { - _handle = [] spawn player_animalCheck; - waitUntil{scriptDone _handle}; + //add player actions + if ((diag_tickTime - _timer2) > 0.5) then { + [] call fnc_usec_damageActions; + [] call fnc_usec_selfActions; + _timer2 = diag_Ticktime; + }; + + if ((diag_tickTime - _timer) > 300) then { + //Other Counters + dayz_currentGlobalAnimals = count entities "CAAnimalBase"; + dayz_currentGlobalZombies = count entities "zZombie_Base"; + + //Animals + [] spawn player_animalCheck; + + _timer = diag_tickTime; + }; - //check monitored buildings - _cursor = 0; - _delMe = false; - { - private["_bPos","_isNoone"]; - _bPos = getPosATL _x; - _isNoone = {isPlayer _x} count (_bPos nearEntities ["Man",200]) == 0; - if (_isNoone) then { - _x setVariable ["zombied",objNull,true]; - dayz_buildingMonitor set [_cursor,"DEL"]; - _delMe = true; - }; - _cursor = _cursor + 1; - } count dayz_buildingMonitor; - if (_delMe) then { - dayz_buildingMonitor = dayz_buildingMonitor - ["DEL"]; + if ((diag_tickTime - _timer1) > 60) then { + _position = getPosATL player; + //Current amounts + dayz_spawnZombies = {alive _x AND local _x} count (_position nearEntities ["zZombie_Base",200]); + dayz_CurrentNearByZombies = {alive _x} count (_position nearEntities ["zZombie_Base",200]); + dayz_currentWeaponHolders = count (_position nearObjects ["ReammoBox",100]); + + _timer1 = diag_tickTime; + }; + + //spawning system + if ((diag_tickTime - _spawnCheck) > 14) then { + ["both"] spawn player_spawnCheck; + + _spawnCheck = diag_tickTime; }; //Check if new day - _day = round(360 * (dateToNumber date)); - if(dayz_currentDay != _day) then { - dayz_sunRise = call world_sunRise; - dayz_currentDay = _day; - }; + if ((diag_tickTime - _NewDay) > 5) then { + private "_day"; + _day = round(360 * (dateToNumber date)); + if(dayz_currentDay != _day) then { + dayz_sunRise = call world_sunRise; + dayz_currentDay = _day; + + + }; - _world = toUpper(worldName); //toUpper(getText (configFile >> "CfgWorlds" >> (worldName) >> "description")); - _nearestCity = nearestLocations [([player] call FNC_GetPos), ["NameCityCapital","NameCity","NameVillage","NameLocal"],300]; - - if (count _nearestCity > 0) then { - _town = text (_nearestCity select 0); - if(dayz_PreviousTown == "Wilderness") then { + _NewDay = diag_tickTime; + + _world = toUpper(worldName); //toUpper(getText (configFile >> "CfgWorlds" >> (worldName) >> "description")); + _nearestCity = nearestLocations [([player] call FNC_GetPos), ["NameCityCapital","NameCity","NameVillage","NameLocal"],300]; + + if (count _nearestCity > 0) then { + _town = text (_nearestCity select 0); + if(dayz_PreviousTown == "Wilderness") then { + dayz_PreviousTown = _town; + }; + if(_town != dayz_PreviousTown) then { + _first = [_world,_town,""] spawn BIS_fnc_infoText; + }; dayz_PreviousTown = _town; }; - if(_town != dayz_PreviousTown) then { - _first = [_world,_town,""] spawn BIS_fnc_infoText; - }; - dayz_PreviousTown = _town; + }; //wait - sleep 5; + sleep 0.001; }; \ No newline at end of file