weather tweaks and repack for PR
This commit is contained in:
vbawol 2017-03-18 00:24:02 -05:00
parent d42f07e0a0
commit 872d8dcb73
58 changed files with 191 additions and 140 deletions

View File

@ -17,7 +17,7 @@ events[] = {
// { 1200, "MessageServer", 0, 1},
{ 2700, "AirDrop", 0 , 1},
{ 2400, "EarthQuake", 0 , 1},
{ 1800, "ChangeWeather", 1 , 1},
{ 900, "ChangeWeather", 1 , 1},
{ 1200, "ContainerSpawner", 0 , 1},
{ 300, "PlantSpawner", 0 , 1} //No comma on last Entry
};

View File

@ -1 +1 @@
build=699;
build=700;

View File

@ -1 +1 @@
build=699;
build=700;

View File

@ -1 +1 @@
build=699;
build=700;

View File

@ -6,7 +6,7 @@
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server_settings/EpochEvents/ChangeWeather.sqf
*/
private ["_tempOVRD","_rainOVRD","_fogOVRD","_overcastOVRD","_windOVRD","_arr","_response","_windValX","_windValZ","_WeatherChangeTime","_force","_rnd_temp","_fog","_rain","_overcast"];
private ["_tempOVRD","_rainOVRD","_fogOVRD","_overcastOVRD","_windOVRD","_arr","_response","_windValX","_windValZ","_WeatherChangeTime","_force","_temp","_fog","_rain","_overcast"];
// Initalize variable for tracking time between runs.
if (isNil "EPOCH_lastWeatherChange") then {
@ -23,46 +23,78 @@ _force = false;
// use config static weather if set.
if !(EPOCH_WeatherStaticForecast isEqualTo []) then {
_tempOVRD = EPOCH_WeatherStaticForecast select 0;
_rainOVRD = EPOCH_WeatherStaticForecast select 1;
_fogOVRD = EPOCH_WeatherStaticForecast select 2;
_overcastOVRD = EPOCH_WeatherStaticForecast select 3;
_windOVRD = EPOCH_WeatherStaticForecast select 4;
EPOCH_WeatherStaticForecast params ["_tempOVRD","_rainOVRD","_fogOVRD","_overcastOVRD","_windOVRD","_lightningOVRD"];
} else {
// Make database call to get "Weather:InstanceID" that can be set in the database to allow for weather controls outside of the game.
_response = ["Weather", (call EPOCH_fn_InstanceID)] call EPOCH_fnc_server_hiveGETRANGE;
if ((_response select 0) == 1 && (_response select 1) isEqualType [] && !((_response select 1) isEqualTo[])) then {
_arr = _response select 1;
_tempOVRD = _arr select 0;
_rainOVRD = _arr select 1;
_fogOVRD = _arr select 2;
_overcastOVRD = _arr select 3;
_windOVRD = _arr select 4;
_arr params ["_tempOVRD","_rainOVRD","_fogOVRD","_overcastOVRD","_windOVRD","_lightningOVRD"];
};
};
// get random temp.
_rnd_temp = if (sunOrMoon < 1) then { (random 35) + 15 } else { (random 75) + 50 };
/*
New weather configs
// push temp to all players and JIP.
missionNamespace setVariable ["EPOCH_CURRENT_WEATHER", if (isNil "_tempOVRD") then { round(_rnd_temp) } else { _tempOVRD }, true];
Normal Weather:
_randomNightTemp = [0,32,50];
_randomNightRainTemp = [0,25,45];
_randomDayTemp = [50,75,112];
_randomDayRainTemp = [50,75,99];
_randomFogValue = [0,0.1,0.2];
_randomFogDecay = [0,0.1,0.2];
_randomFogBase = [0,10,20];
_randomRainValue = [0,0.5,1];
_randomOvercastValue = [0,0.5,1];
_randomWindValX = [-5,0,5];
_randomWindValZ = [-5,0,5];
_randomWindRValX = [-10,0,10];
_randomWindRValZ = [-10,0,10];
BAD WEATHER:
*/
_randomNightTemp = [0,10,32];
_randomNightRainTemp = [-10,5,25];
_randomDayTemp = [50,95,112];
_randomDayRainTemp = [50,75,99];
_randomFogValue = [0,0.1,0.2] vectorMultiply (1-rain);
_randomFogDecay = [0,0.1,0.2] vectorMultiply (1-rain);
_randomFogBase = [0,10,20] vectorMultiply (1-rain);
_randomFogAfterRainValue = [0,0.15,0.25];
_randomFogAfterRainDecay = [0,0.20,0];
_randomFogAfterRainBase = [0,12,25];
_randomRainValue = [0,1,0];
_randomOvercastValue = [0,1,0];
_randomLightningValue = [0,1,0];
_randomWindValX = [-7,0,7];
_randomWindValZ = [-7,0,7];
_randomWindRValX = [-15,0,15];
_randomWindRValZ = [-15,0,15];
// fog, rain, overcast.
_fog = if (isNil "_fogOVRD") then { [random 0.2, random 0.2, random 20] } else { _fogOVRD };
_rain = if (isNil "_rainOVRD") then { random 1 } else { _rainOVRD };
_overcast = if (isNil "_overcastOVRD") then { random 1 } else { _overcastOVRD };
_WeatherChangeTime setFog _fog;
_WeatherChangeTime setOvercast _overcast;
_WeatherChangeTime setRain _rain;
_rain = if (isNil "_rainOVRD") then { random _randomRainValue } else { _rainOVRD };
// wind.
_windValX = random 10 - 5;
_windValZ = random 10 - 5;
if (_rain > 0.5) then {
_windValX = random 20 - 10;
_windValZ = random 20 - 10;
_windValX = random _randomWindValX;
_windValZ = random _randomWindValZ;
if (_rain > 0.1) then {
_windValX = random _randomWindRValX;
_windValZ = random _randomWindRValZ;
_randomNightTemp = _randomNightRainTemp;
_randomDayTemp = _randomDayRainTemp;
} else {
// use increase fog settings if just it rained
if (humidity > 0.5) then {
_randomFogValue = _randomFogAfterRainValue vectorMultiply humidity;
_randomFogDecay = _randomFogAfterRainDecay vectorMultiply humidity;
_randomFogBase = _randomFogAfterRainBase vectorMultiply humidity;
};
};
if !(isNil "_windOVRD") then {
@ -70,8 +102,32 @@ if !(isNil "_windOVRD") then {
_windValZ = _windOVRD select 1;
};
// cooler at night
_temp = if (sunOrMoon < 1) then { random _randomNightTemp } else { random _randomDayTemp };
// force reduced fog if temps are out of range
if (_temp < 32 || _temp > 75) then {
_randomFogValue = _randomFogValue vectorMultiply 0.1;
_randomFogDecay = _randomFogValue vectorMultiply 0.1;
_randomFogBase = _randomFogValue vectorMultiply 0.1;
};
_fog = if (isNil "_fogOVRD") then { [random _randomFogValue, random _randomFogDecay, random _randomFogBase] } else { _fogOVRD };
_overcast = if (isNil "_overcastOVRD") then { random _randomOvercastValue } else { _overcastOVRD };
_lightning = if (isNil "_lightningOVRD") then { random _randomLightningValue } else { _lightningOVRD };
_WeatherChangeTime setFog _fog;
_WeatherChangeTime setOvercast _overcast;
_WeatherChangeTime setRain _rain;
_WeatherChangeTime setLightnings _lightning;
setWind[_windValX, _windValZ, true];
// get random temp.
// push temp to all players and JIP.
missionNamespace setVariable ["EPOCH_CURRENT_WEATHER", if (isNil "_tempOVRD") then { round(_temp) } else { _tempOVRD }, true];
// will force weather change if set to true (will cause lag).
if (_force) then {
forceWeatherChange;

View File

@ -1 +1 @@
build=699;
build=700;

View File

@ -34,21 +34,20 @@ class Mission
class Intel
{
briefingName="Epoch Mod";
timeOfChanges=1800.0002;
startWeather=0.30000001;
startWind=0.1;
startWaves=0.1;
forecastWeather=0.30000001;
forecastWind=0.1;
forecastWaves=0.1;
forecastLightnings=0.1;
timeOfChanges=28800;
startWeather=0;
startWind=0;
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -34,21 +34,20 @@ class Mission
class Intel
{
briefingName="Epoch Mod";
timeOfChanges=1800.0002;
startWeather=0.30000001;
startWind=0.1;
startWaves=0.1;
forecastWeather=0.30000001;
forecastWind=0.1;
forecastWaves=0.1;
forecastLightnings=0.1;
timeOfChanges=28800;
startWeather=0;
startWind=0;
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -34,21 +34,20 @@ class Mission
class Intel
{
briefingName="Epoch Mod";
timeOfChanges=1800.0002;
startWeather=0.30000001;
startWind=0.1;
startWaves=0.1;
forecastWeather=0.30000001;
forecastWind=0.1;
forecastWaves=0.1;
forecastLightnings=0.1;
timeOfChanges=28800;
startWeather=0;
startWind=0;
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -34,21 +34,20 @@ class Mission
class Intel
{
briefingName="Epoch Mod";
timeOfChanges=1800.0002;
startWeather=0.30000001;
startWind=0.1;
startWaves=0.1;
forecastWeather=0.30000001;
forecastWind=0.1;
forecastWaves=0.1;
forecastLightnings=0.1;
timeOfChanges=28800;
startWeather=0;
startWind=0;
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -41,14 +41,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -41,14 +41,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -41,14 +41,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -41,14 +41,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -41,14 +41,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -37,21 +37,20 @@ class Mission
class Intel
{
briefingName="Epoch Mod";
timeOfChanges=1800.0002;
startWeather=0.30000001;
startWind=0.1;
startWaves=0.1;
forecastWeather=0.30000001;
forecastWind=0.1;
forecastWaves=0.1;
forecastLightnings=0.1;
timeOfChanges=28800;
startWeather=0;
startWind=0;
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -41,14 +41,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -41,14 +41,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -41,14 +41,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -41,14 +41,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -41,14 +41,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -41,14 +41,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -41,14 +41,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -41,14 +41,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -51,14 +51,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -41,14 +41,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -41,14 +41,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -41,14 +41,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -41,14 +41,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -52,14 +52,14 @@ class Mission
forecastWeather=0;
forecastWind=0;
forecastWaves=0;
forecastLightnings=1;
forecastLightnings=0;
year=2035;
month=6;
day=24;
hour=12;
minute=0;
startFogDecay=0.013;
forecastFogDecay=0.013;
startFogDecay=0;
forecastFogDecay=0;
};
class Entities
{

View File

@ -1 +1 @@
699
700