mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-15 13:26:39 +03:00
Replace sleep with uiSleep
see the below links for more info. uiSleep is based off of a more accurate method of tracking time, whereas sleep can fluctuate depending on application performance since it is based on framerate. https://community.bistudio.com/wiki/uiSleep https://community.bistudio.com/wiki/sleep_vs_uiSleep https://community.bistudio.com/wiki/sleep
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
scriptName "modules_e\Functions\objects\fn_HALO.sqf";
|
||||
sleep 0.01;
|
||||
uiSleep 0.01;
|
||||
|
||||
//--- HALO -------------------------------------------------------------------------------------------------------------------------------------
|
||||
if (typename _this == typename objnull) then {
|
||||
@@ -165,7 +165,7 @@ if (typename _this == typename objnull) then {
|
||||
bis_fnc_halo_ppRadialBlur ppEffectAdjust [0.02,0.02,0.3 - (bis_fnc_halo_vel/7)/_fpsCoef,0.3 - (bis_fnc_halo_vel/7)/_fpsCoef];
|
||||
bis_fnc_halo_ppRadialBlur ppEffectCommit 0.01;
|
||||
*/
|
||||
sleep 0.01;
|
||||
uiSleep 0.01;
|
||||
};
|
||||
//--- End
|
||||
player removeaction bis_fnc_halo_action;
|
||||
@@ -207,7 +207,7 @@ if (typename _this == typename objnull) then {
|
||||
(_vel select 2)
|
||||
];
|
||||
};
|
||||
sleep 0.01;
|
||||
uiSleep 0.01;
|
||||
};
|
||||
|
||||
//--- Open
|
||||
@@ -334,7 +334,7 @@ if (typename _this == typename []) then {
|
||||
bis_fnc_halo_para_mousemoving_eh = (finddisplay 46) displayaddeventhandler ["mousemoving","_this call bis_fnc_halo_para_loop;"];
|
||||
bis_fnc_halo_para_mouseholding_eh = (finddisplay 46) displayaddeventhandler ["mouseholding","_this call bis_fnc_halo_para_loop;"];
|
||||
|
||||
sleep 4;
|
||||
uiSleep 4;
|
||||
|
||||
// ppeffectdestroy bis_fnc_halo_DynamicBlur;
|
||||
bis_fnc_halo_para_keydown_eh = (finddisplay 46) displayaddeventhandler ["keydown","_this call bis_fnc_halo_para_keydown;"];
|
||||
|
||||
@@ -100,7 +100,7 @@ _nrTLs= _twrPos nearObjects ["#lightpoint",20];
|
||||
}else{
|
||||
deleteVehicle _x;
|
||||
};
|
||||
sleep .2;
|
||||
uiSleep 0.2;
|
||||
}count _nrTLs;
|
||||
|
||||
}else{
|
||||
@@ -112,7 +112,7 @@ _nrTLs= _twrPos nearObjects ["#lightpoint",20];
|
||||
_a = (_twrPos select 0)+(_rad * cos(_ang));
|
||||
_b = (_twrPos select 1)+(_rad * sin(_ang));
|
||||
[_lCol,_lbrt,_lamb,[_a,_b,(_twrPos select 2) + 26],_ang,[0,0,-1]] call axe_newLightPoint;
|
||||
sleep .4;
|
||||
uiSleep 0.4;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -18,12 +18,12 @@ if ((!r_player_handler1) && (r_handlerCount == 0)) then {
|
||||
"colorCorrections" ppEffectEnable true;"colorCorrections" ppEffectEnable true;"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.1], [1, 1, 1, 0.0]];"colorCorrections" ppEffectCommit 0;
|
||||
0 fadeSound 0.05;
|
||||
disableUserInput true;
|
||||
_disableHdlr = [] spawn { sleep 2; disableUserInput true; r_player_unconsciousInputDisabled = true; };
|
||||
_disableHdlr = [] spawn { uiSleep 2; disableUserInput true; r_player_unconsciousInputDisabled = true; };
|
||||
while {r_player_unconscious} do {
|
||||
_ctrl1 ctrlSetPosition [(_ctrl1Pos select 0),(_ctrl1Pos select 1),(_ctrl1Pos select 2),((0.136829 * safezoneH) * (1 -(r_player_timeout / _totalTimeout)))];
|
||||
_ctrl1 ctrlCommit 1;
|
||||
playSound "heartbeat_1";
|
||||
sleep 1;
|
||||
uiSleep 1;
|
||||
_bloodLow = ((r_player_blood/r_player_bloodTotal) < 0.5);
|
||||
|
||||
if(_timeout == 0) then {
|
||||
|
||||
@@ -15,7 +15,7 @@ if (local _animalbody) then {
|
||||
_body = _this select 1;
|
||||
_pos = getPosATL _body;
|
||||
while {(count magazines _body >0) && (time - _timer < 300) } do {
|
||||
sleep 5;
|
||||
uiSleep 5;
|
||||
};
|
||||
|
||||
hideBody _body;
|
||||
@@ -30,7 +30,7 @@ if (local _animalbody) then {
|
||||
};
|
||||
} count _inRange;
|
||||
|
||||
sleep 5;
|
||||
uiSleep 5;
|
||||
deleteVehicle _body;
|
||||
true;
|
||||
};
|
||||
|
||||
@@ -11,7 +11,7 @@ if (local _zombiebody) then {
|
||||
_body = _this select 1;
|
||||
_pos = getPosATL _body;
|
||||
while {(count magazines _body >0) && (time - _timer < 300) } do {
|
||||
sleep 5;
|
||||
uiSleep 5;
|
||||
};
|
||||
|
||||
hideBody _body;
|
||||
@@ -25,7 +25,7 @@ if (local _zombiebody) then {
|
||||
};
|
||||
} count _inRange;
|
||||
|
||||
sleep 5;
|
||||
uiSleep 5;
|
||||
deleteVehicle _body;
|
||||
true;
|
||||
};
|
||||
|
||||
@@ -95,7 +95,7 @@ if(!isNil "_objHouse")then{
|
||||
};
|
||||
|
||||
_brtns = [_plyr,_x] call axe_lightBrightness;
|
||||
while{true}do{sleep .1;if (_x animationPhase "Lights_1"==1) exitWith {};};
|
||||
while{true}do{uiSleep 0.1;if (_x animationPhase "Lights_1"==1) exitWith {};};
|
||||
|
||||
//axeDiagLog = format["HL:NEW HOUSE LIT:%1",_x];
|
||||
//publicVariable "axeDiagLog";
|
||||
|
||||
@@ -103,7 +103,7 @@ if(!isDedicated)then{
|
||||
//};
|
||||
_plyPos = [Player] call FNC_getPos;
|
||||
};
|
||||
sleep _slpTime;
|
||||
uiSleep _slpTime;
|
||||
};
|
||||
};
|
||||
//Attempt a server cleanup - Not detectable..
|
||||
@@ -121,7 +121,7 @@ if(isServer)then{
|
||||
{
|
||||
if (local _x) then {
|
||||
_x call dayz_perform_purge;
|
||||
sleep 0.025;
|
||||
uiSleep 0.025;
|
||||
_delQtyLights = _delQtyLights + 1;
|
||||
} else {
|
||||
if (!alive _x) then {
|
||||
@@ -130,13 +130,13 @@ if(isServer)then{
|
||||
_nearby = {(isPlayer _x) && (alive _x)} count (_pos nearEntities [["CAManBase","AllVehicles"], 420]);//Use calculated range here.
|
||||
if (_nearby==0) then {
|
||||
_x call dayz_perform_purge;
|
||||
sleep 0.025;
|
||||
uiSleep 0.025;
|
||||
_delQtyLights = _delQtyLights + 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
sleep 0.001;
|
||||
uiSleep 0.001;
|
||||
} forEach _missonLights;
|
||||
if (_delQtyLights > 0) then {
|
||||
_qty = count _missonLights;
|
||||
@@ -147,7 +147,7 @@ if(isServer)then{
|
||||
|
||||
while{true}do{
|
||||
[] spawn server_spawnCleanLightpoints;
|
||||
sleep 30;
|
||||
uiSleep 30;
|
||||
};
|
||||
};
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,7 @@ _objHouses = nearestObjects [_nrstTrig, ["House"], _hsRange];
|
||||
_objHouse animate ["Lights_1",1];
|
||||
};
|
||||
_sleeptime=(random 100)/100;
|
||||
sleep _sleeptime;
|
||||
uiSleep _sleeptime;
|
||||
};
|
||||
if(_hasLight)then{deleteVehicle _animlightpoint;};
|
||||
_objHouse animate ["Lights_1",0];
|
||||
|
||||
@@ -83,7 +83,7 @@ if ((_isVehicle || _isStorage || _isnewstorage) && (!_isMan) && (!(isNull (findD
|
||||
_freeSlots = [] call _countFreeSlots;
|
||||
|
||||
[] call _setControlText;
|
||||
sleep 0.01;
|
||||
uiSleep 0.01;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@ if (!isNull _flare) then {
|
||||
while {alive _flare} do {
|
||||
_lightArea setLightAmbient [((random 0.2) + 0.2),0.01,0.01];
|
||||
//_lightArea setLightColor [((random 0.1) + 0.1),0.005,0.005];
|
||||
sleep (random 0.1);
|
||||
uiSleep (random 0.1);
|
||||
};
|
||||
deleteVehicle _lightArea;
|
||||
deleteVehicle _lightSpark;
|
||||
|
||||
@@ -35,11 +35,11 @@ if ((count _list) < dayz_maxAnimals) then {
|
||||
|
||||
if (((player distance _Pos) < dayz_animalDistance) && {!(surfaceIsWater _Pos)} && {(count _list) <= 1}) then {
|
||||
if (_type == "DZ_Pastor") then { _agent = createAgent [_type, _Pos, [], 0, "NONE"]; } else { _agent = createAgent [_type, _Pos, [], 0, "FORM"]; };
|
||||
sleep 0.001;
|
||||
uiSleep 0.001;
|
||||
_agent setPos _Pos;
|
||||
_id = [_pos,_agent] execFSM "\z\addons\dayz_code\system\animal_agent.fsm";
|
||||
PVDZE_zed_Spawn = [_agent];
|
||||
publicVariableServer "PVDZE_zed_Spawn";
|
||||
};
|
||||
sleep 1;
|
||||
uiSleep 1;
|
||||
};
|
||||
|
||||
@@ -45,7 +45,7 @@ if (_anim4 == "aswm") then {
|
||||
player playActionNow "stop";
|
||||
};
|
||||
// This sleep was much needed
|
||||
sleep 5;
|
||||
uiSleep 5;
|
||||
|
||||
dayz_isSwimming = false;
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ if (_magazine == "Quiver") then {
|
||||
while {alive _projectile} do {
|
||||
_endPos = getPosATL _projectile;
|
||||
_vUp = vectorUp _projectile;
|
||||
sleep 0.01;
|
||||
uiSleep 0.01;
|
||||
};
|
||||
|
||||
_distance = _unit distance _endPos;
|
||||
@@ -41,7 +41,7 @@ if (_height < 100) then {
|
||||
if (count _hitArray > 0) then {_doLoop = false};
|
||||
if (_countr > 50) then {_doLoop = false};
|
||||
_countr = _countr + 1;
|
||||
sleep 0.1;
|
||||
uiSleep 0.1;
|
||||
};
|
||||
|
||||
if (count _hitArray > 0) then {
|
||||
|
||||
@@ -29,7 +29,7 @@ publicVariableServer "PVDZE_plr_Died";
|
||||
|
||||
_id = [player,20,true,getPosATL player] call player_alertZombies;
|
||||
|
||||
sleep 0.5;
|
||||
uiSleep 0.5;
|
||||
|
||||
player setDamage 1;
|
||||
0.1 fadeSound 0;
|
||||
@@ -85,7 +85,7 @@ r_player_dead = true;
|
||||
|
||||
//Player is Dead!
|
||||
3 fadeSound 0;
|
||||
sleep 1;
|
||||
uiSleep 1;
|
||||
|
||||
dayz_originalPlayer enableSimulation true;
|
||||
|
||||
@@ -103,7 +103,7 @@ selectPlayer dayz_originalPlayer;
|
||||
_body setVariable["combattimeout", 0, true];
|
||||
|
||||
//["dayzFlies",player] call broadcastRpcCallAll;
|
||||
sleep 2;
|
||||
uiSleep 2;
|
||||
|
||||
1 cutRsc ["DeathScreen","BLACK OUT",3];
|
||||
|
||||
@@ -112,11 +112,11 @@ playMusic "dayz_track_death_1";
|
||||
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;
|
||||
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5;
|
||||
|
||||
sleep 2;
|
||||
uiSleep 2;
|
||||
|
||||
for "_x" from 5 to 1 step -1 do {
|
||||
titleText [format[localize "str_return_lobby", _x], "PLAIN DOWN", 1];
|
||||
sleep 1;
|
||||
uiSleep 1;
|
||||
};
|
||||
|
||||
PVDZE_Server_Simulation = [_body, false];
|
||||
|
||||
@@ -15,7 +15,7 @@ if (_object == player) then {
|
||||
};
|
||||
player setVariable ["freeTarget",true,true];
|
||||
//_timeStart = time;
|
||||
sleep _wait;
|
||||
uiSleep _wait;
|
||||
player setVariable ["freeTarget",false,true];
|
||||
|
||||
} else {
|
||||
|
||||
@@ -99,7 +99,7 @@ player addWeapon "Flare";
|
||||
call dayz_meleeMagazineCheck;
|
||||
};
|
||||
|
||||
sleep 0.1;
|
||||
uiSleep 0.1;
|
||||
|
||||
if (!isNull _old) then {
|
||||
// this should not be needed as player is deleted in player_switchModel?
|
||||
|
||||
@@ -21,9 +21,9 @@ _text = getText (configFile >> "CfgVehicles" >> _objType >> "displayName");
|
||||
if(isNull _obj) exitWith { DZE_ActionInProgress = false; };
|
||||
[1,1] call dayz_HungerThirst;
|
||||
player playActionNow "Medic";
|
||||
sleep 1;
|
||||
uiSleep 1;
|
||||
[player,"tentpack",0,false] call dayz_zombieSpeak;
|
||||
sleep 5;
|
||||
uiSleep 5;
|
||||
|
||||
_playerNear = _obj call dze_isnearest_player;
|
||||
if(_playerNear) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_11") , "PLAIN DOWN"]; };
|
||||
|
||||
@@ -7,5 +7,5 @@ while {!r_player_dead} do {
|
||||
if (!r_player_unconscious && !r_pitchWhine) then {
|
||||
playMusic _sound;
|
||||
};
|
||||
sleep _pause;
|
||||
uiSleep _pause;
|
||||
};
|
||||
@@ -55,7 +55,7 @@ while {!isNull _display} do {
|
||||
_sleep = 1;
|
||||
};
|
||||
};
|
||||
sleep _sleep;
|
||||
uiSleep _sleep;
|
||||
_timeOut = diag_tickTime;
|
||||
};
|
||||
cutText ["", "PLAIN DOWN"];
|
||||
|
||||
@@ -37,7 +37,7 @@ _sfx = "tentpack";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
sleep 3;
|
||||
uiSleep 3;
|
||||
|
||||
_classname = getText (configFile >> "CfgVehicles" >> (typeOf _obj) >> "create");
|
||||
|
||||
|
||||
@@ -38,9 +38,9 @@ if (_alreadyPacking == 1) exitWith {DZE_ActionInProgress = false; s_player_packv
|
||||
_obj setVariable["packing",1];
|
||||
|
||||
cutText [format[(localize "str_epoch_player_121"),_text], "PLAIN DOWN"];
|
||||
sleep 1;
|
||||
uiSleep 1;
|
||||
_location1 = getPosATL player;
|
||||
sleep 5;
|
||||
uiSleep 5;
|
||||
_location2 = getPosATL player;
|
||||
|
||||
if(_location1 distance _location2 > 0.1) exitWith {
|
||||
@@ -59,7 +59,7 @@ if(!isNull _obj && alive _obj) then {
|
||||
[1,1] call dayz_HungerThirst;
|
||||
player playActionNow "Medic";
|
||||
[player,"tentpack",0,false] call dayz_zombieSpeak;
|
||||
sleep 3;
|
||||
uiSleep 3;
|
||||
|
||||
_weapons = getWeaponCargo _obj;
|
||||
_magazines = getMagazineCargo _obj;
|
||||
|
||||
@@ -17,7 +17,7 @@ while {(alive _projectile) && !(isNull _projectile) && _callCount < 85;} do {
|
||||
_projectilespeed = Speed _projectile;
|
||||
_projectflight = (((_projectilespeed / 60) * 1000));
|
||||
if (_projectflight > 0) then {
|
||||
sleep (12 / (_projectflight));
|
||||
uiSleep (12 / (_projectflight));
|
||||
};
|
||||
if (alive _projectile && !(isNull _projectile)) then {_currentNear = ([_projectile] call FNC_GetPos) nearEntities [["CAManBase","AllVehicles"],15];};
|
||||
_listNear = _listNear + _currentNear;
|
||||
|
||||
@@ -129,9 +129,9 @@ if (!isNil "_newBackpackType") then {
|
||||
_backpackWpnQtys = _backpackWpn select 1;
|
||||
};
|
||||
[] call _switchUnit;
|
||||
if (gear_done) then {sleep 0.001;};
|
||||
if (gear_done) then {uiSleep 0.001;};
|
||||
["1"] call gearDialog_create;
|
||||
if (gear_done) then {sleep 0.001;};
|
||||
if (gear_done) then {uiSleep 0.001;};
|
||||
//magazines
|
||||
_countr = 0;
|
||||
{
|
||||
@@ -152,7 +152,7 @@ if (!isNil "_newBackpackType") then {
|
||||
};
|
||||
} count _backpackMag;
|
||||
(findDisplay 106) closeDisplay 0;
|
||||
if (gear_done) then {sleep 0.001; disableUserInput false;};
|
||||
if (gear_done) then {uiSleep 0.001; disableUserInput false;};
|
||||
_countr = 0;
|
||||
{
|
||||
(unitBackpack player) addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)];
|
||||
|
||||
@@ -14,7 +14,7 @@ while {_doWait} do {
|
||||
if (!(alive _projectile)) then {_doWait = false};
|
||||
if (_vel < 0.1) then {_doWait = false};
|
||||
_endPos = getPosATL _projectile;
|
||||
sleep 0.01;
|
||||
uiSleep 0.01;
|
||||
};
|
||||
|
||||
_distance = parseNumber format["%1",(getArray (configFile >> "CfgAmmo" >> _ammo >> "soundHit") select 3)];
|
||||
|
||||
@@ -183,7 +183,7 @@ TraderDialogShowPrices = {
|
||||
private ["_index", "_item"];
|
||||
_index = _this select 0;
|
||||
if (_index < 0) exitWith {};
|
||||
while {count TraderItemList < 1} do { sleep 1; };
|
||||
while {count TraderItemList < 1} do { uiSleep 1; };
|
||||
_item = TraderItemList select _index;
|
||||
|
||||
_qty = {_x == (_item select 3)} count magazines player;
|
||||
|
||||
@@ -171,7 +171,7 @@ TraderDialogShowPrices = {
|
||||
private ["_index", "_item"];
|
||||
_index = _this select 0;
|
||||
if (_index < 0) exitWith {};
|
||||
while {count TraderItemList < 1} do { sleep 1; };
|
||||
while {count TraderItemList < 1} do { uiSleep 1; };
|
||||
_item = TraderItemList select _index;
|
||||
|
||||
_qty = {_x == (_item select 3)} count magazines player;
|
||||
|
||||
@@ -67,9 +67,9 @@ if ((_ownerID == dayz_combination) || (_ownerID == dayz_playerUID)) then {
|
||||
_magazines = _obj getVariable["MagazineCargo",[]];
|
||||
_backpacks = _obj getVariable["BackpackCargo",[]];
|
||||
player playActionNow "Medic";
|
||||
sleep 1;
|
||||
uiSleep 1;
|
||||
[player,"tentpack",0,false] call dayz_zombieSpeak;
|
||||
sleep 5;
|
||||
uiSleep 5;
|
||||
|
||||
_holder = createVehicle [_unlockedClass,_pos,[], 0, "CAN_COLLIDE"];
|
||||
// Remove locked vault
|
||||
@@ -128,10 +128,10 @@ if ((_ownerID == dayz_combination) || (_ownerID == dayz_playerUID)) then {
|
||||
} else {
|
||||
[10,10] call dayz_HungerThirst;
|
||||
player playActionNow "Medic";
|
||||
sleep 1;
|
||||
uiSleep 1;
|
||||
[player,"repair",0,false] call dayz_zombieSpeak;
|
||||
[player,25,true,(getPosATL player)] spawn player_alertZombies;
|
||||
sleep 5;
|
||||
uiSleep 5;
|
||||
cutText [format[(localize "str_epoch_player_126"),_text], "PLAIN DOWN"];
|
||||
};
|
||||
s_player_unlockvault = -1;
|
||||
|
||||
@@ -41,7 +41,7 @@ if (local _unit) then {
|
||||
};
|
||||
|
||||
//Wait
|
||||
sleep 0.3;
|
||||
uiSleep 0.3;
|
||||
|
||||
if (_vehicle != player) then {
|
||||
_hpList = _vehicle call vehicle_getHitpoints;
|
||||
|
||||
@@ -22,7 +22,7 @@ _dog = _this select 3;
|
||||
player removeMagazine "FoodSteakRaw";
|
||||
_animalID = _dog getVariable "fsm_handle";
|
||||
_animalID setFSMVariable ["_isTamed", true];
|
||||
sleep 1;
|
||||
uiSleep 1;
|
||||
// diag_log format["DEBUG: %1, id: %2 [%3]",_dog,_animalID,completedFSM _animalID];
|
||||
if (!moveToCompleted _dog) then {
|
||||
_dog moveTo ([_dog] call FNC_GetPos);
|
||||
|
||||
@@ -76,7 +76,7 @@ if ((dayz_spawnZombies < _maxControlledZombies) && (dayz_CurrentNearByZombies <
|
||||
if (surfaceIsWater _position) exitwith { };
|
||||
|
||||
_agent = createAgent [_type, _position, [], _radius, _method];
|
||||
sleep 0.001;
|
||||
uiSleep 0.001;
|
||||
|
||||
//add to global counter
|
||||
dayz_spawnZombies = dayz_spawnZombies + 1;
|
||||
@@ -122,15 +122,15 @@ if ((dayz_spawnZombies < _maxControlledZombies) && (dayz_CurrentNearByZombies <
|
||||
_agtPos = getPosASL _agent;
|
||||
_agtPos set [2, -3];
|
||||
_agent setPosASL _agtPos;
|
||||
sleep 0.001;
|
||||
uiSleep 0.001;
|
||||
_agtPos = +(_position);
|
||||
_agtPos set [2, -3];
|
||||
_agent setPosASL _agtPos;
|
||||
sleep 0.001;
|
||||
uiSleep 0.001;
|
||||
*/
|
||||
_agent setDir random 360;
|
||||
//_agent setPosATL _position;
|
||||
sleep 0.001;
|
||||
uiSleep 0.001;
|
||||
|
||||
_position = getPosATL _agent;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user