Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TimeAndWeatherManagerEntity Interface Reference

Manager entity responsible for managing in-game time and weather, providing the script and gamecode with usable in-game API. More...

Inheritance diagram for TimeAndWeatherManagerEntity:
[legend]

Public Member Functions

bool SetWeatherStatePreview (bool preview, string stateName="")
 Set Weather state preview.
 
bool SetWindPreview (bool preview, float windSpeed=-1, float windAngleDegrees=-1)
 Set wind preview.
 
bool SetDateTimePreview (bool preview, int year=-1, int month=-1, int day=-1, float timeOfTheDay=-1)
 Set date time Preview.
 
bool IsSunSet ()
 Get if the sun is set for the current time, latitude/longitude/date configuration.
 
bool IsSunSet (float timeToCheck)
 Get if the sun is set at given time.
 
string GetWeekDayString ()
 Use current date to get day of the week localized string (eg Monday, Tuesday ect)
 
string GetWeekDayStringForDate (int year, int month, int day)
 Use given date to get day of the week localized string (eg Monday, Tuesday ect)
 
void SetCurrentWeatherLooping (bool setLooping, int playerChangedLooping=0)
 Sets weather looping (server only) Use ForceWeatherTo to have more control over transition time and state duration.
 
void ForceWeatherTo (bool setLooping, string weatherID=string.Empty, float transitionDuration=0, float stateDuration=0.001, int playerThatChangedWeather=0)
 Forces weather to the given state.
 
bool IsWeatherLooping ()
 Get if weather is looping.
 
SCR_MoonPhaseUIInfo GetCurrentMoonPhaseInfoForDate ()
 Get moon phase for the current date.
 
SCR_MoonPhaseUIInfo GetMoonPhaseInfoForDate (int year, int month, int day, float timeOfTheDay24, float timezone, float dstOffset, float Latitude)
 Gets moon phase name for supplied date, geo location is not needed but timezone yes in order to calculate UTC correctly.
 
TimeContainer GetTime ()
 Retrieves current time of the day and returns it as a script wrapper for hours, minutes and seconds.
 
int GetCurrentDayTimeUIInfo (out SCR_UIInfo uiInfo)
 Gets the UI info of the current time of day.
 
EDayTimeEnums GetCurrentDayTimeUIInfoAndPhase (out SCR_UIInfo uiInfo)
 Gets the current daytime Ui info and Phase.
 
int GetDayTimeUIInfo (float TimeOfDay, out SCR_UIInfo uiInfo, out EDayTimeEnums dayTimePhase=-1, int year=-1, int month=-1, int day=-1)
 Gets an array of daytime info which holds the UIinfo of specific times of the day.
 
int GetDayTimeInfoArray (out notnull array< SCR_DayTimeInfoBase > dayTimeInfoArray, int year=-1, int month=-1, int day=-1)
 Gets an array of daytime info which holds the UIinfo of specific times of the day.
 
int GetOrderedWindDirectionInfoArray (notnull array< SCR_WindDirectionInfo > orderedWindDirectionInfo)
 Gets array of ordered Wind Direction info.
 
bool GetWindDirectionInfoFromIndex (int index, out SCR_WindDirectionInfo windDirectionInfo)
 Gets wind direction info using index of array.
 
bool GetWindDirectionInfoFromFloat (float windDirectionFloat, out int index, out SCR_WindDirectionInfo windDirectionInfo)
 Gets wind direction info from winddirection float.
 
void DelayedSetWindOverride (bool overrideWind, int playerChangingWind=-1)
 Sets wind override true or false.
 
void DelayedOverrideWindSpeed (float windSpeed, int playerChangingWind=-1)
 Sets wind speed override.
 
void DelayedOverrideWindDirection (float windDirection, int playerChangingWind=-1)
 Sets wind direction override.
 
bool SetTime (TimeContainer cont)
 Sets current time of the day via a script wrapper.
 
ScriptInvokerBase< SCR_TimeAndWeatherManager_OnWeatherStatePreview > GetOnWeatherStatePreview ()
 
ScriptInvokerBase< SCR_TimeAndWeatherManager_OnWindPreview > GetOnWindPreview ()
 
ScriptInvokerBase< SCR_TimeAndWeatherManager_OnDateTimePreview > GetOnDateTimePreview ()
 
override bool RplSave (ScriptBitWriter writer)
 
override bool RplLoad (ScriptBitReader reader)
 
- Public Member Functions inherited from BaseTimeAndWeatherManagerEntity
proto external bool IsNightHour (float hour24)
 
proto external bool IsDayHour (float hour24)
 
proto void SetTimeEvent (string time, Managed inst, func callback, bool delayed=true, bool singleUse=false)
 
proto external bool TryGetCompleteLocalWeather (LocalWeatherSituation lws, float swayFrequency, vector location)
 Returns all information about current weather - rain, fog, overcast, wind.
 

Protected Member Functions

void UpdateWeatherLooping (bool isLooping)
 Set weather's looping over the network.
 
void CreateDayTimeInfoArray (int year=-1, int month=-1, int day=-1)
 
void StartListeningToWindApplyDelay ()
 
void DelayedApplyWindOverride ()
 
void ClearDelayedWindOverrideVars ()
 

Protected Attributes

ref array< ref SCR_DayTimeInfoBasem_aOrderedDaytimeInfo
 
ref array< ref SCR_WindDirectionInfom_OrderedWindDirectionInfo
 
ref array< ref SCR_MoonPhaseInfom_aMoonPhasesInfo
 
ref array< LocalizedStringm_aOrderedDaysOfWeek
 
bool m_bDelayedWindOverride = false
 
int m_iDelayedPlayerChangingWind = -1
 
float m_fDelayedWindSpeedOverride = -1
 
float m_fDelayedWindDirectionOverride = -1
 
bool m_bListiningToWindOverrideDelay = false
 
ref ScriptInvokerBase< SCR_TimeAndWeatherManager_OnWeatherStatePreview > m_OnWeatherStatePreview
 
ref ScriptInvokerBase< SCR_TimeAndWeatherManager_OnWindPreview > m_OnWindPreview
 
ref ScriptInvokerBase< SCR_TimeAndWeatherManager_OnDateTimePreview > m_OnDateTimePreview
 
bool m_bWeatherIsLooping = false
 

Detailed Description

Manager entity responsible for managing in-game time and weather, providing the script and gamecode with usable in-game API.

Member Function Documentation

◆ ClearDelayedWindOverrideVars()

void TimeAndWeatherManagerEntity.ClearDelayedWindOverrideVars ( )
protected

◆ CreateDayTimeInfoArray()

void TimeAndWeatherManagerEntity.CreateDayTimeInfoArray ( int  year = -1,
int  month = -1,
int  day = -1 
)
protected
Parameters
year
month
day

◆ DelayedApplyWindOverride()

void TimeAndWeatherManagerEntity.DelayedApplyWindOverride ( )
protected

◆ DelayedOverrideWindDirection()

void TimeAndWeatherManagerEntity.DelayedOverrideWindDirection ( float  windDirection,
int  playerChangingWind = -1 
)

Sets wind direction override.

Will wait a frame before it is applied. Will do nothing if m_bDelayedWindOverride is false \params windDirection new winddirection

Parameters
playerChangingWindplayer who changed the wind override to show a notification
windDirection
playerChangingWind

◆ DelayedOverrideWindSpeed()

void TimeAndWeatherManagerEntity.DelayedOverrideWindSpeed ( float  windSpeed,
int  playerChangingWind = -1 
)

Sets wind speed override.

Will wait a frame before it is applied. Will do nothing if m_bDelayedWindOverride is false \params windSpeed new windspeed

Parameters
playerChangingWindplayer who changed the wind override to show a notification
windSpeed
playerChangingWind

◆ DelayedSetWindOverride()

void TimeAndWeatherManagerEntity.DelayedSetWindOverride ( bool  overrideWind,
int  playerChangingWind = -1 
)

Sets wind override true or false.

Will wait a frame before it is applied so wind direction change and wind speed change can be executed

Parameters
overrideWindif true wind will be set to override using m_fDelayedWindSpeedOverride and m_fDelayedWindDirectionOverride
playerChangingWindplayer who changed the wind override to show a notification
overrideWind
playerChangingWind

◆ ForceWeatherTo()

void TimeAndWeatherManagerEntity.ForceWeatherTo ( bool  setLooping,
string  weatherID = string::Empty,
float  transitionDuration = 0,
float  stateDuration = 0::001,
int  playerThatChangedWeather = 0 
)

Forces weather to the given state.

Does not care if the transition is valid or not. (Server only) Use this if you want to set weather to looping or change the weather on the fly Do not change weather from looping true/false outside of this function

Parameters
setLoopingSet looping true or false
weatherIDweather to set. Leave empty if you want to change the current weather to looping true/false
transitionDurationtransition duration of weather
stateDurationstate duration of weather
playerThatChangedWeatherID of player that changed the weather for notifications. Leave empty if no notifications should be called

◆ GetCurrentDayTimeUIInfo()

int TimeAndWeatherManagerEntity.GetCurrentDayTimeUIInfo ( out SCR_UIInfo  uiInfo)

Gets the UI info of the current time of day.

Also returns the index of the current time of day info

Parameters
[out]uiInfoui info of time of day
Returns
int time of day info index

◆ GetCurrentDayTimeUIInfoAndPhase()

EDayTimeEnums TimeAndWeatherManagerEntity.GetCurrentDayTimeUIInfoAndPhase ( out SCR_UIInfo  uiInfo)

Gets the current daytime Ui info and Phase.

Parameters
[out]uiInfoui info of time of day
Returns
Current DayTimePhase

◆ GetCurrentMoonPhaseInfoForDate()

SCR_MoonPhaseUIInfo TimeAndWeatherManagerEntity.GetCurrentMoonPhaseInfoForDate ( )

Get moon phase for the current date.

Returns
SCR_MoonPhaseUIInfo moonphase info. This includes the full name of the moonphase as well as a simplified name (eg: first and Third quarter will be called half moon)

◆ GetDayTimeInfoArray()

int TimeAndWeatherManagerEntity.GetDayTimeInfoArray ( out notnull array< SCR_DayTimeInfoBase dayTimeInfoArray,
int  year = -1,
int  month = -1,
int  day = -1 
)

Gets an array of daytime info which holds the UIinfo of specific times of the day.

Parameters
[out]dayTimeInfoArrayarray with time of day infos
yeardate to get time info of
monthdate to get time info of
daydate to get time info of
Returns
dayTimeInfoArray's count

◆ GetDayTimeUIInfo()

int TimeAndWeatherManagerEntity.GetDayTimeUIInfo ( float  TimeOfDay,
out SCR_UIInfo  uiInfo,
out EDayTimeEnums  dayTimePhase = -1,
int  year = -1,
int  month = -1,
int  day = -1 
)

Gets an array of daytime info which holds the UIinfo of specific times of the day.

Parameters
TimeOfDaythe time of day to get time info of
[out]uiInfotime info of the given day time
[out]dayTimePhasePhase of current daytime
yeardate to get time info of
monthdate to get time info of
daydate to get time info of
Returns
int time of day info index

◆ GetMoonPhaseInfoForDate()

SCR_MoonPhaseUIInfo TimeAndWeatherManagerEntity.GetMoonPhaseInfoForDate ( int  year,
int  month,
int  day,
float  timeOfTheDay24,
float  timezone,
float  dstOffset,
float  Latitude 
)

Gets moon phase name for supplied date, geo location is not needed but timezone yes in order to calculate UTC correctly.

Parameters
yearYear.
monthMonth in range <1, 12>
dayDay in range <1, 31>
timeOfTheDay24Time of the day in 24 hour floating point format.
timezoneTimeZone Offset in hours ranging <-12, +14>
dstOffsetDST (daylight savings time) offset, must be 0.0 or positive value.
Returns
SCR_MoonPhaseUIInfo moonphase info. This includes the full name of the moonphase as well as a simplified name (eg: first and Third quarter will be called half moon)

◆ GetOnDateTimePreview()

ScriptInvokerBase< SCR_TimeAndWeatherManager_OnDateTimePreview > TimeAndWeatherManagerEntity.GetOnDateTimePreview ( )
Returns
Get on date time preview enabled/disabled

◆ GetOnWeatherStatePreview()

ScriptInvokerBase< SCR_TimeAndWeatherManager_OnWeatherStatePreview > TimeAndWeatherManagerEntity.GetOnWeatherStatePreview ( )
Returns
Get on weather state preview enabled/disabled

◆ GetOnWindPreview()

ScriptInvokerBase< SCR_TimeAndWeatherManager_OnWindPreview > TimeAndWeatherManagerEntity.GetOnWindPreview ( )
Returns
Get on wind preview enabled/disabled

◆ GetOrderedWindDirectionInfoArray()

int TimeAndWeatherManagerEntity.GetOrderedWindDirectionInfoArray ( notnull array< SCR_WindDirectionInfo orderedWindDirectionInfo)

Gets array of ordered Wind Direction info.

Parameters
[out]orderedWindDirectionInfoarray of winddirection info
Returns
int count of array
Parameters
orderedWindDirectionInfo
Returns

◆ GetTime()

TimeContainer TimeAndWeatherManagerEntity.GetTime ( )

Retrieves current time of the day and returns it as a script wrapper for hours, minutes and seconds.

Returns
Returns script wrapper for time

◆ GetWeekDayString()

string TimeAndWeatherManagerEntity.GetWeekDayString ( )

Use current date to get day of the week localized string (eg Monday, Tuesday ect)

Returns
Day of the week

◆ GetWeekDayStringForDate()

string TimeAndWeatherManagerEntity.GetWeekDayStringForDate ( int  year,
int  month,
int  day 
)

Use given date to get day of the week localized string (eg Monday, Tuesday ect)

Returns
Day of the week as defined in m_aOrderedDaysOfWeek

◆ GetWindDirectionInfoFromFloat()

bool TimeAndWeatherManagerEntity.GetWindDirectionInfoFromFloat ( float  windDirectionFloat,
out int  index,
out SCR_WindDirectionInfo  windDirectionInfo 
)

Gets wind direction info from winddirection float.

Parameters
windDirectionFloatwinddirection of which to find the info
[out]indexindex of winddirection info
[out]windDirectionInfofound winddirection info
Returns
bool returns true if winddirection info found
Parameters
windDirectionFloat
[out]index
[out]windDirectionInfo
Returns

◆ GetWindDirectionInfoFromIndex()

bool TimeAndWeatherManagerEntity.GetWindDirectionInfoFromIndex ( int  index,
out SCR_WindDirectionInfo  windDirectionInfo 
)

Gets wind direction info using index of array.

Parameters
indexindex to find winddirection info
[out]windDirectionInfofound winddirection info
Returns
bool returns true if winddirection info found
Parameters
index
[out]windDirectionInfo
Returns

◆ IsSunSet() [1/2]

bool TimeAndWeatherManagerEntity.IsSunSet ( )

Get if the sun is set for the current time, latitude/longitude/date configuration.

\

Returns
True if sun is set

◆ IsSunSet() [2/2]

bool TimeAndWeatherManagerEntity.IsSunSet ( float  timeToCheck)

Get if the sun is set at given time.

Note this will use current latitude/longitude/date configuration

Parameters
timeToChecktime to check. Uses 24 hour format e.g. 12.50 is 12:30 A.M
Returns
True if sun is set for the given time

◆ IsWeatherLooping()

bool TimeAndWeatherManagerEntity.IsWeatherLooping ( )

Get if weather is looping.

See also
SetCurrentWeatherLooping
Returns
true if weather currently is looping

◆ RplLoad()

override bool TimeAndWeatherManagerEntity.RplLoad ( ScriptBitReader  reader)

◆ RplSave()

override bool TimeAndWeatherManagerEntity.RplSave ( ScriptBitWriter  writer)

◆ SetCurrentWeatherLooping()

void TimeAndWeatherManagerEntity.SetCurrentWeatherLooping ( bool  setLooping,
int  playerChangedLooping = 0 
)

Sets weather looping (server only) Use ForceWeatherTo to have more control over transition time and state duration.

See also
ForceWeatherTo
UpdateWeatherLooping
IsWeatherLooping
Parameters
setLoopingSet looping true or false
playerChangedLoopingID of player that set weather to looping

◆ SetDateTimePreview()

bool TimeAndWeatherManagerEntity.SetDateTimePreview ( bool  preview,
int  year = -1,
int  month = -1,
int  day = -1,
float  timeOfTheDay = -1 
)

Set date time Preview.

Can be called locally and will send an scriptInvoker when called succesfully

Parameters
previewTrue to enable preview, false to disable
yearYear to preview, no need to give if preview is false
monthMonth to preview, no need to give if preview is false
dayDay to preview, no need to give if preview is false
timeOfTheDayTime of day to preview in 24.0, no need to give if preview is false
Returns
True if preview changed succesfully

◆ SetTime()

bool TimeAndWeatherManagerEntity.SetTime ( TimeContainer  cont)

Sets current time of the day via a script wrapper.

See also
SetHoursMinutesSeconds for more detailed description. \params cont Script wrapper for time in hours, minutes and seconds
Returns
Returns true when command is issued successfully, false otherwise.
Parameters
cont
Returns

◆ SetWeatherStatePreview()

bool TimeAndWeatherManagerEntity.SetWeatherStatePreview ( bool  preview,
string  stateName = "" 
)

Set Weather state preview.

Can be called locally and will send an scriptInvoker when called succesfully

Parameters
previewTrue to enable preview, false to disable
stateNameWeather State name to preview, no need to give if preview is false
Returns
True if preview changed succesfully

◆ SetWindPreview()

bool TimeAndWeatherManagerEntity.SetWindPreview ( bool  preview,
float  windSpeed = -1,
float  windAngleDegrees = -1 
)

Set wind preview.

Can be called locally and will send an scriptInvoker when called succesfully

Parameters
previewTrue to enable preview, false to disable
windSpeedWindspeed to preview, no need to give if preview is false
windAngleDegreesWind Angle in Degrees to preview, no need to give if preview is false
Returns
True if preview changed succesfully

◆ StartListeningToWindApplyDelay()

void TimeAndWeatherManagerEntity.StartListeningToWindApplyDelay ( )
protected

◆ UpdateWeatherLooping()

void TimeAndWeatherManagerEntity.UpdateWeatherLooping ( bool  isLooping)
protected

Set weather's looping over the network.

Parameters
isLooping

Member Data Documentation

◆ m_aMoonPhasesInfo

ref array<ref SCR_MoonPhaseInfo> TimeAndWeatherManagerEntity.m_aMoonPhasesInfo
protected

◆ m_aOrderedDaysOfWeek

ref array<LocalizedString> TimeAndWeatherManagerEntity.m_aOrderedDaysOfWeek
protected

◆ m_aOrderedDaytimeInfo

ref array<ref SCR_DayTimeInfoBase> TimeAndWeatherManagerEntity.m_aOrderedDaytimeInfo
protected

◆ m_bDelayedWindOverride

bool TimeAndWeatherManagerEntity.m_bDelayedWindOverride = false
protected

◆ m_bListiningToWindOverrideDelay

bool TimeAndWeatherManagerEntity.m_bListiningToWindOverrideDelay = false
protected

◆ m_bWeatherIsLooping

bool TimeAndWeatherManagerEntity.m_bWeatherIsLooping = false
protected

◆ m_fDelayedWindDirectionOverride

float TimeAndWeatherManagerEntity.m_fDelayedWindDirectionOverride = -1
protected

◆ m_fDelayedWindSpeedOverride

float TimeAndWeatherManagerEntity.m_fDelayedWindSpeedOverride = -1
protected

◆ m_iDelayedPlayerChangingWind

int TimeAndWeatherManagerEntity.m_iDelayedPlayerChangingWind = -1
protected

◆ m_OnDateTimePreview

ref ScriptInvokerBase<SCR_TimeAndWeatherManager_OnDateTimePreview> TimeAndWeatherManagerEntity.m_OnDateTimePreview
protected

◆ m_OnWeatherStatePreview

ref ScriptInvokerBase<SCR_TimeAndWeatherManager_OnWeatherStatePreview> TimeAndWeatherManagerEntity.m_OnWeatherStatePreview
protected

◆ m_OnWindPreview

ref ScriptInvokerBase<SCR_TimeAndWeatherManager_OnWindPreview> TimeAndWeatherManagerEntity.m_OnWindPreview
protected

◆ m_OrderedWindDirectionInfo

ref array<ref SCR_WindDirectionInfo> TimeAndWeatherManagerEntity.m_OrderedWindDirectionInfo
protected

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