DayZ 1.24
Loading...
Searching...
No Matches
WeatherPhenomenon Class Reference

Private Member Functions

void WeatherPhenomenon ()
 
void ~WeatherPhenomenon ()
 
proto native EWeatherPhenomenon GetType ()
 Returns type of this phenomenon.
 
proto native float GetActual ()
 Returns actual value of phenomenon in range <0, 1>.
 
proto native float GetForecast ()
 Returns a forecast value the phenomenon is heading towards.
 
proto native void Set (float forecast, float time=0, float minDuration=0)
 Sets the forecast.
 
proto native float GetNextChange ()
 Reads the time in seconds when the next forecast will be computed.
 
proto native void SetNextChange (float time)
 Sets the time in seconds when the next forecast will be computed.
 
proto void GetLimits (out float fnMin, out float fnMax)
 Reads limits of this phenomenon.
 
proto native void SetLimits (float fnMin, float fnMax)
 Sets limits of this phenomenon.
 
proto void GetForecastChangeLimits (out float fcMin, out float fcMax)
 Reads limits of change when forecast is computed.
 
proto native void SetForecastChangeLimits (float fcMin, float fcMax)
 Sets limits of change when forecast is computed.
 
proto void GetForecastTimeLimits (out float ftMin, out float ftMax)
 Reads time range in which next forecast can be computed.
 
proto native void SetForecastTimeLimits (float ftMin, float ftMax)
 Sets time range in which next forecast can be computed.
 
bool OnBeforeChange (float change, float time)
 Is called every time the Phenomenon computes new forecast.
 

Detailed Description

Weather phenomenon

Definition at line 22 of file Weather.c.

Constructor & Destructor Documentation

◆ WeatherPhenomenon()

void WeatherPhenomenon::WeatherPhenomenon ( )
inlineprivate

Definition at line 24 of file Weather.c.

24{}

◆ ~WeatherPhenomenon()

void WeatherPhenomenon::~WeatherPhenomenon ( )
inlineprivate

Definition at line 25 of file Weather.c.

25{}

Member Function Documentation

◆ GetActual()

proto native float WeatherPhenomenon::GetActual ( )
private

Returns actual value of phenomenon in range <0, 1>.

Referenced by OnBeforeChange().

◆ GetForecast()

proto native float WeatherPhenomenon::GetForecast ( )
private

Returns a forecast value the phenomenon is heading towards.

◆ GetForecastChangeLimits()

proto void WeatherPhenomenon::GetForecastChangeLimits ( out float fcMin,
out float fcMax )
private

Reads limits of change when forecast is computed.

Parameters
fcMinForecast change minimum (in range <0, 1>).
fcMaxForecast change maximum (in range <0, 1>).

◆ GetForecastTimeLimits()

proto void WeatherPhenomenon::GetForecastTimeLimits ( out float ftMin,
out float ftMax )
private

Reads time range in which next forecast can be computed.

Parameters
ftMinMinimal number of seconds.
ftMaxMaximal number of seconds.

◆ GetLimits()

proto void WeatherPhenomenon::GetLimits ( out float fnMin,
out float fnMax )
private

Reads limits of this phenomenon.

Parameters
fnMinFunction minimum (in range <0, 1>).
fnMaxFunction maximum (in range <0, 1>).

◆ GetNextChange()

proto native float WeatherPhenomenon::GetNextChange ( )
private

Reads the time in seconds when the next forecast will be computed.

◆ GetType()

proto native EWeatherPhenomenon WeatherPhenomenon::GetType ( )
private

Returns type of this phenomenon.

Referenced by OnBeforeChange().

◆ OnBeforeChange()

bool WeatherPhenomenon::OnBeforeChange ( float change,
float time )
inlineprivate

Is called every time the Phenomenon computes new forecast.

Note
Called on server only.
Parameters
changeComputed change of forecast value.
timeSeconds when the next forecast will be computed.
Returns
True when script modifies state of this phenomenon false otherwise.

Definition at line 118 of file Weather.c.

119 {
120 // check if mission forces use of custom weather
121 Weather weather = g_Game.GetWeather();
122
123 if (weather.GetMissionWeather())
124 return false;
125
126 // check for active worlddata with custom onbeforechange behaviour
127 Mission currentMission = g_Game.GetMission();
128
129 if (currentMission)
130 {
131 WorldData worldData = currentMission.GetWorldData();
132 if (worldData)
133 return worldData.WeatherOnBeforeChange(GetType(), GetActual(), change, time);
134 }
135
136 return false;
137 }
DayZGame g_Game
Definition DayZGame.c:3528
Mission class.
Definition gameplay.c:668
proto native float GetActual()
Returns actual value of phenomenon in range <0, 1>.
proto native EWeatherPhenomenon GetType()
Returns type of this phenomenon.
Keeps information about currently loaded world, like temperature.
Definition WorldData.c:3

References g_Game, GetActual(), and GetType().

◆ Set()

proto native void WeatherPhenomenon::Set ( float forecast,
float time = 0,
float minDuration = 0 )
private

Sets the forecast.

Parameters
forecastDesired forecast value that should be met in given time.
timeA time of the next change (how long it takes in seconds to interpolate to given value).
minDurationA minimal time in seconds the change will last.

◆ SetForecastChangeLimits()

proto native void WeatherPhenomenon::SetForecastChangeLimits ( float fcMin,
float fcMax )
private

Sets limits of change when forecast is computed.

These limits govern how much the forecast value can change when it is computed by weather controller.

Default values are: fcMin = 0 fcMax = 1

Parameters
fcMinForecast change minimum (in range <0, 1>).
fcMaxForecast change maximum (in range <0, 1>).

◆ SetForecastTimeLimits()

proto native void WeatherPhenomenon::SetForecastTimeLimits ( float ftMin,
float ftMax )
private

Sets time range in which next forecast can be computed.

Default values are: ftMin = 300 (5 minutes) ftMax = 3600 (1 hour)

Parameters
ftMinMinimal number of seconds.
ftMaxMaximal number of seconds.

◆ SetLimits()

proto native void WeatherPhenomenon::SetLimits ( float fnMin,
float fnMax )
private

Sets limits of this phenomenon.

Actual value of this phenomenon will be always held in range <fnMin, fnMax>.

Default values are: fnMin = 0 fnMax = 1

Parameters
fnMinFunction minimum (in range <0, 1>).
fnMaxFunction maximum (in range <0, 1>).

◆ SetNextChange()

proto native void WeatherPhenomenon::SetNextChange ( float time)
private

Sets the time in seconds when the next forecast will be computed.


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