From aea83659bad3be46e0c81213581964a5dd333811 Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Thu, 21 Nov 2013 09:51:34 -0600 Subject: [PATCH] weather test 2 --- SQF/dayz_code/system/player_monitor.fsm | 66 +++++++++++++++++++--- SQF/dayz_server/compile/server_weather.sqf | 58 +++++-------------- 2 files changed, 72 insertions(+), 52 deletions(-) diff --git a/SQF/dayz_code/system/player_monitor.fsm b/SQF/dayz_code/system/player_monitor.fsm index 7cb334b00..4c84e4590 100644 --- a/SQF/dayz_code/system/player_monitor.fsm +++ b/SQF/dayz_code/system/player_monitor.fsm @@ -24,7 +24,7 @@ item19[] = {"ERROR__Wrong_HIVE",2,250,175.000000,500.000000,275.000000,550.00000 item20[] = {"Hive_Ok",4,218,-175.000000,550.000000,-75.000000,600.000000,0.000000,"Hive" \n "Ok"}; item21[] = {"Phase_One",2,250,-75.000000,600.000000,25.000000,650.000000,0.000000,"Phase One"}; item22[] = {"Response",4,218,-175.000000,650.000000,-75.000000,700.000000,0.000000,"Response"}; -item23[] = {"Phase_Two",2,4346,-75.000000,700.000000,25.000000,750.000000,0.000000,"Phase Two"}; +item23[] = {"Phase_Two",2,250,-75.000000,700.000000,25.000000,750.000000,0.000000,"Phase Two"}; item24[] = {"Dead_Player",4,218,50.000000,700.000000,150.000000,750.000000,0.000000,"Dead" \n "Player"}; item25[] = {"ERROR__Player_Already",2,250,175.000000,700.000000,275.000000,750.000000,0.000000,"ERROR:" \n "Player Already" \n "Dead"}; item26[] = {"Alive",4,218,-175.000000,750.000000,-75.000000,800.000000,0.000000,"Alive"}; @@ -34,7 +34,7 @@ item29[] = {"Load_In",2,250,-75.000000,1000.000000,25.000000,1050.000000,0.00000 item30[] = {"Bad_Version",4,218,50.000000,800.000000,150.000000,850.000000,0.000000,"Bad" \n "Version"}; item31[] = {"ERROR__Bad_Versi",2,250,175.000000,800.000000,275.000000,850.000000,0.000000,"ERROR:" \n "Bad Version"}; item32[] = {"Display_Ready",4,218,-175.000000,1050.000000,-75.000000,1100.000000,0.000000,"Display" \n "Ready"}; -item33[] = {"Preload_Display",2,250,-75.000000,1100.000000,25.000000,1150.000000,0.000000,"Preload" \n "Display"}; +item33[] = {"Preload_Display",2,4346,-75.000000,1100.000000,25.000000,1150.000000,0.000000,"Preload" \n "Display"}; item34[] = {"Preload_Done",4,218,-175.000000,1150.000000,-75.000000,1200.000000,0.000000,"Preload" \n "Done"}; item35[] = {"Initialize",2,250,-75.000000,1200.000000,25.000000,1250.000000,0.000000,"Initialize"}; item36[] = {"Finish",1,250,-75.000000,1300.000000,25.000000,1350.000000,0.000000,"Finish"}; @@ -152,8 +152,8 @@ link77[] = {66,59}; link78[] = {67,15}; link79[] = {68,69}; link80[] = {69,20}; -globals[] = {25.000000,1,0,0,0,640,480,1,131,6316128,1,-592.955444,422.624878,1027.017090,306.503998,888,630,1}; -window[] = {2,-1,-1,-1,-1,858,78,1370,78,3,906}; +globals[] = {25.000000,1,0,0,0,640,480,1,131,6316128,1,-535.262817,364.931976,1733.816284,841.731445,888,880,1}; +window[] = {2,-1,-1,-1,-1,759,1,1279,1,3,906}; *//*%FSM*/ class FSM { @@ -1148,13 +1148,63 @@ class FSM " _windz = (zeroCurrentWeather select 2) select 1;" \n " _rain = zeroCurrentWeather select 3;" \n "" \n + " if(isNil ""DZE_Overcast"") then {" \n + " DZE_Overcast = _overcast;" \n + " };" \n + " if(isNil ""DZE_Fog"") then {" \n + " DZE_Fog = _fog;" \n + " };" \n + " if(isNil ""DZE_Windx"") then {" \n + " DZE_Windx = _windx;" \n + " };" \n + " if(isNil ""DZE_Windz"") then {" \n + " DZE_Windz = _windz;" \n + " };" \n + " if(isNil ""DZE_Rain"") then {" \n + " DZE_Rain = _rain;" \n + " };" \n + " " \n + " " \n + " if(_overcast < DZE_Overcast) then {" \n + " DZE_Overcast = DZE_Overcast + 0.01;" \n + " } else {" \n + " DZE_Overcast = DZE_Overcast - 0.01;" \n + " };" \n + " if(_fog < DZE_Fog) then {" \n + " DZE_Fog = DZE_Fog + 0.01;" \n + " } else {" \n + " DZE_Fog = DZE_Fog - 0.01;" \n + " };" \n + " if(_windx < DZE_Windx) then {" \n + " DZE_Windx = DZE_Windx + 0.01;" \n + " } else {" \n + " DZE_Windx = DZE_Windx - 0.01;" \n + " };" \n + " " \n + " if(_windz < DZE_Windz) then {" \n + " DZE_Windz = DZE_Windz + 0.01;" \n + " } else {" \n + " DZE_Windz = DZE_Windz - 0.01;" \n + " };" \n + " " \n + " if(_rain < DZE_Rain) then {" \n + " DZE_Rain = DZE_Rain + 0.01;" \n + " } else {" \n + " DZE_Rain = DZE_Rain - 0.01;" \n + " };" \n + " " \n " // Set weather" \n - " 0 setOvercast _overcast;" \n - " 0 setFog _fog;" \n - " setWind [_windx,_windz,true];" \n - " 0 setRain _rain;" \n + " 0 setOvercast DZE_Overcast;" \n + "" \n + " 0 setFog DZE_Fog;" \n + " " \n + " setWind [DZE_Windx,DZE_Windz,true];" \n + " " \n + " 0 setRain DZE_Rain;" \n "" \n " sleep 1;" \n + "" \n + " " \n " };" \n "};" \n "" \n diff --git a/SQF/dayz_server/compile/server_weather.sqf b/SQF/dayz_server/compile/server_weather.sqf index fafcdf773..bf391051f 100644 --- a/SQF/dayz_server/compile/server_weather.sqf +++ b/SQF/dayz_server/compile/server_weather.sqf @@ -4,52 +4,22 @@ private ["_weather","_windX","_windY","_weatherOptions","_numWeatherOptions","_f //wind is split randomly in to east-west/north-south direction _weatherOptions = [ - [0, 0, 5, 0], - [0, 0, 4, 0], - [0, 0, 3, 0], - [0, 0.1, 2, 0], - [0, 0.2, 1, 0], - [0, 0.3, 2, 0], - [0, 0.4, 3, 0], - [0, 0.5, 4, 0], - [0, 0.4, 5, 0], - [0, 0.3, 5, 0], - [0, 0.2, 4, 0], - [0.1, 0.1, 3, 0.1], - [0.2, 0.1, 2, 0.2], - [0.3, 0, 1, 0.3], - [0.4, 0, 2, 0.4], - [0.5, 0, 3, 0.5], - [0.6, 0, 4, 0.6], - [0.7, 0, 5, 0.7], - [0.8, 0, 6, 0.8], - [0.9, 0, 7, 0.9], - [1, 0, 8, 1], - [0.9, 0, 9, 0.9], - [0.8, 0, 8, 0.8], - [0.7, 0.1, 7, 0.7], - [0.6, 0.2, 6, 0.6], - [0.5, 0.3, 5, 0.5], - [0.4, 0.4, 4, 0.4], - [0.3, 0.5, 3, 0.3], - [0.2, 0.4, 3, 0.2], - [0.1, 0.3, 4, 0.1], - [0.2, 0.2, 5, 0.2], - [0.3, 0.1, 6, 0.3], - [0.4, 0.2, 7, 0.4], - [0.5, 0.3, 8, 0.5], - [0.5, 0.4, 9, 0.6], - [0.6, 0.5, 10, 0.7], - [0.5, 0.6, 11, 0.8], - [0.4, 0.7, 12, 0.8], - [0.3, 0.8, 13, 0.9], - [0.2, 0.9, 14, 0.9], - [0.1, 1, 15, 1] + [0, 0, 4, 0], + [0.1, 0.1, 5, 0.1], + [0.3, 0.2, 6, 0.2], + [0.4, 0.3, 7, 0.3], + [0.5, 0.4, 8, 0.4], + [0.5, 0.5, 9, 0.5], + [0.6, 0.4, 10, 0.6], + [0.7, 0.3, 11, 0.7], + [0.8, 0.2, 12, 0.8], + [0.9, 0.1, 13, 0.9], + [1, 1, 15, 1] ]; _numWeatherOptions = count _weatherOptions; -// get inital weather forcast for the next 60 minutes -_forcastTime = 3600; +// get inital weather forcast for the next 5 minutes +_forcastTime = 300; if (isNil "WeatherForcast" and isNil "WeatherForcastTime") then { WeatherForcast = floor(random(_numWeatherOptions)); WeatherForcastTime = diag_tickTime; @@ -67,7 +37,7 @@ if (isNil "CurrentWeatherOption") then { } else { if(CurrentWeatherOption < WeatherForcast) then { // start transition up if forcast is higher in the array than current weather - CurrentWeatherOption = ((CurrentWeatherOption + 1) min _weatherOptions); + CurrentWeatherOption = ((CurrentWeatherOption + 1) min _numWeatherOptions); } else { // start transition down if forcast is lower in the array than current weather if (CurrentWeatherOption != WeatherForcast and WeatherForcastTime >= _forcastTime) then {