Arma Reforger Script API
|
Manager entity responsible for managing in-game time and weather, providing the script and gamecode with usable in-game API. More...
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_DayTimeInfoBase > | m_aOrderedDaytimeInfo |
ref array< ref SCR_WindDirectionInfo > | m_OrderedWindDirectionInfo |
ref array< ref SCR_MoonPhaseInfo > | m_aMoonPhasesInfo |
ref array< LocalizedString > | m_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 |
Manager entity responsible for managing in-game time and weather, providing the script and gamecode with usable in-game API.
|
protected |
|
protected |
year | |
month | |
day |
|
protected |
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
playerChangingWind | player who changed the wind override to show a notification |
windDirection | |
playerChangingWind |
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
playerChangingWind | player who changed the wind override to show a notification |
windSpeed | |
playerChangingWind |
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
overrideWind | if true wind will be set to override using m_fDelayedWindSpeedOverride and m_fDelayedWindDirectionOverride |
playerChangingWind | player who changed the wind override to show a notification |
overrideWind | |
playerChangingWind |
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
setLooping | Set looping true or false |
weatherID | weather to set. Leave empty if you want to change the current weather to looping true/false |
transitionDuration | transition duration of weather |
stateDuration | state duration of weather |
playerThatChangedWeather | ID of player that changed the weather for notifications. Leave empty if no notifications should be called |
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
[out] | uiInfo | ui info of time of day |
EDayTimeEnums TimeAndWeatherManagerEntity.GetCurrentDayTimeUIInfoAndPhase | ( | out SCR_UIInfo | uiInfo | ) |
Gets the current daytime Ui info and Phase.
[out] | uiInfo | ui info of time of day |
SCR_MoonPhaseUIInfo TimeAndWeatherManagerEntity.GetCurrentMoonPhaseInfoForDate | ( | ) |
Get moon phase for the current date.
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.
[out] | dayTimeInfoArray | array with time of day infos |
year | date to get time info of | |
month | date to get time info of | |
day | date to get time info of |
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.
TimeOfDay | the time of day to get time info of | |
[out] | uiInfo | time info of the given day time |
[out] | dayTimePhase | Phase of current daytime |
year | date to get time info of | |
month | date to get time info of | |
day | date to get time info of |
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.
year | Year. |
month | Month in range <1, 12> |
day | Day in range <1, 31> |
timeOfTheDay24 | Time of the day in 24 hour floating point format. |
timezone | TimeZone Offset in hours ranging <-12, +14> |
dstOffset | DST (daylight savings time) offset, must be 0.0 or positive value. |
ScriptInvokerBase< SCR_TimeAndWeatherManager_OnDateTimePreview > TimeAndWeatherManagerEntity.GetOnDateTimePreview | ( | ) |
ScriptInvokerBase< SCR_TimeAndWeatherManager_OnWeatherStatePreview > TimeAndWeatherManagerEntity.GetOnWeatherStatePreview | ( | ) |
ScriptInvokerBase< SCR_TimeAndWeatherManager_OnWindPreview > TimeAndWeatherManagerEntity.GetOnWindPreview | ( | ) |
int TimeAndWeatherManagerEntity.GetOrderedWindDirectionInfoArray | ( | notnull array< SCR_WindDirectionInfo > | orderedWindDirectionInfo | ) |
Gets array of ordered Wind Direction info.
[out] | orderedWindDirectionInfo | array of winddirection info |
orderedWindDirectionInfo |
TimeContainer TimeAndWeatherManagerEntity.GetTime | ( | ) |
Retrieves current time of the day and returns it as a script wrapper for hours, minutes and seconds.
string TimeAndWeatherManagerEntity.GetWeekDayString | ( | ) |
Use current date to get day of the week localized string (eg Monday, Tuesday ect)
string TimeAndWeatherManagerEntity.GetWeekDayStringForDate | ( | int | year, |
int | month, | ||
int | day | ||
) |
Use given date to get day of the week localized string (eg Monday, Tuesday ect)
bool TimeAndWeatherManagerEntity.GetWindDirectionInfoFromFloat | ( | float | windDirectionFloat, |
out int | index, | ||
out SCR_WindDirectionInfo | windDirectionInfo | ||
) |
Gets wind direction info from winddirection float.
windDirectionFloat | winddirection of which to find the info | |
[out] | index | index of winddirection info |
[out] | windDirectionInfo | found winddirection info |
windDirectionFloat | ||
[out] | index | |
[out] | windDirectionInfo |
bool TimeAndWeatherManagerEntity.GetWindDirectionInfoFromIndex | ( | int | index, |
out SCR_WindDirectionInfo | windDirectionInfo | ||
) |
Gets wind direction info using index of array.
index | index to find winddirection info | |
[out] | windDirectionInfo | found winddirection info |
index | ||
[out] | windDirectionInfo |
bool TimeAndWeatherManagerEntity.IsSunSet | ( | ) |
Get if the sun is set for the current time, latitude/longitude/date configuration.
\
bool TimeAndWeatherManagerEntity.IsSunSet | ( | float | timeToCheck | ) |
Get if the sun is set at given time.
Note this will use current latitude/longitude/date configuration
timeToCheck | time to check. Uses 24 hour format e.g. 12.50 is 12:30 A.M |
bool TimeAndWeatherManagerEntity.IsWeatherLooping | ( | ) |
Get if weather is looping.
override bool TimeAndWeatherManagerEntity.RplLoad | ( | ScriptBitReader | reader | ) |
override bool TimeAndWeatherManagerEntity.RplSave | ( | ScriptBitWriter | writer | ) |
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.
setLooping | Set looping true or false |
playerChangedLooping | ID of player that set weather to looping |
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
preview | True to enable preview, false to disable |
year | Year to preview, no need to give if preview is false |
month | Month to preview, no need to give if preview is false |
day | Day to preview, no need to give if preview is false |
timeOfTheDay | Time of day to preview in 24.0, no need to give if preview is false |
bool TimeAndWeatherManagerEntity.SetTime | ( | TimeContainer | cont | ) |
Sets current time of the day via a script wrapper.
cont |
bool TimeAndWeatherManagerEntity.SetWeatherStatePreview | ( | bool | preview, |
string | stateName = "" |
||
) |
Set Weather state preview.
Can be called locally and will send an scriptInvoker when called succesfully
preview | True to enable preview, false to disable |
stateName | Weather State name to preview, no need to give if preview is false |
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
preview | True to enable preview, false to disable |
windSpeed | Windspeed to preview, no need to give if preview is false |
windAngleDegrees | Wind Angle in Degrees to preview, no need to give if preview is false |
|
protected |
|
protected |
Set weather's looping over the network.
isLooping |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |