-
Notifications
You must be signed in to change notification settings - Fork 6
Zen's Weather Config

This is a modified version of affenb3rt's PresetWeather mod.
Obviously a huge shout-out to affenb3rt for releasing his mods open-source and allowing modders like myself to modify and redistribute his code.
My version of this mod has only one major difference: the weather config in the JSON file is randomized using weighted chance rather than simply picking a random array element.
This means you can have thunderstorms/blizzards/etc weather events be more rare than regular rain/snow/clear weather etc.
There is more info on how the mod works in the form of comments inside the actual source code for those who know how to read it - check out ZenModPack/scripts/4_world/Plugins/PluginBase/PluginZenWeatherConfig.c
But for most server owners all you really need to know is how to configure the weather config which I'll explain below.
This mod is disabled by default since it affects the weather system which is a core element of any server. Many server owners probably do not want to override their vanilla game weather with this config, so if you want to use this mod you'll need to enable it in the Master Config (instructions below).
When you run your server for the first time with this mod enabled it will generate a JSON file in your mission folder for tweaking the weather.
This is the file path:
%server_root/profiles/Zenarchist/ZenWeather.json
The mod will automatically generate a ZenWeather.json config file with some preset settings in it, but these will need to be tweaked as they have not been tested thoroughly and were just provided as an example template.
My server alternates between summer/winter so my weather config is a bit more complex than most servers will require, so I did not include my server's config as a template.
But to add your own presets is fairly easy, just set the transition and duration time to 2-3 minutes per preset and set "DebugOn": 1 in the config to test weather configs and see text messages in-game and in your server's script logs explaining what the weather system is doing.
Here is a description of each config setting and some example config for blizzards, rain, snow and clear weather:
{
"ConfigVersion": "3",
"DebugOn": 0, // Turn on in-game debug messages
"WeatherPresets": [
{
"name": "Blizzard", // Name of preset
"chance": 10.0, // Weighted chance of being selected (higher the number, the more frequently this preset gets selected)
"transition_minutes_min": 5.0, // Minimum/max minutes between transitions
"transition_minutes_max": 10.0,
"duration_minutes_min": 10.0, // Min/max minutes duration (stacks on top of transition)
"duration_minutes_max": 20.0, // So this preset could last a max of 30 mins in total
"overcast_min": 0.9, // Overcast min/max 0-100% (randomly selected)
"overcast_max": 1.0,
"wind_maxspeed": 50.0, // Max wind speed m/s (default is usually around 20-30m/s)
"wind_min": 1.0, // 100% of max wind speed (0-1, 10% would be 0.1)
"wind_max": 1.0,
"rain_min": 0.0, // Rain intensity (0-100% represented as 0-1)
"rain_max": 0.0,
"snow_min": 1.0, // Snow intensity (0-100% represented as 0-1)
"snow_max": 1.0,
"fog_min": 1.0, // Fog intensity/distance (0-100% represented as 0-1) - 1 = VERY foggy and limited view distance
"fog_max": 1.0,
"storm": 0, // Enable/disable storms
"thunder_timeout": 0.0 // Minimum time between thunder
},
{
"name": "Blizzard With Rain",
"chance": 10.0,
"transition_minutes_min": 5.0,
"transition_minutes_max": 10.0,
"duration_minutes_min": 10.0,
"duration_minutes_max": 20.0,
"overcast_min": 0.9,
"overcast_max": 1.0,
"wind_maxspeed": 50.0,
"wind_min": 1.0,
"wind_max": 1.0,
"rain_min": 0.0,
"rain_max": 0.1,
"snow_min": 1.0,
"snow_max": 1.0,
"fog_min": 1.0,
"fog_max": 1.0,
"storm": 1,
"thunder_timeout": 180.0
},
{
"name": "Clear Skies",
"chance": 50.0,
"transition_minutes_min": 10.0,
"transition_minutes_max": 30.0,
"duration_minutes_min": 15.0,
"duration_minutes_max": 30.0,
"overcast_min": 0.0,
"overcast_max": 0.2,
"wind_maxspeed": 10.0,
"wind_min": 0.1,
"wind_max": 0.5,
"rain_min": 0.0,
"rain_max": 0.0,
"snow_min": 0.0,
"snow_max": 0.0,
"fog_min": 0.0,
"fog_max": 0.0,
"storm": 0,
"thunder_timeout": 0.0
},
{
"name": "Light Snow",
"chance": 100.0,
"transition_minutes_min": 5.0,
"transition_minutes_max": 10.0,
"duration_minutes_min": 5.0,
"duration_minutes_max": 10.0,
"overcast_min": 0.3,
"overcast_max": 0.5,
"wind_maxspeed": 10.0,
"wind_min": 0.1,
"wind_max": 0.5,
"rain_min": 0.0,
"rain_max": 0.0,
"snow_min": 0.1,
"snow_max": 0.5,
"fog_min": 0.0,
"fog_max": 0.1,
"storm": 0,
"thunder_timeout": 0.0
},
{
"name": "Light Rain",
"chance": 5.0,
"transition_minutes_min": 5.0,
"transition_minutes_max": 10.0,
"duration_minutes_min": 2.0,
"duration_minutes_max": 5.0,
"overcast_min": 0.5,
"overcast_max": 0.7,
"wind_maxspeed": 10.0,
"wind_min": 0.1,
"wind_max": 0.5,
"rain_min": 0.0,
"rain_max": 0.1,
"snow_min": 0.0,
"snow_max": 0.0,
"fog_min": 0.05,
"fog_max": 0.1,
"storm": 0,
"thunder_timeout": 0.0
}
]
}
While using this mod the weather's persistent data is saved to a .bin file and reloaded on each server restart.
This ensure the weather stays persistent between restarts, so if your server is mid-transition to a storm for example, then on the next restart it will continue the transition where it left off.
This also makes it easy to reset your weather. Simply delete the weather.bin file and your weather will be reset on the next restart.
The bin file is saved here:
%server_root/mpmissions/map_name/storage_1/data/weather.bin
Be careful deleting any other files in this folder as this folder stores all of your server's persistence (bases, stashes, player loot etc).
To enable this mod set "ZenWeatherConfig": 1 in %server_profile/Zenarchist/ZenModPackConfig.json
It's disabled by default.
All my mods are open-source and published under the Mozilla Public License Version 2.0. Any mods based on my code must be open-source - no obfuscation!
You can modify/reupload/repack my mods if you like, but please credit any original authors/3D model/3rd-party asset creators, and keep in mind any future updates I make will not be automatically applied to repacked mods so make sure to check back from time to time for bugfixes and improvements.
If you find my mods useful, please consider buying me a coffee - it's not expected but very much appreciated: https://buymeacoffee.com/zenarchist
- General Setup Guide
- Core Mod Setup Guide
- ZenModPack Master Config
- Various Info
- Known Bugs & Issues
- Report Bug
My utility style mods for debugging etc.
Mods which affect game mechanics:
- ZenAlcohol
- ZenAllowMapBagSlot
- ZenAntiCombatLogout
- ZenAutoConvertStash
- ZenAutoStackItems
- ZenAutoWinterDetect
- ZenAutoRun
- ZenBasebuildingConfig
- ZenBatteryPASPersistence
- ZenBetterChatFont
- ZenBrokenGlasses
- ZenBuildingDescription
- ZenCarAttachments
- ZenCarBatteryIcon
- ZenCarCompass
- ZenCarGlovebox
- ZenCarsCutDownTrees
- ZenCanteenTablets
- ZenCatchRain
- ZenCauseOfDeath
- ZenChickenCoops
- ZenCraftingSounds
- ZenCraftRagHands
- ZenComboLocks
- ZenCombineJSON
- ZenDropRuinedClothing
- ZenDynamicZoneLoot
- ZenEarPlugs
- ZenFireFuel
- ZenFireWood
- ZenFireplaceStick
- ZenFishingConfig
- ZenFixCarAttachmentGUI
- ZenGraves
- ZenGroundCleaning
- ZenHideGearInCars
- ZenHints
- ZenHologram
- ZenHologramControls
- ZenImmersiveChatHUD
- ZenImmersiveLogin
- ZenInformWeaponStateBug
- ZenInventoryAnimation
- ZenKnifeGardens
- ZenLeftovers
- ZenLogPiles
- ZenMagObfuscation
- ZenMap
- ZenMicCheck
- ZenNotifications
- ZenOpenCansRock
- ZenPainting
- ZenPimpMyRide
- ZenRadioPlugin
- ZenRebuildableWells
- ZenRepairJSON
- ZenRepairPumps
- ZenRepairWells
- ZenServerGUI
- ZenShove
- ZenSplitUI
- ZenSleep
- ZenStaminaSlope
- ZenTerritories
- ZenWeaponEngrave
- ZenWoodHealth
- ZenZombieDoors
Mods which add gear to the game:
- ZenArtillery
- ZenBackwardsCaps
- ZenBookshelf
- ZenBunnyMasks
- ZenCamoCamp
- ZenCarWorkbench
- ZenChess
- ZenChristmasTreeCraft
- ZenConcussionGrenade
- ZenDoubleArmbands
- ZenFlask
- ZenFlint
- ZenGhillie
- ZenJameson
- ZenLadders
- ZenMusic
- ZenNotes
- ZenRaidAlarm
- ZenRaybans
- ZenRunes
- ZenStaticObjects
- ZenSwissKnife
- ZenTimeBomb
- ZenTireRack
- ZenTreasure
- ZenTreehouse
- ZenVikingAxe
- ZenZippoLighter
Mods which run purely server-side:
- ZenBloodDrips
- ZenCampSites
- ZenDynamicZoneLoot
- ZenLootCyclingDetection
- ZenNightConfig
- ZenPersistentTrees
- ZenShelterCargo
- ZenTreesplosions
- ZenZombieController
- ZenZombieConfig
- ZenJameson
My standalone mods