Skip to content
FMFallout Multiplayer Scripting APIScripting guides and API
Global objectServer APIGenerated

World

const World: 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.

readonly date: WorldDate

The calendar date every client’s game shows. It turns over at midnight as the clock runs.

readonly daysPassed: number

Whole days the clock has run, the game’s GameDaysPassed: what its timers, vendors’ restocks and crops count in.

readonly hour: 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.

readonly lightningEnabled: 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.

readonly previousWeather: 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.

readonly timeScale: number

Game minutes per real minute. 20 is the game’s own pace; 0 holds the clock.

readonly weather: number

The TESWeather form ID every client shows.

readonly weatherForced: boolean

Whether the weather was swapped in at once rather than transitioned to.

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.

string | number

A TESWorldSpace form ID.

Climate | null

Null when the worldspace has none, or the form is not one.

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.

string | number

A TESRegion form ID, as Player.getWeatherRegion gives it.

Climate | null

Null when the region has no weathers, or the form is not one.

getWeathers(): WeatherRecord[]

Every weather the game’s official masters define, by form ID.

WeatherRecord[]

Empty when the server could not read the game’s data files.

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.

string | number

A location (LCTN) form ID, as a number or hex string: “0x1D5F3”. Its child locations are reset with it.

number

How many of the server’s NPCs came back. Throws for a form that is not a location.

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.

number

The full year, 2000 to 2999.

number

1 to 12.

number

1 to the month’s last; the calendar has no leap years.

void

setDaysPassed(days): void

Sets how many days the clock has run, which the game’s timers count in. The date stays as it is.

number

Whole days, 0 or more.

void

setHour(hour): void

Sets the clock. Every client jumps to it. The date stays as it is.

number

The hour, wrapped into 0-24; 13.5 is half past one.

void

setLightningEnabled(enabled): void

Starts or stops the server’s own lightning.

boolean

On, or off: no lightning but what scripts strike.

void

setTimeScale(scale): void

Sets how fast the clock runs.

number

Game minutes per real minute, 0 or more; 0 holds the clock.

void

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.

string | number | null

A TESWeather form ID, as a number or hex string; null for the server’s default, CommonwealthClear.

boolean

Swap it in at once rather than transition to it.

void

strikeLightning(weather?): void

Strikes lightning in every player’s sky that thunders: a flash and a thunderclap, at the same moment for all.

string | number

Only for skies in this weather; any weather that thunders when left out.

void