openOMSI GitHub Discord
Modding overview

Docs / Making content / Modding overview

Radio

2 min readEdit this pagedocs/MODDING.md

On this page
  1. Map radio stations
  2. Frequencies
  3. Bus radio display

What the player sees and hears is on the Radio page. This section covers what a map or a bus can add. Omsi.exe reads none of it.

Map radio stations#

Put a radio.cfg beside the map's global.cfg, written like the player's: one name = address per line.

  • The map's stations come first on the station buttons while the map is driven. The player's stations follow. A player station with the same address as a map station is left out.
  • The file's volume line is ignored: loudness stays the player's choice.
  • The file is read again when another map is loaded.

Frequencies#

After the address, list the frequencies a station is on, for radios that show one:

# name = address | frequency @ x, y | ...
Radiozurnal = https://rozhlas.stream/radiozurnal.mp3 | 94.6 @ 25500, 20000 | 90.9 @ 2307, -717
Regional    = https://example.org/regional.mp3 | 97.9
  • | 94.6 is the frequency everywhere. | 94.6 @ x, y is the frequency near that place.
  • A station may list as many places as it has transmitters along the route.
  • The place nearest to the bus decides the shown frequency. There is no blending, so one place per town is enough.
  • x, y are game metres: the tile's column and row times 300 m, plus the position in the tile.

To find coordinates, look in the log when a bus is placed: spawned at entry point 38 "Chlum,hl.sil." (12810.6, 3735.5, 60.3). Or take an entry point's numbers from global.cfg ([entrypoints]: the position in the tile, then the tile's index into [map]). These are map positions, not coordinates on the globe.

Bus radio display#

A radio script that shows the station and song declares the string variable Snd_Radio_Text (in a [stringvarnamelist] file of the bus) and shows it in a text texture. openOMSI writes the text there while the radio plays: ten characters, with longer text scrolling.

The radio itself reacts to the variables of OMSI's radio plugins:

Variable Meaning
Snd_Radio 1 while a cassette or the radio plays (the first station)
SndExt_Radio The station button, 0 = off
SndVol_Radio Volume, 0 to 1, up to 2

Dmitrij's "Magnitola" works as it is. While it shows its track, its magnitola_1 variable (frequency@station, @ being the line break) gets the map's frequency for the current place in its first line and the station and song in its second.

Something wrong or missing? Fix it on GitHub or open an issue.

↑↓ to move↵ to open