71 m_MaxTemps = {3,5,7,14,19,24,26,25,21,16,10,5};
72 m_MinTemps = {-3,-2,0,4,9,14,18,17,12,7,4,0};
91 if ( monthday <= 8.0 )
98 if ( monthday <= 8.0 )
106 int year, month, day, hour, minute;
109 float sunriseTimeStart =
g_Game.GetMission().GetWorldData().GetApproxSunriseTime(month);
110 float sunsetTimeStart =
g_Game.GetMission().GetWorldData().GetApproxSunsetTime(month);
112 if (hour >= sunriseTimeStart && hour < (sunriseTimeStart + 2))
114 else if (hour >= (sunriseTimeStart + 2) && hour < sunsetTimeStart)
116 else if (hour >= sunsetTimeStart && hour < (sunsetTimeStart + 2))
126 float dayLight = approxSunset - approxSunrise;
127 float nightTime = 24.0 - dayLight;
128 int tempArrayIndex =
Math.
Floor(monthday) - 1;
129 int tempArrayIndexToLerp = tempArrayIndex + 1;
130 if ( tempArrayIndexToLerp >= 12 )
131 tempArrayIndexToLerp = 0;
132 float tempArrayLerp = monthday -
Math.
Floor(monthday);
134 float minTempB =
m_MinTemps[tempArrayIndexToLerp];
136 float maxTempB =
m_MaxTemps[tempArrayIndexToLerp];
137 float eveningMinA = minTempA + ( 0.5 *
Math.
AbsFloat( minTempA - maxTempA ) );
138 float eveningMinB = minTempB + ( 0.5 *
Math.
AbsFloat( minTempB - maxTempB ) );
140 if ( ( daytime >= approxSunrise ) && ( daytime <= approxSunset ) ) {
141 if ( daytime <= ( approxSunrise + ( dayLight * 0.75 ) ) )
143 Math.
Lerp( minTempA, minTempB, tempArrayLerp ),
144 Math.
Lerp( maxTempA, maxTempB, tempArrayLerp ),
145 ( ( daytime - approxSunrise ) / ( dayLight * 0.75 ) ) );
148 Math.
Lerp( maxTempA, maxTempB, tempArrayLerp ),
149 Math.
Lerp( eveningMinA, eveningMinB, tempArrayLerp ),
150 ( ( ( daytime - approxSunrise ) - ( dayLight * 0.75 ) ) / ( dayLight - ( dayLight * 0.75 ) ) ) );
152 if ( ( daytime > approxSunset ) && ( daytime < 24 ) )
154 Math.
Lerp( eveningMinA, eveningMinB, tempArrayLerp ),
155 Math.
Lerp( minTempA, minTempB, tempArrayLerp ),
156 ( ( daytime - approxSunset ) / ( 24 - approxSunset ) ) / 2.0 );
159 Math.
Lerp( eveningMinA, eveningMinB, tempArrayLerp ),
160 Math.
Lerp( minTempA, minTempB, tempArrayLerp ),
161 ( ( ( daytime + ( 24 - approxSunset ) ) / nightTime ) / 2.0 ) + 0.5 );
169 int year, month, day, hour, minute;
199 float overcastScale =
Math.
Lerp( 0.50, 1.25, overcast01 );
200 float windScale =
Math.
Lerp( 1.25, 1.00, wind01 );
202 return Math.
Clamp( overcastScale * windScale, 0.50, 1.25 );
218 float terrainHeight = pos[1];
234 ErrorEx(
"Undefined enviro temperature for liquid type: " + liquidType);
270 Print(
"--------------------");
271 for (
int i = 0; i < 24; i++ )
273 for (
int j = 0; j < 6; j++ )
275 int minute = ( j * 10 );
328 float temperatureOut = 0.0;
338 Debug.
Log(
string.Format(
"Only OVERCAST, WIND and FOG parameters are supported"));
341 return temperatureOut;
346 float temperatureOutput = 0.0;
349 temperatureOutput = temperatureOutput *
m_Weather.GetWindMagnitude().GetActual() *
GetWindCoef();
351 return -temperatureOutput;
354 protected void CalculateWind(
int newWeather,
bool suddenChange, out
float magnitude, out
float direction);
356 protected void CalculateVolFog(
float lerpValue,
float windMagnitude,
float changeTime);
416class WorldDataWeatherConstants
457class WorldDataLiquidSettings
EEnvironmentTemperatureComponent
class WorldDataWeatherSettings m_Temperatures
class WorldData CLEAR_WEATHER
proto native World GetWorld()
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
proto native void SetSnowflakeScale(float scale)
Sets the overall scale of snowflakes during snowfall phenomenon. This value is not synchronized and s...
proto native float GetWindSpeed()
Returns actual wind speed in metre per second.
proto native float GetWindMaximumSpeed()
Returns maximal wind speed in metre per second.
proto native Overcast GetOvercast()
Returns an overcast phenomenon object.
proto native float GetActual()
proto void GetDate(out int year, out int month, out int day, out int hour, out int minute)
Get actual ingame world time.
float GetAgentSpawnChance(eAgents agent)
float GetApproxSunriseTime(float monthday)
float ComputeSnowflakeScale(Weather weather)
Returns the desired snowflake scale based on weather simulation state.
float SUDDENCHANGE_TIME_MULTIPLIER
float GetTemperature(Object object, EEnvironmentTemperatureComponent properties=EEnvironmentTemperatureComponent.BASE)
Return actual temperature of environment based on provided parameters.
void UpdateBaseEnvTemperature(float timeslice)
void CalculateWind(int newWeather, bool suddenChange, out float magnitude, out float direction)
float SUDDENCHANGE_LENGTH_MULTIPLIER
ref WorldDataLiquidSettings m_LiquidSettings
float GetNightTemperature()
float WIND_DIRECTION_TIME_MULTIPLIER
CatchYieldBank GetCatchYieldBank()
float GetBaseEnvTemperature()
float GetBaseEnvTemperatureAtObject(notnull Object object)
float GetDayTemperature()
float GetBaseEnvTemperatureAtPosition(vector pos)
bool WeatherOnBeforeChange(EWeatherPhenomenon type, float actual, float change, float time)
ref WorldDataWeatherSettings m_WeatherDefaultSettings
float GetApproxSunsetTime(float monthday)
array< vector > GetArtyFiringPos()
ref array< vector > m_FiringPos
float m_WaterContactTemperatureModifier
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
TStringArray GetDefaultPRAPaths()
void UpdateWeatherEffects(Weather weather, float timeslice)
Updates local weather effects.
ref CatchYieldBank m_YieldBank
float GetBaseEnvTemperatureExact(int month, int day, int hour, int minute)
float m_TemperatureInsideBuildingsModifier
how many % of environment temperature can be lowered by clouds
void CalculateVolFog(float lerpValue, float windMagnitude, float changeTime)
const float COLD_AREA_TOOL_DMG_MODIF_DEF
const float SPAWN_CHANCE_CHOLERA_DEF
void BaseTempDebug(int month, int day)
ref TStringArray m_DefaultPlayerRestrictedAreas
float GetUniversalTemperatureSourceCapModifier()
int m_BadWeatherChance
weather related
float GetColdAreaToolDamageModifier()
float WIND_MAGNITUDE_TIME_MULTIPLIER
float m_EnvironmentTemperature
void SetupWeatherSettings()
float m_UniversalTemperatureSourceCapModifier
float GetLiquidTypeEnviroTemperature(int liquidType)
void SetupLiquidTemperatures()
float GetTemperatureComponentValue(float temperatureIn, EEnvironmentTemperatureComponent properties=0)
Return value of queried EEnvironmentTemperatureComponent which can be used in future calculation(s)
void InitYieldBank()
override this to properly register world-specific yields
float CalcBaseEnvironmentTemperature(float monthday, float daytime)
float WindEffectTemperatureValue(float temperatureInput)
static string ToString(int value)
int m_CalmAfterStormTimeMax
int m_FoggyMorningHeigthBiasLowLimit
float m_ThundersnowThreshold
int m_CalmAfterStormTimeMin
float m_SnowfallThreshold
int m_BadWeatherSuddenChance
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
const int INDEX_NOT_FOUND
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
array< string > TStringArray
const float ENVIRO_WIND_CHILL_LIMIT
Affects the slope of calculation.
const float ENVIRO_FOG_TEMP_EFFECT
how many % of ENVIRO_SUN_INCREMENT is reduced by fog
const float ENVIRO_WIND_EFFECT_SLOPE
time modifier, how much longer it takes to dig up worms while in a cold area
const int LIQUID_STILLWATER
const int LIQUID_FRESHWATER
const int LIQUID_CLEANWATER
const int LIQUID_RIVERWATER
const int LIQUID_SALTWATER
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Floor(float f)
Returns floor of value.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
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 float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
static proto float AbsFloat(float f)
Returns absolute value.
class JsonUndergroundAreaTriggerData GetPosition