Hud
constHud:object
Defined in: client/api.d.ts:270
The game’s HUD: notifications, quest banners, subtitles, help text, fades and whether it shows.
Type Declaration
Section titled “Type Declaration”fade()
Section titled “fade()”fade(
options?):void
Fades the screen, as Game.FadeOutGame does. Without hold the screen fades back in by itself. Starts next frame.
Parameters
Section titled “Parameters”options?
Section titled “options?”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.
delay?
Section titled “delay?”number
duration?
Section titled “duration?”number
boolean
boolean
white?
Section titled “white?”boolean
Returns
Section titled “Returns”void
flashMeter()
Section titled “flashMeter()”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.
Parameters
Section titled “Parameters”"health" | "actionPoints"
Which bar.
Returns
Section titled “Returns”boolean
False when the game has no such actor value.
getActiveEffectIcons()
Section titled “getActiveEffectIcons()”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.
Returns
Section titled “Returns”number[][]
getAmmo()
Section titled “getAmmo()”getAmmo(): {
clip:number;reserve:number; } |null
What the HUD’s ammo counter shows: the rounds in the weapon and the rounds carried besides.
Returns
Section titled “Returns”{ clip: number; reserve: number; } | null
Null while the HUD shows no counter: no gun in hand.
getEnemyHealth()
Section titled “getEnemyHealth()”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.
Returns
Section titled “Returns”{ 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()
Section titled “getExperienceMeter()”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.
Returns
Section titled “Returns”{ amount: number; levelUp: boolean; percent: number; } | null
Null until the meter has come up once.
getExplosiveIndicators()
Section titled “getExplosiveIndicators()”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.
Returns
Section titled “Returns”object[]
Empty while the HUD shows none.
getHitIndicators()
Section titled “getHitIndicators()”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.
Returns
Section titled “Returns”object[]
Empty while the HUD shows none.
getQuickContainer()
Section titled “getQuickContainer()”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.
Returns
Section titled “Returns”{ items: object[]; locked: boolean; name: string; ref: number; selected: number; } | null
Null while no quick container shows.
getRadiation()
Section titled “getRadiation()”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.
Returns
Section titled “Returns”{ lethalShare: number | null; rads: number | null; sources: number | null; } | null
Null before the HUD exists.
getRollover()
Section titled “getRollover()”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.
Returns
Section titled “Returns”{ activateEnabled: boolean; activateText: string; crime: boolean; legendary: boolean; name: string; secondaryText: string; taggedForSearch: boolean; } | null
Null while the HUD shows no prompt.
hasElement()
Section titled “hasElement()”hasElement(
path):boolean
Whether the HUD has a clip at that path, to find the one to hide.
Parameters
Section titled “Parameters”string
A path as setElementVisible takes it.
Returns
Section titled “Returns”boolean
hasMessages()
Section titled “hasMessages()”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.
Returns
Section titled “Returns”boolean
hideHelp()
Section titled “hideHelp()”hideHelp():
void
Removes the help box showHelp showed.
Returns
Section titled “Returns”void
hideSubtitle()
Section titled “hideSubtitle()”hideSubtitle():
void
Removes the subtitle showSubtitle showed.
Returns
Section titled “Returns”void
isVisible()
Section titled “isVisible()”isVisible():
boolean
Whether the HUD shows: open, and not hidden by setVisible(false).
Returns
Section titled “Returns”boolean
notify()
Section titled “notify()”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.
Parameters
Section titled “Parameters”message
Section titled “message”string
The text; a localisation key ($…) is resolved.
sound?
Section titled “sound?”string
A sound descriptor’s editor ID to play with it.
Returns
Section titled “Returns”void
setElementVisible()
Section titled “setElementVisible()”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.
Parameters
Section titled “Parameters”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.
visible
Section titled “visible”boolean
Whether it shows.
Returns
Section titled “Returns”boolean
False when the HUD has no such clip right now; it is still held hidden for when it has.
setMeterShown()
Section titled “setMeterShown()”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.
Parameters
Section titled “Parameters”"health" | "actionPoints"
Which bar.
boolean
Kept up, or left to the HUD again.
Returns
Section titled “Returns”void
setMode()
Section titled “setMode()”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.
Parameters
Section titled “Parameters”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.
Returns
Section titled “Returns”boolean
False for an empty name. A name the HUD does not know changes nothing.
setVisible()
Section titled “setVisible()”setVisible(
visible):void
Shows or hides the whole HUD. The HUD stays open underneath, only unseen.
Parameters
Section titled “Parameters”visible
Section titled “visible”boolean
Whether the HUD shows.
Returns
Section titled “Returns”void
showBanner()
Section titled “showBanner()”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.
Parameters
Section titled “Parameters”string
The banner’s text.
"completed" | "failed" | "started"
Which quest banner, header and sound included; “started” by default.
Returns
Section titled “Returns”boolean
showHelp()
Section titled “showHelp()”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.
Parameters
Section titled “Parameters”string
The help text.
seconds?
Section titled “seconds?”number
How long it shows; 5 by default, 0 until hideHelp.
Returns
Section titled “Returns”void
showHitMarker()
Section titled “showHitMarker()”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.
Returns
Section titled “Returns”void
showLocation()
Section titled “showLocation()”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.
Parameters
Section titled “Parameters”string
The name to show.
Returns
Section titled “Returns”boolean
False for an empty name.
showObjective()
Section titled “showObjective()”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.
Parameters
Section titled “Parameters”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.
Returns
Section titled “Returns”boolean
False when the quest that lends the objective is not loaded.
showSubtitle()
Section titled “showSubtitle()”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.
Parameters
Section titled “Parameters”string
The line.
seconds?
Section titled “seconds?”number
How long it shows; 4 by default, 0 until hideSubtitle.
Returns
Section titled “Returns”boolean
showVaultBoy()
Section titled “showVaultBoy()”showVaultBoy(
swf,sound?):boolean
Plays a Vault Boy clip on the HUD, the animation a perk shows when it triggers, as Game.ShowPerkVaultBoyOnHUD does.
Parameters
Section titled “Parameters”string
The clip’s path under Interface, such as “Components/VaultBoys/Perks/PerkClip_1d247c.swf”.
sound?
Section titled “sound?”string
A sound descriptor’s editor ID to play with it, such as “UIPerkRicochet”.
Returns
Section titled “Returns”boolean
False when the path is empty or the sound is not one the game knows; the clip still plays without it.