GetWeather: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Complete Lua function catalog
Complete upcoming 0.1.9 documentation: weather, crafting UI, world removal, doors and ladders; preserve release status
Line 12: Line 12:


== Returns ==
== Returns ==
Returns one of <code>sunny</code>, <code>cloudy</code>, <code>rain1</code>, <code>rain2</code>, or <code>rain3</code>.
Returns the canonical server weather name. Earlier releases return sunny, cloudy or rain1..rain3. From 0.1.9 it may be any of the 43 names in [[Weather catalog]], including explicit snow/fog/dust presets; use [[getWeatherTypes]] to discover supported names.


== Examples ==
== Examples ==
Line 29: Line 29:
[[Category:Server Functions]]
[[Category:Server Functions]]
[[Category:World Functions]]
[[Category:World Functions]]
<!-- weather019:start -->
== Extended weather from 0.1.9 ==
'''Available from 0.1.9 (upcoming; not yet publicly released). Not included in public 0.1.8. Use matching updated clients and server.'''
This existing API retains its call shape; the catalog is extended, not restricted to five names. See [[Weather]] and [[Weather catalog]]. Server target/revision and client acknowledgement are not proof of the final rendered image. The new presets still require in-game visual qualification; use compatible clients and test late join, indoor areas and returning to ordinary weather.
<!-- weather019:end -->

Revision as of 20:56, 19 October 2026

getWeather

Returns the canonical name of the server's authoritative weather state.

Syntax

string weather = getWeather()

Parameters

This function does not accept parameters.

Returns

Returns the canonical server weather name. Earlier releases return sunny, cloudy or rain1..rain3. From 0.1.9 it may be any of the 43 names in Weather catalog, including explicit snow/fog/dust presets; use getWeatherTypes to discover supported names.

Examples

Report the current weather to a player:

addCommandHandler("weather", function(playerId)
    outputChatBox("Current weather: " .. getWeather(), playerId)
end)

Notes

  • Available only in server-side resource scripts.
  • The returned value is server state, not a direct read from one client's renderer.

Extended weather from 0.1.9

Available from 0.1.9 (upcoming; not yet publicly released). Not included in public 0.1.8. Use matching updated clients and server.

This existing API retains its call shape; the catalog is extended, not restricted to five names. See Weather and Weather catalog. Server target/revision and client acknowledgement are not proof of the final rendered image. The new presets still require in-game visual qualification; use compatible clients and test late join, indoor areas and returning to ordinary weather.