Tweaked weather to just be managed on server

This commit is contained in:
Wyqer 2019-06-25 18:21:55 +02:00
parent 39a343f6d8
commit 33577ddc45
No known key found for this signature in database
GPG Key ID: D7E2F8BD7F1E48FA
3 changed files with 16 additions and 25 deletions

View File

@ -1,17 +1,18 @@
private [ "_weathers", "_weathertime" ];
private _weathers = [
[0.25],
[0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55],
[0, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1]
] select (GRLIB_weather_param - 1);
_weathers = [0.4];
if ( GRLIB_weather_param == 2 ) then {
_weathers = [0,0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55];
private _newWeather = selectRandom _weathers;
0 setOvercast _newWeather;
forceWeatherChange;
diag_log format ["[KP LIBERATION] [WEATHER] Set initial weather to: %1 - Param Value: %2 - Time: %3", _newWeather, GRLIB_weather_param, diag_tickTime];
while {GRLIB_endgame == 0} do {
_newWeather = selectRandom _weathers;
3600 setOvercast _newWeather;
diag_log format ["[KP LIBERATION] [WEATHER] Set next weather transition to: %1 - Time: %2", _newWeather, diag_tickTime];
sleep 3000; // Slighty less than weather transition time, as sleep duration is depending on FPS
};
if ( GRLIB_weather_param == 3 ) then {
_weathers = [0,0.01,0.02,0.03,0.05,0.07,0.1,0.15,0.2,0.25,0.3,0.4,0.45,0.5,0.55,0.6,0.7,0.8,0.9,1.0];
};
_weathertime = 1800;
while { GRLIB_endgame == 0 } do {
chosen_weather = selectRandom _weathers;
publicVariable "chosen_weather";
sleep _weathertime;
};

View File

@ -39,4 +39,3 @@ asymm_notifications = compileFinal preprocessFileLineNumbers "scripts\client\asy
execVM "scripts\shared\scan_skill.sqf";
execVM "scripts\shared\diagnostics.sqf";
execVM "scripts\shared\manage_weather.sqf";

View File

@ -1,9 +0,0 @@
waitUntil { !isNil "chosen_weather" };
while { true } do {
3600 setOvercast chosen_weather;
if ( overcast < 0.75 ) then { 2 setRain 0 };
if ( overcast >= 0.75 && overcast < 0.95 ) then { 2 setRain 0.1 };
if ( overcast >= 0.95 ) then { 2 setRain 0.2 }; // Removed heavy rain due to severe fps issues
sleep 5;
};