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

Hud

const Hud: object

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

The game’s HUD: notifications, quest banners, subtitles, help text, fades and whether it shows.

fade(options?): void

Fades the screen, as Game.FadeOutGame does. Without hold the screen fades back in by itself. Starts next frame.

out: fade out (default) or back in from a held fade. white: to white rather than black. duration: seconds the fade takes (default 1). hold: stay faded until a fade with out: false. delay: seconds before it starts.

number

number

boolean

boolean

boolean

void

flashMeter(meter): boolean

Blinks the health or the action point bar, as the game blinks the action points when an attack needs more than are left. A bar the HUD is hiding blinks unseen: keep it up with setMeterShown first.

"health" | "actionPoints"

Which bar.

boolean

False when the game has no such actor value.

getActiveEffectIcons(): number[][]

The icons the HUD’s active effects widget shows: four arrays, one per effect category, each holding the indices of the icons lit.

number[][]

getAmmo(): { clip: number; reserve: number; } | null

What the HUD’s ammo counter shows: the rounds in the weapon and the rounds carried besides.

{ clip: number; reserve: number; } | null

Null while the HUD shows no counter: no gun in hand.

getEnemyHealth(): { healthPercent: number; hostile: boolean; legendary: boolean; name: string; secondaryPercent: number; skull: boolean; } | null

What the HUD’s enemy health bar shows for the actor the player is aiming at: its name, its health from 0 to 100, the bar’s second meter, and whether it is hostile, legendary or far above the player’s level.

{ healthPercent: number; hostile: boolean; legendary: boolean; name: string; secondaryPercent: number; skull: boolean; } | null

Null while the HUD shows no bar: nobody under the crosshair.

getExperienceMeter(): { amount: number; levelUp: boolean; percent: number; } | null

What the HUD’s experience meter last showed: the amount it printed, its fill, and whether it announced a level.

{ amount: number; levelUp: boolean; percent: number; } | null

Null until the meter has come up once.

getExplosiveIndicators(): object[]

The markers the HUD’s explosive indicator shows: for each grenade or mine near the player, whether it is a placed explosive, how far it is in game units and the angle to it in radians, where straight ahead reads about -pi/2.

object[]

Empty while the HUD shows none.

getHitIndicators(): object[]

The arcs the HUD’s hit indicator shows: for each recent hit, the angle to the attacker in radians, where an attacker straight ahead reads about -pi/2, and a strength that starts at 100 and fades.

object[]

Empty while the HUD shows none.

getQuickContainer(): { items: object[]; locked: boolean; name: string; ref: number; selected: number; } | null

What the HUD’s quick container lists for the container or corpse under the crosshair, which the activation prompt (getRollover) does not cover: the reference, its name, whether it is locked, the highlighted line (-1 for none) and the lines as the game shows them.

{ items: object[]; locked: boolean; name: string; ref: number; selected: number; } | null

Null while no quick container shows.

getRadiation(): { lethalShare: number | null; rads: number | null; sources: number | null; } | null

What the HUD’s radiation meter holds: the rads it displays, their share of a lethal dose, and how many radiation sources reach the player. Each is null until the game has set it.

{ lethalShare: number | null; rads: number | null; sources: number | null; } | null

Null before the HUD exists.

getRollover(): { activateEnabled: boolean; activateText: string; crime: boolean; legendary: boolean; name: string; secondaryText: string; taggedForSearch: boolean; } | null

What the HUD’s activation prompt shows for what the player looks at: its name, the label of the activate button and of the second button, whether activating is enabled, the legendary and tagged-for-search icons, and whether activating would be a crime.

{ activateEnabled: boolean; activateText: string; crime: boolean; legendary: boolean; name: string; secondaryText: string; taggedForSearch: boolean; } | null

Null while the HUD shows no prompt.

hasElement(path): boolean

Whether the HUD has a clip at that path, to find the one to hide.

string

A path as setElementVisible takes it.

boolean

hasMessages(): boolean

Whether the HUD still has corner messages to show or on screen, as its notification model was last told: a script can wait for the corner to clear before it shows its own.

boolean

hideHelp(): void

Removes the help box showHelp showed.

void

hideSubtitle(): void

Removes the subtitle showSubtitle showed.

void

isVisible(): boolean

Whether the HUD shows: open, and not hidden by setVisible(false).

boolean

notify(message, sound?): void

Shows a notification in the HUD’s message list, top left, as Debug.Notification does. One equal to a notification already queued is dropped.

string

The text; a localisation key ($…) is resolved.

string

A sound descriptor’s editor ID to play with it.

void

setElementVisible(path, visible): boolean

Hides or shows one part of the HUD, the rest staying as it is: a compass without markers, no health bar. Hidden as setVisible hides the whole HUD, so what it shows keeps working underneath; held until shown again or the player disconnects.

string

The clip’s path under the HUD’s root, as HUDMenu.swf names it: “BottomCenterGroup_mc” (the compass), “LeftMeters_mc” (health), “RightMeters_mc” (action points and ammo), “CenterGroup_mc” (crosshair and prompts), “TopCenterGroup_mc”, “TopRightGroup_mc”, “HUDNotificationsGroup_mc” and their children, dot-separated.

boolean

Whether it shows.

boolean

False when the HUD has no such clip right now; it is still held hidden for when it has.

setMeterShown(meter, shown): void

Keeps the health or the action point bar on the HUD. The game hides each while it is full and nothing touches it; this holds one up until it is let go.

"health" | "actionPoints"

Which bar.

boolean

Kept up, or left to the HUD again.

void

setMode(mode, on): boolean

Turns one of the HUD’s own modes on or off, as Game.SetInsideMemoryHUDMode and Game.SetCharGenHUDMode do for theirs: the HUD shows, hides and restyles its parts by the modes that are on. A mode a script turned on stays until it turns it off; the game switches its own as before.

string

The mode’s name as the game knows it: “PowerArmor”, “InsideMemory”, “DialogueMode”, “IronSights”, “VATS”, “WorkshopMode”, “CharGen_Init” and the like.

boolean

On or off.

boolean

False for an empty name. A name the HUD does not know changes nothing.

setVisible(visible): void

Shows or hides the whole HUD. The HUD stays open underneath, only unseen.

boolean

Whether the HUD shows.

void

showBanner(text, kind?): boolean

Shows the HUD’s quest banner with any text. Banners queue behind the game’s own. False when the quest that lends the icon is not loaded.

string

The banner’s text.

"completed" | "failed" | "started"

Which quest banner, header and sound included; “started” by default.

boolean

showHelp(text, seconds?): void

Shows the HUD’s help box with any text, replacing the last one. Shown only while the game’s tutorials are on.

string

The help text.

number

How long it shows; 5 by default, 0 until hideHelp.

void

showHitMarker(): void

Flashes the hit marker around the crosshair, as the game does when a sneak attack or a critical lands: the cue for a hit the server confirmed.

void

showLocation(name): boolean

Shows a place name on the HUD, as the game does on coming up to a location the player knows: a zone a script defines announces itself this way.

string

The name to show.

boolean

False for an empty name.

showObjective(text, kind?): boolean

Shows a quest objective line on the HUD with any text, alone or under a banner shown just before, with the game’s own sound and timing.

string

The line’s text, shown as given: the game’s own completed and failed lines open with “Completed: “ and “Failed: “.

"added" | "completed" | "failed"

A new objective, by default, or one drawn as done.

boolean

False when the quest that lends the objective is not loaded.

showSubtitle(text, seconds?): boolean

Shows a subtitle at the bottom centre under the local player’s name, replacing the last one. Shown only while the game’s general subtitles are on. False while there is no player.

string

The line.

number

How long it shows; 4 by default, 0 until hideSubtitle.

boolean

showVaultBoy(swf, sound?): boolean

Plays a Vault Boy clip on the HUD, the animation a perk shows when it triggers, as Game.ShowPerkVaultBoyOnHUD does.

string

The clip’s path under Interface, such as “Components/VaultBoys/Perks/PerkClip_1d247c.swf”.

string

A sound descriptor’s editor ID to play with it, such as “UIPerkRicochet”.

boolean

False when the path is empty or the sound is not one the game knows; the clip still plays without it.