Weather: Difference between revisions
Complete upcoming 0.1.9 documentation: weather, crafting UI, world removal, doors and ladders; preserve release status |
Release 0.1.9 / BUILD264 / Protocol42: availability and download setup; preserve experimental limits |
||
| Line 1: | Line 1: | ||
= Weather = | = Weather = | ||
'''Extended presets and getWeatherTypes are available from 0.1.9 | '''Extended presets and getWeatherTypes are available from 0.1.9.''' Existing weather/time functions remain available in earlier releases with their earlier catalog. Use matching updated server and clients. | ||
== Available weather == | == Available weather == | ||
Latest revision as of 13:30, 20 October 2026
Weather
Extended presets and getWeatherTypes are available from 0.1.9. Existing weather/time functions remain available in earlier releases with their earlier catalog. Use matching updated server and clients.
Available weather
Weather catalog lists 43 canonical settings: the original five biome-aware modes and 38 explicit presets provided by the game. These include light/normal snow, blizzard, fog, clouds, rain/thunderstorm, sand/dust storms and regional variations. They are not 43 different precipitation effects.
sunny, cloudy, rain1, rain2 and rain3 keep the native biome-dependent behavior. Explicit presets select their settings independently of that automatic biome choice. Returning to a legacy name releases the explicit override. No game assets or map files are edited.
Server Lua
| Function | Purpose |
|---|---|
| getWeatherTypes | New in 0.1.9: fresh array of supported canonical names. |
| setWeather | Select server weather, optionally with transition milliseconds. |
| getWeather | Read the canonical server target, not the client's rendered image. |
| getWeatherRevision / getWeatherTransitionDuration | Inspect authoritative revision and requested transition duration. |
| getPlayerWeatherSync | Inspect one client's latest acknowledgement and freshness. |
Run these calls in trusted server resource code, after applying your own administration/gameplay permissions:
local modes = getWeatherTypes()
for _, name in ipairs(modes) do
outputDebugString(name)
end
-- Choose one when your gameplay requires it:
local accepted = setWeather("snow2", 5000)
if not accepted then
outputDebugString("Weather change rejected")
end
-- Later: setWeather("foggy", 3000)
-- Later: setWeather("sandstorm3", 3000)
-- Restore biome weather: setWeather("sunny", 0)
The optional transition is an integer from 0 to 300000 milliseconds, default 3000; zero requests immediate application. Names are case-insensitive and aliases normalize to canonical names. Unknown names and arbitrary asset paths are rejected. A true return means server acceptance, not completed client rendering. Avoid competing weather timers in different resources: there is one global server weather target, not separate player/dimension weather.
Callback
The existing onWeatherChange event includes the new canonical names without a new signature:
addEventHandler("onWeatherChange", root,
function(previousWeather, currentWeather, transitionMs, sourceName)
outputDebugString(previousWeather .. " -> " .. currentWeather)
end)
This is a server notification after acceptance, not a client transition-completion event. Lua changes identify their resource; administrative changes use their administrative source.
Configuration and console
In the server configuration:
[world]
weather=snow2
weatherTransitionMs=5000
Use the same canonical names or aliases in the existing server console/RCON command:
weather list weather snow3 5000 weather sunny 0
These are administrative console commands, not automatically installed player chat commands. Examples do not grant players permission to change the weather.
Synchronization and transitions
The existing reliable world-environment synchronization is retained. Connected clients receive the target; joining clients apply the current target directly instead of replaying an obsolete transition. Explicit-preset transitions blend cloud, precipitation, lightning, wind, fog, dust and supported surface-coverage settings. Changing to a different preset mid-transition starts from the current blend; repeated snapshots of the same target do not restart it. Returning to a legacy mode uses the existing native weather path.
The same server target does not mean identical particles or lightning timing on all machines. Regional legacy modes and local indoor/weather occlusion can also affect appearance. Snow and sand presets do not start the multiplayer rain-audio loop. The update does not add a separately synchronized snow-sound or sandstorm-sound API.
Verification and limits
The preset catalog, validation, state replay and transition logic have automated coverage. The new presets still require visual qualification in the running game, including another player, late join, indoor areas and returning to ordinary weather. A client ACK or status ok confirms command/override acceptance, not proof that snow, fog or dust rendered correctly.
Snow coverage affects only compatible game materials; it does not convert the whole world into a winter map. Terrain, navigation and collision are unchanged. This is a preset API, not arbitrary particle spawning, numeric weather-field editing, seasonal simulation or per-player weather. Test the presets your server intends to use before enabling them in gameplay.