Builtin Library
README.md
weather
How surfaces respond to weather.
local weather = require("@builtin::systems.weather.weather")
weather.set({ wetness = 0.8, snow = 0.0 })
weather.get() --> the settings in force
weather.active() --> is the pass running
weather.clear() --> no weather, settings kept
set takes any subset. With both wetness and snow at 0 nothing is falling
and the pass is released.
Three things decide what a surface gets: which way it faces, whether it is
sheltered, and how much weather there is. shelter at 1 leaves anything under
cover completely dry; at 0 the world is wetted evenly regardless of what is
above it.
snowBias is how steeply a surface must face up before snow settles. Unlike
rain, snow either lies or it does not, so it is a threshold rather than a ramp.
For weather a scene should simply have, author the Weather component instead.
This module is for code driving weather over time — a storm cycle, a scripted
downpour.
The full description is in the package readme:
guides { path = "systems/weather" }.