Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BP_Weather_Current = "None";
- private ["_transitionTime","_weatherTemplatesSunny","_weatherTemplatesRain","_weatherTemplatesStorm","_weatherTemplate"];
- if(BP_Weather_Current == "None") then
- {
- _transitionTime = 0;
- }
- else
- {
- _transitionTime = 5400;
- };
- if(worldname == "Tembelan") then
- {
- _weatherTemplatesSunny =
- [
- ["Clear", [0.1,0,0,0,0,0,0]],
- ["Clear", [0.15,0,[0.9, 0.14, 3],0,0,0,0]],
- ["Clear", [0.2,0,0,0,0,0,0]],
- ["Clear", [0.25,0,[0.9, 0.14, 3],0,0,0,0]],
- ["Clear", [0.3,0,0,0,0,0,0]],
- ["Clear", [0.3,0,[0.9, 0.14, 3],0,0,0,0]],
- ["Cloudy", [0.35,0,0,0.2,0,0.35]],
- ["Cloudy", [0.35,0,[0.9, 0.14, 3],0.2,0,0.35]],
- ["Cloudy", [0.4,0,0,0.2,0,0.35]],
- ["Cloudy", [0.44,0,[0.9, 0.14, 3],0.3,0,0.35]],
- ["Cloudy", [0.46,0,0,0.3,0,0.35]],
- ["Cloudy", [0.48,0,[0.9, 0.14, 3],0.2,0,0.3]],
- ["Cloudy", [0.5,0,0,0.3,0,0.35]]
- ];
- _weatherTemplatesRain =
- [
- ["Light Rain", [0.6,0.1,0,0.3,0,0.45]],
- ["Light Rain", [0.6,0.12,[0.9, 0.14, 3],0.1,0,0.2]],
- ["Light Rain", [0.6,0.14,0,0.3,0,0.45]],
- ["Light Rain", [0.6,0.18,0,0.3,0,0.45]],
- ["Light Rain", [0.6,0.2,0,0.3,0,0.45]],
- ["Medium Rain", [0.6,0.22,0,0.3,0,0.45]],
- ["Medium Rain", [0.6,0.25,[0.001, -0.02, -165],0.3,0,0.45]],
- ["Medium Rain", [0.6,0.28,0,0.4,0,0.55]],
- ["Medium Rain", [0.6,0.3,0,0.4,0,0.55]],
- ["Medium Rain", [0.6,0.32,0,0.5,0,0.65]],
- ["Medium Rain", [0.6,0.36,0,0.5,0,0.65]]
- ];
- _weatherTemplatesStorm =
- [
- ["Rainstorm", [0.7,0.3,[0.001, -0.02, -165],0.3,0,0.45]],
- ["Rainstorm", [0.7,0.3,0,0.3,1,0.45]],
- ["Rainstorm", [0.7,0.4,[0.001, -0.02, -165],0.4,0,0.6]],
- ["Rainstorm", [0.7,0.4,0,0.4,1,0.6]],
- ["Rainstorm", [0.7,0.5,[0.001, -0.02, -165],0.5,0,0.7]],
- ["Rainstorm", [0.7,0.6,0,0.5,1,0.7]],
- ["Rainstorm", [0.8,0.6,[0.001, -0.02, -165],0.6,0,0.8]],
- ["Rainstorm", [0.8,0.7,0,0.6,1,0.8]],
- ["Rainstorm", [0.9,0.8,[0.001, -0.02, -165],0.7,0,0.9]],
- ["Rainstorm", [0.9,0.9,0,0.7,1,0.9]],
- ["Rainstorm", [1,1,0,1,1,1]]
- ];
- BP_fnc_getNewWeatherTemplate =
- {
- _weatherSelection = round(random 100);
- if (_weatherSelection <= 35) then
- {
- if (_weatherSelection <= 12) then
- {
- _weatherTemplate = selectRandom _weatherTemplatesStorm;
- }
- else
- {
- _weatherTemplate = selectRandom _weatherTemplatesRain;
- };
- }
- else
- {
- _weatherTemplate = selectRandom _weatherTemplatesSunny;
- };
- };
- }
- else
- {
- _weatherTemplatesSunny =
- [
- ["Clear", [0.1,0,0,0,0,0,0]],
- ["Clear", [0.1,0,0,0,0,0,0]],
- ["Clear", [0.2,0,0,0,0,0,0]],
- ["Clear", [0.2,0,0,0,0,0,0]],
- ["Clear", [0.3,0,0,0,0,0,0]],
- ["Clear", [0.3,0,0,0,0,0,0]],
- ["Cloudy", [0.35,0,0,0.2,0,0.35]],
- ["Cloudy", [0.35,0,0,0.2,0,0.35]],
- ["Cloudy", [0.4,0,0,0.2,0,0.35]],
- ["Cloudy", [0.4,0,0,0.3,0,0.35]],
- ["Cloudy", [0.45,0,0,0.3,0,0.35]],
- ["Cloudy", [0.45,0,0,0.3,0,0.35]],
- ["Cloudy", [0.5,0,0,0.3,0,0.35]]
- ];
- _weatherTemplatesRain =
- [
- ["Light Rain", [0.6,0.1,0,0.3,0,0.45]],
- ["Light Rain", [0.6,0.12,0,0.3,0,0.45]],
- ["Light Rain", [0.6,0.14,0,0.3,0,0.45]],
- ["Light Rain", [0.6,0.18,0,0.3,0,0.45]],
- ["Light Rain", [0.6,0.2,0,0.3,0,0.45]],
- ["Medium Rain", [0.6,0.22,0,0.3,0,0.45]],
- ["Medium Rain", [0.6,0.25,0,0.3,0,0.45]],
- ["Medium Rain", [0.6,0.28,0,0.4,0,0.55]],
- ["Medium Rain", [0.6,0.3,0,0.4,0,0.55]],
- ["Medium Rain", [0.6,0.32,0,0.5,0,0.65]],
- ["Medium Rain", [0.6,0.36,0,0.5,0,0.65]]
- ];
- _weatherTemplatesStorm =
- [
- ["Rainstorm", [0.7,0.3,0,0.3,0,0.45]],
- ["Rainstorm", [0.7,0.3,0,0.3,1,0.45]],
- ["Rainstorm", [0.7,0.4,0,0.4,0,0.6]],
- ["Rainstorm", [0.7,0.4,0,0.4,1,0.6]],
- ["Rainstorm", [0.7,0.5,0,0.5,0,0.7]],
- ["Rainstorm", [0.7,0.6,0,0.5,1,0.7]],
- ["Rainstorm", [0.8,0.6,0,0.6,0,0.8]],
- ["Rainstorm", [0.8,0.7,0,0.6,1,0.8]],
- ["Rainstorm", [0.9,0.8,0,0.7,0,0.9]],
- ["Rainstorm", [0.9,0.9,0,0.7,1,0.9]],
- ["Rainstorm", [1,1,0,1,1,1]]
- ];
- BP_fnc_getNewWeatherTemplate =
- {
- _weatherSelection = round(random 100);
- if (_weatherSelection <= 20) then
- {
- if (_weatherSelection <= 8) then
- {
- _weatherTemplate = selectRandom _weatherTemplatesStorm;
- }
- else
- {
- _weatherTemplate = selectRandom _weatherTemplatesRain;
- };
- }
- else
- {
- _weatherTemplate = selectRandom _weatherTemplatesSunny;
- };
- };
- };
- call BP_fnc_getNewWeatherTemplate;
- while {BP_Weather_Current isEqualto (_weatherTemplate select 0)}
- do
- {
- call BP_fnc_getNewWeatherTemplate;
- };
- [_weatherTemplate,_transitionTime] spawn
- {
- _weatherTemplate = _this select 0;
- _transitionTime = _this select 1;
- (_weatherTemplate select 1) params ["_weatherInitialOvercast","_weatherInitialRainSnow","_weatherInitialFog","_weatherInitialWindStrengh","_weatherInitialLightning","_weatherInitialWaves"];
- BP_Weather_Current = _weatherTemplate select 0;
- SystemChat format["Weather Engine Weather Update: %1", _weatherTemplate];
- skipTime -24;
- sleep 0.1;
- _transitionTime setFog _weatherInitialFog;
- _transitionTime setOvercast _weatherInitialOvercast;
- _transitionTime setWaves _weatherInitialWaves;
- _transitionTime setWindStr _weatherInitialWindStrengh;
- _transitionTime setWindDir round (random 360);
- _transitionTime setRain _weatherInitialRainSnow;
- _transitionTime setLightnings _weatherInitialLightning;
- sleep 0.1;
- skipTime 24;
- sleep 0.1;
- simulWeatherSync;
- };
Add Comment
Please, Sign In to add comment