World
constWorld:object
Defined in: server/api.d.ts:1538
The server’s clock, calendar and weather, which every client follows, and what the game’s data files say of weathers and climates.
Type Declaration
Section titled “Type Declaration”
readonlydate:WorldDate
The calendar date every client’s game shows. It turns over at midnight as the clock runs.
daysPassed
Section titled “daysPassed”
readonlydaysPassed:number
Whole days the clock has run, the game’s GameDaysPassed: what its timers, vendors’ restocks and crops count in.
readonlyhour:number
The hour of the day, from 0 up to but not including 24, with the minutes as the fraction: 13.5 is half past one.
lightningEnabled
Section titled “lightningEnabled”
readonlylightningEnabled:boolean
Whether the server strikes lightning on its own while weather thunders, at the pace the game would. In a session the game strikes only on the server’s word, so every player sees the same strikes.
previousWeather
Section titled “previousWeather”
readonlypreviousWeather:number
The weather the sky is still moving away from, 0 once the move is over: up to two game hours after setWeather, past the game’s longest transition.
timeScale
Section titled “timeScale”
readonlytimeScale:number
Game minutes per real minute. 20 is the game’s own pace; 0 holds the clock.
weather
Section titled “weather”
readonlyweather:number
The TESWeather form ID every client shows.
weatherForced
Section titled “weatherForced”
readonlyweatherForced:boolean
Whether the weather was swapped in at once rather than transitioned to.
getClimate()
Section titled “getClimate()”getClimate(
worldSpace):Climate|null
The climate a worldspace’s sky rolls its weathers from, as the data files give it: the base a script rolls its own weather cycle on.
Parameters
Section titled “Parameters”worldSpace
Section titled “worldSpace”string | number
A TESWorldSpace form ID.
Returns
Section titled “Returns”Climate | null
Null when the worldspace has none, or the form is not one.
getRegionWeathers()
Section titled “getRegionWeathers()”getRegionWeathers(
region):Climate|null
The weathers a region rolls, as the data files give it: the game takes them over the worldspace’s climate while the player stands in the region.
Parameters
Section titled “Parameters”region
Section titled “region”string | number
A TESRegion form ID, as Player.getWeatherRegion gives it.
Returns
Section titled “Returns”Climate | null
Null when the region has no weathers, or the form is not one.
getWeathers()
Section titled “getWeathers()”getWeathers():
WeatherRecord[]
Every weather the game’s official masters define, by form ID.
Returns
Section titled “Returns”Empty when the server could not read the game’s data files.
resetLocation()
Section titled “resetLocation()”resetLocation(
location):number
Resets an area as the game’s own respawn does after its days have passed, as Papyrus Location.Reset and FiveM scripts that repopulate a zone do: every dead NPC the data files place there is back, whole, at its placement (npcRespawn for each), and every player’s game marks the location not cleared and refills its containers, loot and encounters when it next loads them. A raider camp, a dungeon, a town: cleared places fill up again.
Parameters
Section titled “Parameters”location
Section titled “location”string | number
A location (LCTN) form ID, as a number or hex string: “0x1D5F3”. Its child locations are reset with it.
Returns
Section titled “Returns”number
How many of the server’s NPCs came back. Throws for a form that is not a location.
setDate()
Section titled “setDate()”setDate(
year,month,day):void
Sets the calendar date every client’s Pip-Boy shows. The hour and the day count stay as they are.
Parameters
Section titled “Parameters”number
The full year, 2000 to 2999.
number
1 to 12.
number
1 to the month’s last; the calendar has no leap years.
Returns
Section titled “Returns”void
setDaysPassed()
Section titled “setDaysPassed()”setDaysPassed(
days):void
Sets how many days the clock has run, which the game’s timers count in. The date stays as it is.
Parameters
Section titled “Parameters”number
Whole days, 0 or more.
Returns
Section titled “Returns”void
setHour()
Section titled “setHour()”setHour(
hour):void
Sets the clock. Every client jumps to it. The date stays as it is.
Parameters
Section titled “Parameters”number
The hour, wrapped into 0-24; 13.5 is half past one.
Returns
Section titled “Returns”void
setLightningEnabled()
Section titled “setLightningEnabled()”setLightningEnabled(
enabled):void
Starts or stops the server’s own lightning.
Parameters
Section titled “Parameters”enabled
Section titled “enabled”boolean
On, or off: no lightning but what scripts strike.
Returns
Section titled “Returns”void
setTimeScale()
Section titled “setTimeScale()”setTimeScale(
scale):void
Sets how fast the clock runs.
Parameters
Section titled “Parameters”number
Game minutes per real minute, 0 or more; 0 holds the clock.
Returns
Section titled “Returns”void
setWeather()
Section titled “setWeather()”setWeather(
weather,force?):void
Sets the weather every client shows. A transition runs on the game clock, so every client fades at the same point, one that joins during it included. Only a client’s data files can tell whether the form is a weather, so a wrong one leaves the sky as it is.
Parameters
Section titled “Parameters”weather
Section titled “weather”string | number | null
A TESWeather form ID, as a number or hex string; null for the server’s default, CommonwealthClear.
force?
Section titled “force?”boolean
Swap it in at once rather than transition to it.
Returns
Section titled “Returns”void
strikeLightning()
Section titled “strikeLightning()”strikeLightning(
weather?):void
Strikes lightning in every player’s sky that thunders: a flash and a thunderclap, at the same moment for all.
Parameters
Section titled “Parameters”weather?
Section titled “weather?”string | number
Only for skies in this weather; any weather that thunders when left out.
Returns
Section titled “Returns”void