RadioStation
Defined in: server/api.d.ts:2194
A radio station every player’s game carries. It joins each Pip-Boy’s station list once heard and plays through world radios tuned to it, everywhere in the world. The server says what is on air and since when, so every player hears the same moment of the same track. A station outlives the resource that created it until destroyed.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RadioStation(
id):RadioStation
Defined in: server/api.d.ts:2199
Wraps the station with this ID; it creates nothing.
Parameters
Section titled “Parameters”number
Network entity identifier.
Returns
Section titled “Returns”RadioStation
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”destroy()
Section titled “destroy()”destroy():
boolean
Defined in: server/api.d.ts:2241
Takes the station off every player’s radio.
Returns
Section titled “Returns”boolean
False once the station is gone.
play()
Section titled “play()”play(
sound,durationMs?):boolean
Defined in: server/api.d.ts:2255
Puts a track on air from now, replacing what played. Only a player’s data files can tell whether the form is a sound descriptor, so a wrong one stays silent. No event marks the end of a track: the script schedules the next one itself, from the duration it knows.
Parameters
Section titled “Parameters”string | number
A BGSSoundDescriptorForm form ID, as a number or hex string.
durationMs?
Section titled “durationMs?”number
How long it runs. With it, a player tuning in until then still hears it; without it, a player’s radio drops it once it has played out.
Returns
Section titled “Returns”boolean
False once the station is gone.
playStream()
Section titled “playStream()”playStream(
url,durationMs?):boolean
Defined in: server/api.d.ts:2263
Puts an audio stream on air from now, replacing what played: a server-hosted file, a playlist entry, a live DJ. Each player’s game fetches it and plays it while their Pip-Boy radio is on and tuned to this station, at the position every other listener hears (a live stream plays from its live edge). World radios tuned to the station stay silent: only the Pip-Boy plays streams.
Parameters
Section titled “Parameters”string
An http or https URL of an audio file (mp3, aac, wav, wma) or a live stream.
durationMs?
Section titled “durationMs?”number
How long it runs, as for play. Leave it out for a live stream.
Returns
Section titled “Returns”boolean
False once the station is gone, or for a URL that is not http or https.
setVirtualWorld()
Section titled “setVirtualWorld()”setVirtualWorld(
world):void
Defined in: server/api.d.ts:4292
Moves this entity into another virtual world.
Parameters
Section titled “Parameters”number
Virtual-world identifier used to partition replication and visibility.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”setVisibleTo()
Section titled “setVisibleTo()”setVisibleTo(
player):void
Defined in: server/api.d.ts:4298
Restricts replication of this entity to one owning connection while preserving normal range and visibility checks.
Parameters
Section titled “Parameters”player
Section titled “player”Entity | null
Player-owned entity whose connection should exclusively receive this entity, or null to clear the restriction.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”stop()
Section titled “stop()”stop():
boolean
Defined in: server/api.d.ts:2235
Takes the track off air: every player’s radio falls silent on this station.
Returns
Section titled “Returns”boolean
False once the station is gone.
toString()
Section titled “toString()”toString():
string
Defined in: server/api.d.ts:2247
Formats this handle for logging.
Returns
Section titled “Returns”string
The station’s network ID, name and frequency.
Inherited from
Section titled “Inherited from”
staticall():RadioStation[]
Defined in: server/api.d.ts:2289
Every station.
Returns
Section titled “Returns”RadioStation[]
One handle per station.
areVanillaStationsEnabled()
Section titled “areVanillaStationsEnabled()”
staticareVanillaStationsEnabled():boolean
Defined in: server/api.d.ts:2283
Whether the game’s own stations are on the radio.
Returns
Section titled “Returns”boolean
True unless a script turned them off.
create()
Section titled “create()”
staticcreate(name,frequency):RadioStation|null
Defined in: server/api.d.ts:2271
Creates a silent station on every player’s radio.
Parameters
Section titled “Parameters”string
What the Pip-Boy lists it as, up to 64 characters.
frequency
Section titled “frequency”number
What it transmits on, 80 to 110, the Pip-Boy’s dial; no other station may hold it. A game station on the same frequency plays over it unless the game’s stations are off.
Returns
Section titled “Returns”RadioStation | null
The station, or null when the name or frequency was refused.
setVanillaStationsEnabled()
Section titled “setVanillaStationsEnabled()”
staticsetVanillaStationsEnabled(enabled):void
Defined in: server/api.d.ts:2277
Puts the game’s own stations (Diamond City Radio, Classical Radio, and the quest signals and distress beacons too) on or off every player’s radio. Each player’s game runs them alone, so no two players hear the same thing on them. Off, they leave the Pip-Boy’s list and every world radio, and the scenes behind them play out in person instead. A player joining later follows the setting.
Parameters
Section titled “Parameters”enabled
Section titled “enabled”boolean
False takes them off; true puts them back.
Returns
Section titled “Returns”void
Properties
Section titled “Properties”duration
Section titled “duration”
readonlyduration:number
Defined in: server/api.d.ts:2224
How long the track on air runs, in milliseconds, as given to play; 0 when not given.
elapsed
Section titled “elapsed”
readonlyelapsed:number
Defined in: server/api.d.ts:2229
How long the track on air has run, in milliseconds; 0 while it is silent.
frequency
Section titled “frequency”
readonlyfrequency:number
Defined in: server/api.d.ts:2209
The frequency it transmits on; 0 once it is gone.
readonlyid:number
Defined in: server/api.d.ts:4260
Immutable network entity identifier.
Inherited from
Section titled “Inherited from”
readonlyname:string
Defined in: server/api.d.ts:2204
What the Pip-Boy lists it as; empty once it is gone.
position
Section titled “position”position:
Vector3
Defined in: server/api.d.ts:4270
Authoritative world-space position; assignment forces replicated state.
Inherited from
Section titled “Inherited from”rotation
Section titled “rotation”rotation:
Vector3|Quaternion
Defined in: server/api.d.ts:4275
Authoritative rotation; reads return a quaternion and assignments accept a quaternion or Euler angles in degrees.
Inherited from
Section titled “Inherited from”
readonlysound:number
Defined in: server/api.d.ts:2214
The BGSSoundDescriptorForm form ID on air; 0 while it is silent or plays a stream.
readonlystate:StateBag
Defined in: server/api.d.ts:4280
Arbitrary key/value state carried by this entity. The server writes it and every client that can see the entity receives it; see StateBag.
Inherited from
Section titled “Inherited from”stream
Section titled “stream”
readonlystream:string
Defined in: server/api.d.ts:2219
The URL playStream put on air; empty while none is.
virtualWorld
Section titled “virtualWorld”
readonlyvirtualWorld:number
Defined in: server/api.d.ts:4265
Current virtual-world identifier.