Skip to main content

FB2WeatherManager

Overview

  • Simulation manager for weather/season/disasters: query current weather and season, detect weather changes. (lua_manifest Manager binding key="Weather")

Metadata

FieldValue
Kindsystem
EnvironmentB2 - Simulation
Categorysystems
ExtendsFB2ManagerBase
Requirerequire('Systems.B2WeatherManager')

Properties (20)

NameTypeDescription
CachedAutonomyPenaltyByTemplatetable<string, boolean>
CachedAutonomyPenaltyWeatherstring
CurrentSeasonEB1SeasonType
DefaultStartDayForCheatinteger
DisasterByProbtable<string, number>
DisasterCoolTimetable<string, integer>
DisasterCooldownTimeTasktable<string, FB1TimeTaskId>
DisasterOccurTimeTaskFB1TimeTaskId
DisasterScheduleFB1WeatherInfo
OverriddenWeatherScheduleFB1WeatherInfo
PrevSeasonEB1SeasonType
PrevSeasonTemperatureinteger
PrevWeatherScheduleFB1WeatherInfo
RecoveryDisasterTimeTaskFB1TimeTaskId
SeasonWeatherScheduleFB1WeatherInfo
StoredWeatherScheduleFB1WeatherInfo
WeatherForecastFB1WeatherInfo[]
bEnableDisasterboolean
bEnabledboolean
bHasValidSeasonWeatherDataboolean

Functions (51)

FunctionParametersReturnsDescription
ApplyFarmingObjectScriptsInCropEntityId: FB1EntityId-Applies Farming Object Scripts.
CancelDisasterScheduleForHoliday--
ClearOverridenWeather--Clears Overriden Weather.
DisasterStartInDisasterType: string-
FindTriggerIdsInTriggerType: EB1WeatherTriggerType, InStage: EB1WeatherTriggerStage, OutTriggerIds: string[]-Finds and returns Trigger Ids.
GetAllObjectEntityIdOutAllObjectEntityIds: FB1EntityId[]-Returns All Object Entity Id.
GetDayPerSeason-integerReturns Day Per Season.
GetDisasterConfigInDisasterId: stringFB1DisasterConfigReturns Disaster Config.
GetEnabled-booleanReturns Enabled.
GetMaterialParameterTime-numberReturns Material Parameter Time.
GetRandomWeatherConfigInWeathers: FB1WeatherConfig[]FB1WeatherConfigReturns Random Weather Config.
GetRandomWeatherStepInWeatherConfig: FB1WeatherConfigintegerReturns Random Weather Step.
GetScheduleTime-integerReturns Schedule Time.
GetSeason-EB1SeasonTypeReturns Season.
GetSeasonAtInTotalDays: integerEB1SeasonTypeReturns Season At.
GetShipwreckConfigInDisasterId: stringFB1ShipwreckConfigReturns Shipwreck Config.
GetTemperature-integerReturns Temperature.
GetTemperatureRangeInTemperature: integerEB1TemperatureRangeReturns Temperature Range.
GetWeather-stringReturns Weather.
GetWeatherCategoryInWeather: stringEB1WeatherCategoryReturns Weather Category.
GetWeatherExposedAutonomyRewardMultiplier-numberReturns Weather Exposed Autonomy Reward Multiplier.
GetWeatherForecast-FB1WeatherInfo[]Returns Weather Forecast.
GetWeatherInfo-FB1WeatherInfoReturns Weather Info.
GetWeatherRemaingTime-numberReturns Weather Remaing Time.
HandleDisasterCooldownInDisasterType: string-
HasAnyDisasterObjectStateInEntityId: FB1EntityIdbooleanReturns whether it has Any Disaster Object State.
IsDisasterNow-booleanReturns whether Disaster Now.
IsExistOverriddenWeather-booleanReturns whether Exist Overridden Weather.
IsObjectAutonomyWeatherExposedInObjectEntityId: FB1EntityIdbooleanReturns whether Object Autonomy Weather Exposed.
IsRecoveringDisaster-booleanReturns whether Recovering Disaster.
OnDayChangedInBeforeTime: FDateTime, InAfterTime: FDateTime-Callback invoked on Day Changed.
OnDisasterRecoveryFinishedInDisasterId: string-Callback invoked on Disaster Recovery Finished.
OverrideWeatherInWeather: string, InStep: integer-
OverrideWeatherWithTransitionInWeather: string, InStep: integer, bTransitionImmediately: boolean-
Pause--
ReapplyTemperatureBuffs--Removes all characters' temperature buffs, then runs AddBuff_If_Bad_TPO_Winter/Summer in a spread-out manner (called on temperature change or option change).
RefreshWeatherObjectEffectAppliedToSingleInEntityId: FB1EntityId-
RegisterDisasterSchedulebOnlyStartOnHour: boolean-Registers Disaster Schedule.
Resume--
SetEnableDisasterbInEnable: boolean-Sets Enable Disaster.
SetSeasonWeatherInWeatherInfo: FB1WeatherInfo, bTransitionImmediately: boolean, bInit: boolean-Sets Season Weather.
SetWeatherInWeatherInfo: FB1WeatherInfo, bTransitionImmediately: boolean, bInit: boolean-Sets Weather.
ShouldApplyAutonomyWeatherPenaltyInObjectTemplateId: stringbooleanReturns whether it should Apply Autonomy Weather Penalty.
StartDisasterCooldownTimerInDisasterType: string-Starts Disaster Cooldown Timer.
TryOccurDisasterEvent--
TryScheduleShipwreckInShipId: FB1EntityId-
UpdateCurrentWeatherForCheatInSeasonWeather: EB1WeatherType, InSeasonWeatherStep: integer-Updates Current Weather For Cheat.
UpdateDisasterOccurForCheatInDisaster: string-Updates Disaster Occur For Cheat.
UpdateSeasonCycleInTotalDays: integer, bInit: boolean-Updates Season Cycle.
UpdateSeasonCycleForCheatInSeasonType: EB1SeasonType-Updates Season Cycle For Cheat.
UpdateTemperatureForCheatInTemperature: integer-Updates Temperature For Cheat.

Override points (22)

Implement these in Lua as FB2WeatherManager.Override_Name = function(...) end.

FunctionParametersReturnsDescription
Override_ApplyFarmingObjectScriptsInCropEntityId: FB1EntityId-Applies Farming Object Scripts.
Override_CancelDisasterScheduleForHoliday--
Override_ClearOverridenWeather--Clears Overriden Weather.
Override_DisasterStartInDisasterType: string-
Override_HandleDisasterCooldownInDisasterType: string-
Override_HasAnyDisasterObjectStateInEntityId: FB1EntityIdbooleanReturns whether it has Any Disaster Object State.
Override_OnDayChangedInBeforeTime: FDateTime, InAfterTime: FDateTime-Callback invoked on Day Changed.
Override_OnDisasterRecoveryFinishedInDisasterId: string-Callback invoked on Disaster Recovery Finished.
Override_Pause--
Override_ReapplyTemperatureBuffs--Removes all characters' temperature buffs, then runs AddBuff_If_Bad_TPO_Winter/Summer in a spread-out manner (called on temperature change or option change).
Override_RefreshWeatherObjectEffectAppliedToSingleInEntityId: FB1EntityId-
Override_RegisterDisasterSchedulebOnlyStartOnHour: boolean-Registers Disaster Schedule.
Override_Resume--
Override_ShouldApplyAutonomyWeatherPenaltyInObjectTemplateId: stringbooleanReturns whether it should Apply Autonomy Weather Penalty.
Override_StartDisasterCooldownTimerInDisasterType: string-Starts Disaster Cooldown Timer.
Override_TryOccurDisasterEvent--
Override_TryScheduleShipwreckInShipId: FB1EntityId-
Override_UpdateCurrentWeatherForCheatInSeasonWeather: EB1WeatherType, InSeasonWeatherStep: integer-Updates Current Weather For Cheat.
Override_UpdateDisasterOccurForCheatInDisaster: string-Updates Disaster Occur For Cheat.
Override_UpdateSeasonCycleInTotalDays: integer, bInit: boolean-Updates Season Cycle.
Override_UpdateSeasonCycleForCheatInSeasonType: EB1SeasonType-Updates Season Cycle For Cheat.
Override_UpdateTemperatureForCheatInTemperature: integer-Updates Temperature For Cheat.