Time, weather and waves
The server’s world object controls shared time, weather and waves across all
dimensions. Settings are sent to connected players when changed and to new
players when they connect.
Set initial conditions
Section titled “Set initial conditions”This example starts the clock at noon, selects sunny weather and sets the wave amplitudes:
// @ts-check/// <reference types="@revomp/types-server" />import * as revo from 'revo-server';import { WeatherType } from 'revo-shared';
revo.world.setDateTime({ year: 2026, month: 7, day: 1, hour: 12, minute: 0, second: 0,});
revo.world.setTimeScale(30);revo.world.setWeather(WeatherType.ExtraSunny);revo.world.setWaves({ oceanAmplitude: 0.6, shoreAmplitude: 0.4 });Run this once during server-script initialization. The clock advances
automatically, so it does not need a timer that calls setTime() each second.
Date and time
Section titled “Date and time”| Method | Effect |
|---|---|
world.setDateTime({ year, month, day, hour, minute, second }) |
Sets the date and time together. |
world.setDate({ year, month, day }) |
Changes the date and keeps the current time of day. |
world.setTime({ hour, minute, second }) |
Changes the time of day and keeps the current date. |
world.setTimeScale(value) |
Changes how quickly the clock advances. |
Months run from 1 to 12. Days must exist in the selected month and year,
including leap years. Years range from 1 to 9999. Hours run from 0 to 23,
and minutes and seconds from 0 to 59. All date and time fields are required
integers.
The time scale is the number of game seconds per real second:
| Value | Clock behavior |
|---|---|
0 |
Frozen time. |
1 |
Real-time speed. |
30 |
One game minute every two real seconds, the default scale. A full day takes 48 real minutes. |
The scale accepts finite, nonnegative values. Changing it preserves the current date and time. It affects the world clock only, without changing physics or animation speed.
Any clock setter starts the shared clock if it is not already configured.
Its initial values are 1 January 2000 at midnight with a scale of 30.
Use setDateTime() when you need an explicit starting date and time.
Read world.dateTime, world.date, world.time and world.timeScale for the
current server values. Object getters return copies. Use the setters to apply
changes.
Weather
Section titled “Weather”world.setWeather(WeatherType.Rain) selects a fixed weather override. Other
values include ExtraSunny, Clear, Clouds, Foggy, Overcast and Thunder.
The method has no transition-duration argument. For a weather schedule, select
the next type from your server script at the desired time.
world.weather returns the selected type. Clearing it with
world.clearWeather() releases the override on clients.
world.setWaves() accepts both of these fields:
| Field | Range | Effect |
|---|---|---|
oceanAmplitude |
0 to 20 |
Ocean wave amplitude. |
shoreAmplitude |
0 to 40 |
Shoreline wave amplitude. |
These values control the water simulation’s amplitude. Wave timing is synchronized alongside the amplitudes. Updating the settings preserves the existing wave timeline.
Read world.waves for the current settings. world.clearWaves() releases the
wave override.
Validation and clearing settings
Section titled “Validation and clearing settings”Server setters return true when accepted and false when a value fails
validation, leaving the setting unchanged. For example,
setTime({ hour: 24, minute: 0, second: 0 }) returns false.
Incorrect argument types, missing fields, non-finite numbers and invalid weather
enum values throw a TypeError.
The getters return null for settings the server has not overridden.
world.clearDateTime() clears the date, time and time scale together.
Weather and wave overrides are cleared separately with clearWeather() and
clearWaves().
These settings belong to the server world. Keep their configuration in one place, since changes from different scripts affect the same state.
Local scenes
Section titled “Local scenes”Client scripts can temporarily disable individual parts of world synchronization:
| Client property | Controls |
|---|---|
world.timeSyncEnabled |
Application of server date and time. |
world.weatherSyncEnabled |
Application of server weather. |
world.waveSyncEnabled |
Application of server wave settings. |
All three start as true. Disabling one releases its server override on that
client. Server updates are still received, and re-enabling it applies the latest
state. The server clock continues to advance during a local scene.
This example holds a local scene at 22:00 with clear weather. It returns a function that clears the native overrides and restores the previous synchronization flags:
// @ts-check/// <reference types="@revomp/types-client" />/// <reference types="@revomp/types-natives" />import * as revo from 'revo-client';import * as natives from 'natives';
export function beginNightScene() { const previousTimeSync = revo.world.timeSyncEnabled; const previousWeatherSync = revo.world.weatherSyncEnabled;
revo.world.timeSyncEnabled = false; revo.world.weatherSyncEnabled = false;
natives.networkOverrideClockTime(22, 0, 0); natives.setOverrideWeather('CLEAR');
return () => { natives.networkClearClockTimeOverride(); natives.clearOverrideWeather();
revo.world.timeSyncEnabled = previousTimeSync; revo.world.weatherSyncEnabled = previousWeatherSync; };}Call the returned function when the scene closes, including cancellation. Coordinate local scenes through one controller because these flags affect the whole client. A dimension change does not create separate weather or clock state.
Flags changed by a client script are restored when that script stops. Native overrides created by the script still need their own cleanup.