RDE_WEATHER DOCS
RED DRAGON ELITE // PLAYER SYSTEMS

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.

01 / Start Here

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.

Core Principle Weather transitions follow a Markov-style state graph — a type can only move to specific neighbours, so a thunderstorm clears through overcast/clearing, never jumps straight to sunny.

Why this over a generic weather script

FeatureGeneric Scriptsrde_weather
Persists across restartsNoMySQL-backed
Smooth transitionsOpaque native450-step Sine-Easing blend
Wind interpolationSnaps instantlyShortest-path angle lerp
Seasonal weightingNone4 seasons, real calendar months
Bad-weather streak protectionNoneConfigurable hard cap
02 / Start Here

Quick Start

Dependencies & load order

server.cfg
-- 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):

server.cfg
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.

03 / Reference

Configuration

config.lua is fully commented. The transition system is the part worth understanding before you touch it:

config.lua — Weather & Transitions
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},
    },
}
04 / Reference

Admin Menu

Unlike command-driven weather scripts, rde_weather uses one entry point — /weather — that opens a full ox_lib context menu, gated behind rde.admin ACE or an admin/moderator/management ox_core group.

SectionOptions
WeatherPick any of 15 types — sets instantly server-side, blends smoothly on every client
TimeMorning / Noon / Evening / Night, or custom hour+minute
WindManual speed/direction sliders, or randomize
SnowToggle ON/OFF, or one-click "Christmas Mode"
Security All actions are server-validated regardless of what the client sends — the menu is a convenience layer, not the security boundary.
05 / Reference

How It Works

Season lookup → candidate selection → streak check → broadcast → client blend, every time the weather changes:

StepWhat happens
1. Season lookupChecks the real calendar month against the seasons table
2. Candidate selectionWeighted random pick, restricted to the state-graph neighbours of the current weather
3. Streak checkIf the bad-weather counter hit the limit, force CLEARING instead of rolling again
4. BroadcastNew weather written to GlobalState.rdeWeather immediately
5. Client blend450-step sine-eased transition, wind interpolated via shortest-path angle math
06 / More

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.

07 / More

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.

08 / More

Changelog

v2.2.1

Fixed stair-stepping on weather change — increased to 450 steps (~100ms) with Sine-Easing, fully synced wind transitions using shortest-path angle interpolation.

v2.2.0

Replaced opaque native weather loops with deterministic manually-stepped crossfades. Introduced the Markov-chain streak breaker.

v1.0.1

Fixed Snow enabling itself on Rain; smoother early-pass weather transition.