5 #ifdef WEATHER_DATA_LOGGING
6 int overcastChangeCount = 0;
7 int badWeatherCount = 0;
8 int cloudyWeatherCount = 0;
9 int clearWeatherCount = 0;
24 "-500.00 165.00 5231.69",
25 "-500.00 300.00 9934.41",
26 "10406.86 192.00 15860.00",
27 "4811.75 370.00 15860.00",
28 "-500.00 453.00 15860.00"
42 m_MinTemps = {-3,-2,0,4,9,14,18,17,13,11,9,0};
51 m_MaxTemps = {3,5,7,14,19,24,26,25,18,14,10,5};
73 if (
g_Game.IsMultiplayer())
76 m_Weather.GetOvercast().Set(startingOvercast,0,5);
84 super.SetupWeatherSettings();
94 #ifdef WEATHER_DATA_LOGGING
97 g_Game.GetWorld().GetDate(startYear, startMonth, startDay, startHour, startMinute);
103 float phmnLength = 10;
122 #ifdef WEATHER_DATA_LOGGING
123 overcastChangeCount++;
126 float windDirection, windMag;
138 if (
m_LastWeather == WorldDataWeatherConstants.CLEAR_WEATHER )
143 if (
m_LastWeather == WorldDataWeatherConstants.CLOUDY_WEATHER )
148 if (
m_LastWeather == WorldDataWeatherConstants.BAD_WEATHER )
158 if (
m_LastWeather == WorldDataWeatherConstants.CLEAR_WEATHER )
164 if (
m_LastWeather == WorldDataWeatherConstants.BAD_WEATHER )
170 if (
m_LastWeather == WorldDataWeatherConstants.CLOUDY_WEATHER )
185 #ifdef WEATHER_DATA_LOGGING
197 #ifdef WEATHER_DATA_LOGGING
198 cloudyWeatherCount++;
209 #ifdef WEATHER_DATA_LOGGING
218 m_Weather.GetOvercast().Set( phmnValue, phmnTime, phmnLength );
226 Debug.
WeatherLog(
string.Format(
"Chernarus::Weather::Overcast:: (%1) overcast: %2",
g_Game.GetDayTime(), actual));
229 #ifdef WEATHER_DATA_LOGGING
235 g_Game.GetWorld().GetDate(testYear, testMonth, testDay, testHour, testMinute);
237 if ( testDay - startDay > currentDay && testHour - startHour >= 0 && testMinute - startMinute >= 0 )
240 FPrintln(file,
"================================================================");
241 FPrintln(file,
" ================== Day " + (currentDay + 1) +
" ================== ");
242 FPrintln(file,
"================================================================");
243 FPrintln(file,
"Overcast Change Count: " + overcastChangeCount);
244 FPrintln(file,
"Bad Weather Change Count: " + badWeatherCount);
245 FPrintln(file,
"Cloudy Weather Count: " + cloudyWeatherCount);
246 FPrintln(file,
"Clear Weather Count: " + clearWeatherCount);
250 if ( currentDay == daysToRun )
255 overcastChangeCount = 0;
257 cloudyWeatherCount = 0;
258 clearWeatherCount = 0;
267 float actualOvercast =
m_Weather.GetOvercast().GetActual();
277 Debug.
WeatherLog(
string.Format(
"Chernarus::Weather::Rain::ForceEnd:: (%1) %2 -> 0",
g_Game.GetDayTime(), actual));
287 m_Weather.GetRain().Set( phmnValue, phmnTime, phmnLength );
288 Debug.
WeatherLog(
string.Format(
"Chernarus::Weather::Rain::ForceStorm:: (%1) %2 -> %3",
g_Game.GetDayTime(), actual, phmnValue));
293 if ( actualOvercast < 0.75 )
348 m_Weather.GetRain().Set( phmnValue, phmnTime, phmnLength );
359 float fogTime = 1800.0;
363 if ( fogyMorning > 0.85 )
365 if ( (
g_Game.GetDayTime() > 4 &&
g_Game.GetDayTime() < 7 ) )
373 if (
m_Weather.GetOvercast().GetActual() < 0.3 )
399 protected override void CalculateWind(
int newWeather,
bool suddenChange, out
float magnitude, out
float direction)
406 if ( newWeather == WorldDataWeatherConstants.CLEAR_WEATHER )
408 if ( windChance < 30 )
413 else if ( windChance < 75 )
425 else if ( newWeather == WorldDataWeatherConstants.CLOUDY_WEATHER )
427 if ( windChance < 45 )
432 else if ( windChance < 90 )
450 else if ( windChance < 45 )
455 else if ( windChance < 90 )
468 protected override void CalculateVolFog(
float lerpValue,
float windMagnitude,
float changeTime)
470 float distanceDensity, heigthDensity, heightBias;
471 int year, month, day, hour, minute;
472 g_Game.GetWorld().GetDate(year, month, day, hour, minute);
474 if ( hour < 9 && hour >= 5 )
476 distanceDensity =
Math.
Lerp( 0.015, 0.05, lerpValue ) *
Math.
Clamp(1 - (windMagnitude /
m_Weather.GetWindMaximumSpeed()), 0.1, 1);
477 heigthDensity =
Math.
Lerp( 0.8, 1, lerpValue);
479 heightBias =
m_Weather.GetDynVolFogHeightBias();
489 else if (diceRoll < 85)
499 else if ( hour < 18 && hour >= 9 )
501 distanceDensity =
Math.
Lerp( 0.01, 0.05, lerpValue ) *
Math.
Clamp(1 - (windMagnitude /
m_Weather.GetWindMaximumSpeed()), 0.1, 1);
502 heigthDensity =
Math.
Lerp( 0.9, 1, lerpValue);
507 distanceDensity =
Math.
Lerp( 0.01, 0.03, lerpValue ) *
Math.
Clamp(1 - (windMagnitude /
m_Weather.GetWindMaximumSpeed()), 0.1, 1);
508 heigthDensity =
Math.
Lerp( 0.9, 1, lerpValue);
512 m_Weather.SetDynVolFogDistanceDensity(distanceDensity, changeTime);
513 m_Weather.SetDynVolFogHeightDensity(heigthDensity, changeTime);
514 m_Weather.SetDynVolFogHeightBias(heightBias, changeTime);
519 #ifdef WEATHER_DATA_LOGGING
static array< float > GetEnvironmentMinTemps()
static array< float > GetEnvironmentMaxTemps()
override void CalculateWind(int newWeather, bool suddenChange, out float magnitude, out float direction)
override bool WeatherOnBeforeChange(EWeatherPhenomenon type, float actual, float change, float time)
const float STORM_THRESHOLD
const float RAIN_THRESHOLD
const int OVERCAST_MIN_TIME
DEPRECATED (see WorldDataWeatherSettings).
const int OVERCAST_MAX_TIME
override void SetupWeatherSettings()
override void CalculateVolFog(float lerpValue, float windMagnitude, float changeTime)
static const ref array< vector > CHERNARUS_ARTY_STRIKE_POS
const int CLEAR_WEATHER
DEPRECATED (see WorldDataWeatherConstants).
static void WeatherLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
float m_UniversalTemperatureSourceCapModifier
float m_CloudsTemperatureEffectModifier
amount of °C reduced for each 100 meteres of height above water level
int m_BadWeatherChance
weather related
float WIND_MAGNITUDE_TIME_MULTIPLIER
float WIND_DIRECTION_TIME_MULTIPLIER
float m_TemperaturePerHeightReductionModifier
directly accesible (defined/overriden in Init())
ref WorldDataWeatherSettings m_WeatherDefaultSettings
ref array< vector > m_FiringPos
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto void CloseFile(FileHandle file)
Close the File.
proto FileHandle OpenFile(string name, FileMode mode)
Opens File.
proto void FPrintln(FileHandle file, void var)
Write to file and add new line.
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
EWeatherPhenomenon
All classes related to game weather.