Real Seasons.
Not a Random Weather Picker.
rde_weather is a full seasonal weather simulation for ox_core — storms clear via overcast → clearing → sun, never straight to EXTRASUNNY. MySQL-persistent, instantly synced on join, with sine-eased transitions and a streak breaker so it doesn't rain for three hours straight.
Overview
RDE Weather & Time is a full seasonal weather simulation built on ox_core, ox_lib and oxmysql. Weather moves through a realistic state graph weighted per real-world season, persists through restarts via MySQL, and syncs every joining player to the exact current weather, time, wind and snow state the instant they load in.
Why this over a generic weather script
| Feature | Generic Scripts | rde_weather |
|---|---|---|
| Persists across restarts | No | MySQL-backed |
| Smooth transitions | Opaque native | 450-step Sine-Easing blend |
| Wind interpolation | Snaps instantly | Shortest-path angle lerp |
| Seasonal weighting | None | 4 seasons, real calendar months |
| Bad-weather streak protection | None | Configurable hard cap |
Quick Start
Dependencies & load order
-- order matters
ensure oxmysql
ensure ox_lib
ensure ox_core
ensure rde_nostr_log -- optional
ensure rde_weather
Permissions
Grant an ACE permission, or rely on ox_core group grades (configurable per group minGrade):
add_ace group.admin rde.admin allow
add_principal identifier.steam:110000xxxxxxxx group.admin
The database table auto-creates on first start. Check console for confirmation.
Configuration
config.lua is fully commented. The transition system is the part worth understanding before you touch it:
Weather = {
defaultWeather = 'CLEAR',
transitionDuration = 45, -- seconds for the full smooth blend
transitionSteps = 450, -- ~100ms tick interval
transitionEasing = 'sine', -- 'sine' or 'linear'
}
DynamicWeather = {
changeInterval = {15, 45}, -- minutes, randomized
badWeatherStreakLimit = 3, -- force a clearing exit after N bad changes in a row
seasons = {
winter = {12,1,2}, spring = {3,4,5},
summer = {6,7,8}, autumn = {9,10,11},
},
}
How It Works
Season lookup → candidate selection → streak check → broadcast → client blend, every time the weather changes:
| Step | What happens |
|---|---|
| 1. Season lookup | Checks the real calendar month against the seasons table |
| 2. Candidate selection | Weighted random pick, restricted to the state-graph neighbours of the current weather |
| 3. Streak check | If the bad-weather counter hit the limit, force CLEARING instead of rolling again |
| 4. Broadcast | New weather written to GlobalState.rdeWeather immediately |
| 5. Client blend | 450-step sine-eased transition, wind interpolated via shortest-path angle math |
Common Pitfalls
Weather transitions still look choppy
A second resource is calling SetWeatherTypeNow/SetWeatherTypePersist and fighting rde_weather's manual blend every frame.
Fix: disable or remove any other weather resource — only one script may drive weather natives.
Players joining with wrong weather/time
rde_weather must start after oxmysql, ox_lib and ox_core in server.cfg. Sync happens via a lib.callback fired on resource init.
Fix: check server.cfg start order, and check F8 for callback timeout errors.
Stuck in bad weather for a long time
The streak breaker threshold might be set too high for your server's taste.
Fix: lower Config.DynamicWeather.badWeatherStreakLimit, or set Config.Debug = true to see the weighted rolls happening.
FAQ
Does this replace the GTA day/night cycle entirely?
Yes — it drives both weather and time. Time can mirror real wall-clock time or run on a custom multiplier.
Is rde_nostr_log required?
No — it's optional. If it's not installed, weather/time/wind/snow logging simply no-ops with zero errors.
Can I add my own weather types?
Yes — add the type to the transitions state graph and seasonal weight tables in config.lua.
Changelog
Fixed stair-stepping on weather change — increased to 450 steps (~100ms) with Sine-Easing, fully synced wind transitions using shortest-path angle interpolation.
Replaced opaque native weather loops with deterministic manually-stepped crossfades. Introduced the Markov-chain streak breaker.
Fixed Snow enabling itself on Rain; smoother early-pass weather transition.