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};
75 m_Weather.GetOvercast().Set(startingOvercast,0,5);
83 super.SetupWeatherSettings();
93 #ifdef WEATHER_DATA_LOGGING
102 float phmnLength = 10;
120 #ifdef WEATHER_DATA_LOGGING
121 overcastChangeCount++;
124 float windDirection, windMag;
136 if (
m_LastWeather == WorldDataWeatherConstants.CLEAR_WEATHER )
141 if (
m_LastWeather == WorldDataWeatherConstants.CLOUDY_WEATHER )
146 if (
m_LastWeather == WorldDataWeatherConstants.BAD_WEATHER )
156 if (
m_LastWeather == WorldDataWeatherConstants.CLEAR_WEATHER )
162 if (
m_LastWeather == WorldDataWeatherConstants.BAD_WEATHER )
168 if (
m_LastWeather == WorldDataWeatherConstants.CLOUDY_WEATHER )
183 #ifdef WEATHER_DATA_LOGGING
195 #ifdef WEATHER_DATA_LOGGING
196 cloudyWeatherCount++;
207 #ifdef WEATHER_DATA_LOGGING
216 m_Weather.GetOvercast().Set( phmnValue, phmnTime, phmnLength );
224 Debug.
WeatherLog(
string.Format(
"Chernarus::Weather::Overcast:: (%1) overcast: %2",
g_Game.GetDayTime(), actual));
227 #ifdef WEATHER_DATA_LOGGING
235 if ( testDay - startDay > currentDay && testHour - startHour >= 0 && testMinute - startMinute >= 0 )
238 FPrintln(file,
"================================================================");
239 FPrintln(file,
" ================== Day " + (currentDay + 1) +
" ================== ");
240 FPrintln(file,
"================================================================");
241 FPrintln(file,
"Overcast Change Count: " + overcastChangeCount);
242 FPrintln(file,
"Bad Weather Change Count: " + badWeatherCount);
243 FPrintln(file,
"Cloudy Weather Count: " + cloudyWeatherCount);
244 FPrintln(file,
"Clear Weather Count: " + clearWeatherCount);
248 if ( currentDay == daysToRun )
253 overcastChangeCount = 0;
255 cloudyWeatherCount = 0;
256 clearWeatherCount = 0;
265 float actualOvercast =
m_Weather.GetOvercast().GetActual();
275 Debug.
WeatherLog(
string.Format(
"Chernarus::Weather::Rain::ForceEnd:: (%1) %2 -> 0",
g_Game.GetDayTime(), actual));
285 m_Weather.GetRain().Set( phmnValue, phmnTime, phmnLength );
286 Debug.
WeatherLog(
string.Format(
"Chernarus::Weather::Rain::ForceStorm:: (%1) %2 -> %3",
g_Game.GetDayTime(), actual, phmnValue));
291 if ( actualOvercast < 0.75 )
346 m_Weather.GetRain().Set( phmnValue, phmnTime, phmnLength );
357 float fogTime = 1800.0;
361 if ( fogyMorning > 0.85 )
363 if ( (
g_Game.GetDayTime() > 4 &&
g_Game.GetDayTime() < 7 ) )
371 if (
m_Weather.GetOvercast().GetActual() < 0.3 )
397 protected override void CalculateWind(
int newWeather,
bool suddenChange, out
float magnitude, out
float direction)
404 if ( newWeather == WorldDataWeatherConstants.CLEAR_WEATHER )
406 if ( windChance < 30 )
411 else if ( windChance < 75 )
423 else if ( newWeather == WorldDataWeatherConstants.CLOUDY_WEATHER )
425 if ( windChance < 45 )
430 else if ( windChance < 90 )
448 else if ( windChance < 45 )
453 else if ( windChance < 90 )
466 protected override void CalculateVolFog(
float lerpValue,
float windMagnitude,
float changeTime)
468 float distanceDensity, heigthDensity, heightBias;
469 int year, month, day, hour, minute;
472 if ( hour < 9 && hour >= 5 )
474 distanceDensity =
Math.
Lerp( 0.015, 0.05, lerpValue ) *
Math.
Clamp(1 - (windMagnitude /
m_Weather.GetWindMaximumSpeed()), 0.1, 1);
475 heigthDensity =
Math.
Lerp( 0.8, 1, lerpValue);
477 heightBias =
m_Weather.GetDynVolFogHeightBias();
487 else if (diceRoll < 85)
497 else if ( hour < 18 && hour >= 9 )
499 distanceDensity =
Math.
Lerp( 0.01, 0.05, lerpValue ) *
Math.
Clamp(1 - (windMagnitude /
m_Weather.GetWindMaximumSpeed()), 0.1, 1);
500 heigthDensity =
Math.
Lerp( 0.9, 1, lerpValue);
505 distanceDensity =
Math.
Lerp( 0.01, 0.03, lerpValue ) *
Math.
Clamp(1 - (windMagnitude /
m_Weather.GetWindMaximumSpeed()), 0.1, 1);
506 heigthDensity =
Math.
Lerp( 0.9, 1, lerpValue);
510 m_Weather.SetDynVolFogDistanceDensity(distanceDensity, changeTime);
511 m_Weather.SetDynVolFogHeightDensity(heigthDensity, changeTime);
512 m_Weather.SetDynVolFogHeightBias(heightBias, changeTime);
517 #ifdef WEATHER_DATA_LOGGING
proto native World GetWorld()
static array< float > GetEnvironmentMaxTemps()
static array< float > GetEnvironmentMinTemps()
static void WeatherLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
proto void GetDate(out int year, out int month, out int day, out int hour, out int minute)
Get actual ingame world time.
override void CalculateVolFog(float lerpValue, float windMagnitude, float changeTime)
const int OVERCAST_MIN_TIME
DEPRECATED (see WorldDataWeatherSettings)
const float STORM_THRESHOLD
override bool WeatherOnBeforeChange(EWeatherPhenomenon type, float actual, float change, float time)
override void SetupWeatherSettings()
void CalculateWind(int newWeather, bool suddenChange, out float magnitude, out float direction)
const int OVERCAST_MAX_TIME
float WIND_DIRECTION_TIME_MULTIPLIER
ref WorldDataWeatherSettings m_WeatherDefaultSettings
static const ref array< vector > CHERNARUS_ARTY_STRIKE_POS
ref array< vector > m_FiringPos
float m_TemperaturePerHeightReductionModifier
directly accesible (defined/overriden in Init())
float m_CloudsTemperatureEffectModifier
amount of °C reduced for each 100 meteres of height above water level
void CalculateVolFog(float lerpValue, float windMagnitude, float changeTime)
const int CLEAR_WEATHER
DEPRECATED (see WorldDataWeatherConstants)
int m_BadWeatherChance
weather related
float WIND_MAGNITUDE_TIME_MULTIPLIER
override void CalculateWind(int newWeather, bool suddenChange, out float magnitude, out float direction)
float m_UniversalTemperatureSourceCapModifier
const float RAIN_THRESHOLD
Keeps information about currently loaded world, like temperature.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
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 float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static float RandomFloatInclusive(float min, float max)
Returns a random float 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 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 proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].