Lua sections need revision: This page contains removed v5 APIs or old runtime examples. Do not use its Lua examples for current development. Start with Platform v1.
Finite Water & Environment Manual¶
This manual details the Finite Water fluid simulation, micro-weather forecasting, and environmental field diffusion mechanics in Cataclysm: Cleanwater Bomb (CCB).
1. Finite Water Dynamics¶
Unlike traditional forks with infinite water tiles, CCB simulates water as a mass-conserving fluid grid:
- Mass Conservation: Each tile stores precise fluid volume in milliliters. Water flows down slopes and pools in terrain depressions.
- Depletion & Drainage: Pumping water genuinely lowers the water table until depleted.
- Precipitation & Evaporation: Storms replenish surface water, while hot arid conditions evaporate pools.
2. Weather & Storm Forecast APIs¶
game.weather.get_storm_forecast(target_pos, forecast_hours) -> table¶
Queries meteorological storm forecasts for target coordinates within a specified window.
Parameters:
* target_pos (Tripoint, required): Target 3D coordinates.
* forecast_hours (integer, required): Forecast window in hours.
Returns:
* table: Forecast structure with has_storm (boolean), intensity (number), wind_speed (number, km/h), and predicted_turn (integer).
Example:
local forecast = game.weather.get_storm_forecast(player:pos(), 6)
if forecast.has_storm and forecast.intensity > 0.7 then
game.add_msg("warning", "Radar Warning: Severe storm arriving with winds up to %.1f km/h!", forecast.wind_speed)
end
3. Environmental Fields & Diffusion¶
- Fire Fields (
fd_fire): Consumes oxygen and flammable fuel, spreading along combustible structures. - Smoke Fields (
fd_smoke): Blocks long-range visibility and causes choking damage without filters. - Toxic Gas (
fd_gas_vent): Requires airtight NBC protection.