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

World

const World: object

Defined in: client/api.d.ts:1479

The server’s clock, calendar and sky, as this client holds them, and what the sky is doing right now. Read-only: the server’s World, Player.setWeather and Player.setHour set them.

getDate(): { day: number; month: number; year: number; } | null

The calendar date the server keeps: the full year, the month 1 to 12, the day of the month.

{ day: number; month: number; year: number; } | null

Null before the server’s world streams in.

getDaysPassed(): number | null

Whole days the server’s clock has run, the game’s GameDaysPassed.

number | null

Null before the server’s world streams in.

getHour(): number | null

The game hour the server keeps, 0 to 24; the player’s own while a script holds their clock.

number | null

Null before the server’s world streams in.

getSky(): { daysPassed: number; full: boolean; hour: number; outgoing: number | null; override: number | null; region: number | null; transition: number; weather: number | null; } | null

What the game’s sky and clock show right now: the weather it is in or fading to, the one it fades from (null once the fade is done), the override it is held to, how far the fade is from 0 to 1, the game’s own hour and day count, whether the whole sky is drawn (outdoors; indoors there is none to fade), and the region whose weathers the sky would roll where the player stands.

{ daysPassed: number; full: boolean; hour: number; outgoing: number | null; override: number | null; region: number | null; transition: number; weather: number | null; } | null

Null before the game’s data files are loaded.

getTimeScale(): number | null

Game minutes per real minute; 0 holds the clock, as it is while a script holds the player’s own hour.

number | null

Null before the server’s world streams in.

getWeather(): number | null

The TESWeather form ID the server holds the sky to: the player’s own while a script gave them one, else the World’s.

number | null

Null while the region decides the weather, and before the server’s world streams in.

getWeatherInfo(weather?): { fog: { dayFar: number; dayMax: number; dayNear: number; dayPower: number; nightFar: number; nightMax: number; nightNear: number; nightPower: number; }; kind: "none" | "pleasant" | "cloudy" | "rain" | "snow"; precipitation: number | null; visualEffect: number | null; weather: number; windSpeed: number; } | null

What a weather is, from this game’s data: its kind, its wind from 0 to 1, where its fog starts and ends by day and by night in game units, and the precipitation and screen effect it comes with.

string | number

A weather (WTHR) by form ID; the one the sky is in or moving to when left out.

{ fog: { dayFar: number; dayMax: number; dayNear: number; dayPower: number; nightFar: number; nightMax: number; nightNear: number; nightPower: number; }; kind: "none" | "pleasant" | "cloudy" | "rain" | "snow"; precipitation: number | null; visualEffect: number | null; weather: number; windSpeed: number; } | null

Null when the form is not a weather, or the sky has none yet.

getWind(): { angle: number; angleRange: number; direction: number; speed: number; } | null

The wind the sky is blowing right now: its speed from 0 to 1, the weather’s direction in degrees and how many degrees it may swing either side, and the direction the sky drew within that swing, in degrees: the same on every player’s sky in a session.

{ angle: number; angleRange: number; direction: number; speed: number; } | null

Null before the sky exists.

raycast(from, to, options?): { entity: number | null; fraction: number; hit: boolean; normal: Vector3; position: Vector3; ref: number | null; } | null

Casts a ray through the physics world the player stands in and tells what it struck first, testing what a bullet’s impact would: the ground, buildings, props, clutter and the bodies of actors, passing over the player’s own unless the options say otherwise.

Vector3

Where the ray starts, in game units.

Vector3

Where it ends.

ignore: an actor (form ID in this game, as References.getEntityBody gives one) whose own body the ray passes over; the local player when left out, nobody for null.

number | string | null

{ entity: number | null; fraction: number; hit: boolean; normal: Vector3; position: Vector3; ref: number | null; } | null

Whether it struck something before to; where; the surface’s unit normal there; how far along the ray, 0 to 1; the reference hit (null for the landscape); and, when that is another player’s body or an NPC, its network ID as the server knows it (player.id, npc.id). Without a hit the position is to, the fraction 1 and the normal zero. Null before the player is in a cell.