Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
WorldData Class Reference

Keeps information about currently loaded world, like temperature. More...

Inheritance diagram for WorldData:
ChernarusPlusData EnochData SakhalData

Protected Member Functions

void WorldData ()
void BaseTempDebug (int month, int day)
float CalcBaseEnvironmentTemperature (float monthday, float daytime)
void CalculateVolFog (float lerpValue, float windMagnitude, float changeTime)
void CalculateWind (int newWeather, bool suddenChange, out float magnitude, out float direction)
float ComputeSnowflakeScale (Weather weather)
 Returns the desired snowflake scale based on weather simulation state.
void CreateYieldBank ()
float GetAgentSpawnChance (eAgents agent)
float GetApproxSunriseTime (float monthday)
float GetApproxSunsetTime (float monthday)
array< vectorGetArtyFiringPos ()
float GetBaseEnvTemperature ()
float GetBaseEnvTemperatureAtObject (notnull Object object)
float GetBaseEnvTemperatureAtPosition (vector pos)
float GetBaseEnvTemperatureExact (int month, int day, int hour, int minute)
CatchYieldBank GetCatchYieldBank ()
float GetColdAreaToolDamageModifier ()
float GetDayTemperature ()
int GetDaytime ()
TStringArray GetDefaultPRAPaths ()
float GetLiquidTypeEnviroTemperature (int liquidType)
float GetNightTemperature ()
int GetPollution ()
float GetTemperature (Object object, EEnvironmentTemperatureComponent properties=EEnvironmentTemperatureComponent.BASE)
 Return actual temperature of environment based on provided parameters.
float GetTemperatureComponentValue (float temperatureIn, EEnvironmentTemperatureComponent properties=0)
 Return value of queried EEnvironmentTemperatureComponent which can be used in future calculation(s).
float GetUniversalTemperatureSourceCapModifier ()
float GetWindCoef ()
void Init ()
void InitYieldBank ()
 override this to properly register world-specific yields
void SetupLiquidTemperatures ()
void SetupWeatherSettings ()
void UpdateBaseEnvTemperature (float timeslice)
void UpdateWeatherEffects (Weather weather, float timeslice)
 Updates local weather effects.
bool WeatherOnBeforeChange (EWeatherPhenomenon type, float actual, float change, float time)
float WindEffectTemperatureValue (float temperatureInput)

Protected Attributes

int m_BadWeatherChance
 weather related
int m_Chance = 50
int m_ChoosenWeather = 1
int m_ClearWeatherChance
float m_DayTemperature = 10
 DEPRECATED.
ref TStringArray m_DefaultPlayerRestrictedAreas
bool m_EnTempUpdated
float m_EnvironmentTemperature
ref array< vectorm_FiringPos
bool m_IsSuddenChange
int m_LastWeather = 0
ref WorldDataLiquidSettings m_LiquidSettings
float m_MaxTemps [12]
float m_MinTemps [12]
float m_NightTemperature = 6
bool m_Pollution
int m_SameWeatherCnt = 0
int m_StepValue = 5
float m_Sunrise_Jan
float m_Sunrise_Jul
float m_Sunset_Jan
float m_Sunset_Jul
float m_Timer
float m_UniversalTemperatureSourceCapModifier
Weather m_Weather
ref WorldDataWeatherSettings m_WeatherDefaultSettings
float m_WorldWindCoef
ref CatchYieldBank m_YieldBank
float SUDDENCHANGE_LENGTH_MULTIPLIER = 0.4
float SUDDENCHANGE_TIME_MULTIPLIER = 0.2
float WIND_DIRECTION_TIME_MULTIPLIER = 0.05
float WIND_MAGNITUDE_TIME_MULTIPLIER = 0.1

Private Attributes

const float COLD_AREA_TOOL_DMG_MODIF_DEF = 1
float m_CloudsTemperatureEffectModifier
 amount of °C reduced for each 100 meteres of height above water level
float m_TemperatureInsideBuildingsModifier
 how many % of environment temperature can be lowered by clouds
float m_TemperaturePerHeightReductionModifier
 directly accesible (defined/overriden in Init())
float m_WaterContactTemperatureModifier
const float SPAWN_CHANCE_CHOLERA_DEF = 50

Detailed Description

Keeps information about currently loaded world, like temperature.

Definition at line 2 of file worlddata.c.

Constructor & Destructor Documentation

◆ WorldData()

void WorldData ( )
inlineprotected

Definition at line 50 of file worlddata.c.

References CreateYieldBank(), Init(), InitYieldBank(), and UpdateBaseEnvTemperature().

Referenced by GetDaytime().

Member Function Documentation

◆ BaseTempDebug()

void BaseTempDebug ( int month,
int day )
inlineprotected

Definition at line 269 of file worlddata.c.

References GetBaseEnvTemperatureExact(), and Print().

◆ CalcBaseEnvironmentTemperature()

float CalcBaseEnvironmentTemperature ( float monthday,
float daytime )
inlineprotected

◆ CalculateVolFog()

void CalculateVolFog ( float lerpValue,
float windMagnitude,
float changeTime )
protected

◆ CalculateWind()

void CalculateWind ( int newWeather,
bool suddenChange,
out float magnitude,
out float direction )
protected

◆ ComputeSnowflakeScale()

float ComputeSnowflakeScale ( Weather weather)
inlineprotected

Returns the desired snowflake scale based on weather simulation state.

Parameters
weatherWeather instance

Definition at line 195 of file worlddata.c.

References Math::Clamp(), WeatherPhenomenon::GetActual(), Weather::GetOvercast(), Weather::GetWindMaximumSpeed(), Weather::GetWindSpeed(), Math::InverseLerp(), and Math::Lerp().

Referenced by UpdateWeatherEffects().

◆ CreateYieldBank()

void CreateYieldBank ( )
inlineprotected

Definition at line 359 of file worlddata.c.

References m_YieldBank.

Referenced by WorldData().

◆ GetAgentSpawnChance()

float GetAgentSpawnChance ( eAgents agent)
inlineprotected

Definition at line 254 of file worlddata.c.

References SPAWN_CHANCE_CHOLERA_DEF.

Referenced by Bottle_Base::EEOnCECreate().

◆ GetApproxSunriseTime()

float GetApproxSunriseTime ( float monthday)
inlineprotected

Definition at line 89 of file worlddata.c.

References m_Sunrise_Jan, and m_Sunrise_Jul.

Referenced by CalcBaseEnvironmentTemperature(), and GetDaytime().

◆ GetApproxSunsetTime()

float GetApproxSunsetTime ( float monthday)
inlineprotected

Definition at line 96 of file worlddata.c.

References m_Sunset_Jan, and m_Sunset_Jul.

Referenced by CalcBaseEnvironmentTemperature(), and GetDaytime().

◆ GetArtyFiringPos()

array< vector > GetArtyFiringPos ( )
inlineprotected

Definition at line 248 of file worlddata.c.

References m_FiringPos.

◆ GetBaseEnvTemperature()

float GetBaseEnvTemperature ( )
inlineprotected

Definition at line 207 of file worlddata.c.

References m_EnvironmentTemperature.

Referenced by GetTemperature().

◆ GetBaseEnvTemperatureAtObject()

float GetBaseEnvTemperatureAtObject ( notnull Object object)
inlineprotected

Definition at line 212 of file worlddata.c.

References GetBaseEnvTemperatureAtPosition(), and GetPosition().

Referenced by GetTemperature().

◆ GetBaseEnvTemperatureAtPosition()

float GetBaseEnvTemperatureAtPosition ( vector pos)
inlineprotected

◆ GetBaseEnvTemperatureExact()

float GetBaseEnvTemperatureExact ( int month,
int day,
int hour,
int minute )
inlineprotected

Definition at line 224 of file worlddata.c.

References CalcBaseEnvironmentTemperature().

Referenced by BaseTempDebug().

◆ GetCatchYieldBank()

CatchYieldBank GetCatchYieldBank ( )
inlineprotected

Definition at line 388 of file worlddata.c.

References m_YieldBank.

◆ GetColdAreaToolDamageModifier()

float GetColdAreaToolDamageModifier ( )
inlineprotected

Definition at line 263 of file worlddata.c.

References COLD_AREA_TOOL_DMG_MODIF_DEF.

◆ GetDayTemperature()

float GetDayTemperature ( )
inlineprotected

Definition at line 406 of file worlddata.c.

References m_DayTemperature.

◆ GetDaytime()

◆ GetDefaultPRAPaths()

TStringArray GetDefaultPRAPaths ( )
inlineprotected

Definition at line 393 of file worlddata.c.

References m_DefaultPlayerRestrictedAreas.

◆ GetLiquidTypeEnviroTemperature()

float GetLiquidTypeEnviroTemperature ( int liquidType)
inlineprotected

Definition at line 229 of file worlddata.c.

References ErrorEx, INDEX_NOT_FOUND, m_EnvironmentTemperature, and m_LiquidSettings.

Referenced by ManBase::Consume().

◆ GetNightTemperature()

float GetNightTemperature ( )
inlineprotected

Definition at line 411 of file worlddata.c.

References m_NightTemperature.

◆ GetPollution()

int GetPollution ( )
inlineprotected

Definition at line 282 of file worlddata.c.

References m_Pollution.

Referenced by ManBase::Consume().

◆ GetTemperature()

float GetTemperature ( Object object,
EEnvironmentTemperatureComponent properties = EEnvironmentTemperatureComponent.BASE )
inlineprotected

Return actual temperature of environment based on provided parameters.

Parameters
objectReference to object that is used mainly for sea height related calculation
propertiesFlag made of EEnvironmentTemperatureComponent which will influence the resulting value of temperature based on combination of the parts

Definition at line 302 of file worlddata.c.

References GameConstants::ENVIRO_FOG_TEMP_EFFECT, GetBaseEnvTemperature(), GetBaseEnvTemperatureAtObject(), m_CloudsTemperatureEffectModifier, m_Weather, and WindEffectTemperatureValue().

◆ GetTemperatureComponentValue()

float GetTemperatureComponentValue ( float temperatureIn,
EEnvironmentTemperatureComponent properties = 0 )
inlineprotected

Return value of queried EEnvironmentTemperatureComponent which can be used in future calculation(s).

Parameters
temperatureBase temperature which will be used in component calculation (currently WIND only)
propertiesFlag made of EEnvironmentTemperatureComponent which will influence the resulting value of temperature based on combination of the parts

Definition at line 327 of file worlddata.c.

References GameConstants::ENVIRO_FOG_TEMP_EFFECT, Debug::Log(), m_CloudsTemperatureEffectModifier, m_Weather, and WindEffectTemperatureValue().

◆ GetUniversalTemperatureSourceCapModifier()

float GetUniversalTemperatureSourceCapModifier ( )
inlineprotected

Definition at line 292 of file worlddata.c.

References m_UniversalTemperatureSourceCapModifier.

◆ GetWindCoef()

float GetWindCoef ( )
inlineprotected

Definition at line 287 of file worlddata.c.

References m_WorldWindCoef.

Referenced by WindEffectTemperatureValue().

◆ Init()

◆ InitYieldBank()

void InitYieldBank ( )
inlineprotected

override this to properly register world-specific yields

Definition at line 365 of file worlddata.c.

References GetDayZGame(), and m_YieldBank.

Referenced by WorldData().

◆ SetupLiquidTemperatures()

void SetupLiquidTemperatures ( )
inlineprotected

◆ SetupWeatherSettings()

void SetupWeatherSettings ( )
inlineprotected

Definition at line 370 of file worlddata.c.

References m_WeatherDefaultSettings.

Referenced by Init().

◆ UpdateBaseEnvTemperature()

void UpdateBaseEnvTemperature ( float timeslice)
inlineprotected

◆ UpdateWeatherEffects()

void UpdateWeatherEffects ( Weather weather,
float timeslice )
inlineprotected

Updates local weather effects.

Parameters
weatherWeather instance
timesliceTime delta since last update

Definition at line 185 of file worlddata.c.

References ComputeSnowflakeScale(), and Weather::SetSnowflakeScale().

Referenced by CGame::OnUpdate().

◆ WeatherOnBeforeChange()

bool WeatherOnBeforeChange ( EWeatherPhenomenon type,
float actual,
float change,
float time )
inlineprotected

Definition at line 241 of file worlddata.c.

Referenced by WeatherPhenomenon::OnBeforeChange().

◆ WindEffectTemperatureValue()

float WindEffectTemperatureValue ( float temperatureInput)
inlineprotected

Field Documentation

◆ COLD_AREA_TOOL_DMG_MODIF_DEF

const float COLD_AREA_TOOL_DMG_MODIF_DEF = 1
private

Definition at line 5 of file worlddata.c.

Referenced by GetColdAreaToolDamageModifier().

◆ m_BadWeatherChance

int m_BadWeatherChance
protected

◆ m_Chance

◆ m_ChoosenWeather

int m_ChoosenWeather = 1
protected

◆ m_ClearWeatherChance

◆ m_CloudsTemperatureEffectModifier

float m_CloudsTemperatureEffectModifier
private

amount of °C reduced for each 100 meteres of height above water level

Definition at line 9 of file worlddata.c.

Referenced by GetTemperature(), GetTemperatureComponentValue(), ChernarusPlusData::Init(), EnochData::Init(), and Init().

◆ m_DayTemperature

float m_DayTemperature = 10
protected

DEPRECATED.

Definition at line 403 of file worlddata.c.

Referenced by GetDayTemperature().

◆ m_DefaultPlayerRestrictedAreas

ref TStringArray m_DefaultPlayerRestrictedAreas
protected

Definition at line 33 of file worlddata.c.

Referenced by GetDefaultPRAPaths(), SakhalData::Init(), and Init().

◆ m_EnTempUpdated

bool m_EnTempUpdated
protected

Definition at line 20 of file worlddata.c.

Referenced by Init(), and UpdateBaseEnvTemperature().

◆ m_EnvironmentTemperature

float m_EnvironmentTemperature
protected

◆ m_FiringPos

ref array<vector> m_FiringPos
protected

Definition at line 28 of file worlddata.c.

Referenced by GetArtyFiringPos(), ChernarusPlusData::Init(), and EnochData::Init().

◆ m_IsSuddenChange

bool m_IsSuddenChange
protected

◆ m_LastWeather

◆ m_LiquidSettings

ref WorldDataLiquidSettings m_LiquidSettings
protected

◆ m_MaxTemps

float m_MaxTemps[12]
protected

◆ m_MinTemps

float m_MinTemps[12]
protected

◆ m_NightTemperature

float m_NightTemperature = 6
protected

Definition at line 404 of file worlddata.c.

Referenced by GetNightTemperature().

◆ m_Pollution

bool m_Pollution
protected

Definition at line 29 of file worlddata.c.

Referenced by GetPollution(), SakhalData::Init(), and Init().

◆ m_SameWeatherCnt

int m_SameWeatherCnt = 0
protected

◆ m_StepValue

◆ m_Sunrise_Jan

float m_Sunrise_Jan
protected

◆ m_Sunrise_Jul

float m_Sunrise_Jul
protected

◆ m_Sunset_Jan

float m_Sunset_Jan
protected

◆ m_Sunset_Jul

float m_Sunset_Jul
protected

◆ m_TemperatureInsideBuildingsModifier

float m_TemperatureInsideBuildingsModifier
private

how many % of environment temperature can be lowered by clouds

Definition at line 10 of file worlddata.c.

Referenced by SakhalData::Init(), and Init().

◆ m_TemperaturePerHeightReductionModifier

float m_TemperaturePerHeightReductionModifier
private

directly accesible (defined/overriden in Init())

Definition at line 8 of file worlddata.c.

Referenced by GetBaseEnvTemperatureAtPosition(), ChernarusPlusData::Init(), EnochData::Init(), and Init().

◆ m_Timer

float m_Timer
protected

Definition at line 21 of file worlddata.c.

Referenced by Init(), and UpdateBaseEnvTemperature().

◆ m_UniversalTemperatureSourceCapModifier

float m_UniversalTemperatureSourceCapModifier
protected

◆ m_WaterContactTemperatureModifier

float m_WaterContactTemperatureModifier
private

Definition at line 11 of file worlddata.c.

Referenced by Init().

◆ m_Weather

◆ m_WeatherDefaultSettings

◆ m_WorldWindCoef

float m_WorldWindCoef
protected

Definition at line 39 of file worlddata.c.

Referenced by GetWindCoef(), ChernarusPlusData::Init(), EnochData::Init(), and Init().

◆ m_YieldBank

◆ SPAWN_CHANCE_CHOLERA_DEF

const float SPAWN_CHANCE_CHOLERA_DEF = 50
private

Definition at line 4 of file worlddata.c.

Referenced by GetAgentSpawnChance().

◆ SUDDENCHANGE_LENGTH_MULTIPLIER

float SUDDENCHANGE_LENGTH_MULTIPLIER = 0.4
protected

◆ SUDDENCHANGE_TIME_MULTIPLIER

float SUDDENCHANGE_TIME_MULTIPLIER = 0.2
protected

◆ WIND_DIRECTION_TIME_MULTIPLIER

float WIND_DIRECTION_TIME_MULTIPLIER = 0.05
protected

◆ WIND_MAGNITUDE_TIME_MULTIPLIER

float WIND_MAGNITUDE_TIME_MULTIPLIER = 0.1
protected

The documentation for this class was generated from the following file: