OnWeatherChange

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 22:32, 14 August 2026 by QCherry (talk | contribs) (Update Lua event reference)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

onWeatherChange

Triggered after the server accepts an authoritative weather transition.

Availability

This event is available in server-side scripts.

Callback signature

onWeatherChange(previousWeather, currentWeather, transitionMs, sourceResource)

Parameters

Name Type Description
previousWeather string The previous normalized weather key.
currentWeather string The new normalized weather key.
transitionMs int Transition duration in milliseconds.
sourceResource string The resource that requested the change.

Examples

Handle the event:

addEventHandler("onWeatherChange", root, function(previousWeather, currentWeather, transitionMs, sourceResource)
    outputDebugString("Weather: " .. previousWeather .. " -> " .. currentWeather)
end)

Notes

  • Late joiners receive the current authoritative weather from the server snapshot.