RadioXL

RadioXL

Your own radio stations in Night City, on the games own mixer. Bring your own music. (☞ ゚ヮ゚)☞ ♪

[color=#e06666][size=6][b]- Introduction -[/b][/size][/color]

By request RadioXL, built on AudioXL, is here to add new radio stations through the games own sound engine. Added radios show up just as the normal ones in the Radioport and in a vehicle.

In the settings you can select for what occasions the sound should go quiet: scenes, combat and so on. These settings only affect the added stations - not vanilla stations. I also do not add stations to radios placed in the game world on this release; doing so presents a number of issues I don't want to tackle right now.

[i]TL;DR - your music, in the radio list, on the game's own mixer. (ノ◕ヮ◕)ノ[/i]


[color=#e06666][size=6][b]- For Players -[/b][/size][/color]

RadioXL is just a framework. Install a station built on it, or build one yourself in about five minutes - the next section is how, and there is a ready-made template in the optional downloads.

Stations show up in the radio list at their own frequency, in a car and on the radioport alike: pick one, and the dashboard readout, the equaliser and the radio hotkey all treat it as a station.

[b]Requirements[/b]
[list]
[][url=https://www.nexusmods.com/cyberpunk2077/mods/2380]RED4ext[/url][/]
[][url=https://www.nexusmods.com/cyberpunk2077/mods/1511]redscript[/url][/]
[][url=https://www.nexusmods.com/cyberpunk2077/mods/7780]Codeware[/url][/]
[][url=https://www.nexusmods.com/cyberpunk2077/mods/4197]TweakXL[/url][/]
[][url=https://www.nexusmods.com/cyberpunk2077/mods/33442]AudioXL[/url][/]
[][url=https://www.nexusmods.com/cyberpunk2077/mods/30726]Redscript Configuration Framework[/url][/]
[]Game version 2.31.[/]
[/list]Optional:
[list]
[][url=https://www.nexusmods.com/cyberpunk2077/mods/31920]RedLogger[/url] - optional for logging via debug.[/]
[/list]

[color=#e06666][size=6][b]- Adding a station -[/b][/size][/color]

A station is a name, a record, one line of script, and some songs. Try to pick a unique name, that's the only collision point for multiple radios.

[b]Start from the template.[/b] [i]RadioXL Example Station[/i] in the optional downloads is all three files, filled in and commented. Drop it in, put three .wav files in its sounds folder, and you have a working station; rename [b]example_station[/b] in the three places its comments point at and you have your own. The rest of this section is what those files are doing.

[b]1. Your .yaml[/b] in
[code]r6\tweaks\[/code]Do not edit RadioXL's own file - an update overwrites it.
[quote][code]RadioStation.petzman_rammstein:
  $type: gamedataRadioStation_Record
  displayName: "104.3 Rammstein FM"
  icon: UIIcon.RadioXL
  index: 90[/code][/quote]
[b]displayName[/b] starts with the frequency, and the list is sorted by it, so 104.3 lands between 103.5 Radio PEBKAC and 106.9 30 PRINCIPALES. Pick one the game does not already use: taken are 88.9, 89.3, 89.7, 91.9, 92.9, 95.2, 96.1, 98.7, 99.9, 101.9, 103.5, 106.9, 107.3 and 107.5.

[b]icon[/b] can be any UIIcon record. [b]UIIcon.RadioXL[/b] is included; the vanilla station icons work too ([b]UIIcon.RadioMetal[/b], [b]UIIcon.RadioJazz[/b], [b]UIIcon.RadioDarkStar[/b] and the rest). For your own, ship an archive with an .inkatlas and add a UIIcon record pointing at it.

[b]index[/b] is 90 for every RadioXL station and you should not change it.

[b]2. One line of script[/b], to tell RadioXL your station exists.
[quote][code]module MyRadio

@if(ModuleExists("RadioXL"))
import RadioXL.*

@if(ModuleExists("RadioXL"))
public class MyRadioInit extends ScriptableService {
  private cb func OnLoad() {
    RadioXLAPI.RegisterStation("petzman_rammstein");
  }
}[/code][/quote]The name is your station's identity, and it has to match the record: register [b]petzman_rammstein[/b] and RadioXL looks for [b]RadioStation.petzman_rammstein[/b]. The [b]@if[/b] means your mod does nothing when RadioXL is not installed.

[b]3. Your songs[/b] in their own folder under
[code]red4ext\plugins\AudioXL\sounds\[/code]The folder can be called anything, but the file inside must be called [b]sounds.json[/b] - that is what AudioXL looks for.
[quote][code]{
  "sounds": [
    { "name": "petzman_rammstein_01", "type": "axl_radio_2d", "file": "song1.wav", "stream": true,
      "subtitle": "Rammstein - Du hast" },
    { "name": "petzman_rammstein_02", "type": "axl_radio_2d", "file": "song2.wav", "stream": true,
      "subtitle": "Rammstein - Sonne" }
  ]
}[/code][/quote]Rows are [b]<your name>_<NN>[/b], numbered from 01 with no gaps - the playlist stops looking at the first missing number, so 01, 02, 04 gives you a two track station. [b]subtitle[/b] is the title shown on the radio panel.

A station with no rows is skipped. If the configuration points at missing audio files it will also skip the station.

[b]Use WAV, with[/b]
[code]"stream": true[/code]mp3, ogg and flac work but are decoded into memory at load - roughly 44 MB for a four minute track - while a streamed WAV is memory-mapped and costs almost nothing until it plays.


[color=#e06666][size=6][b]- Settings -[/b][/size][/color]

Three tabs in the Redscript Configuration Framework panel.

[b]Station[/b]
[list]
[][b]Enable RadioXL[/b] - turn the whole mod off.[/]
[][b]Where the car radio plays from[/b] - 0 plays it in your ears the way the vanilla stations do. 1 play it out of the car itself, so it fades as you walk away and stops when the car despawns. Only tracks started while you are in the car are affected, and no vanilla station behaves this way, so 0 is the default. 2 can be used to boost audio of a channel, but only in a vehicle and only for RadioXL channels.[/]
[][b]Stop when leaving a vehicle[/b] - on, it stops like a car radio. Off, it follows you like a pocket radio.[/]
[][b]Use the Radioport slider when on foot[/b] - follow the Radioport volume rather than the Vehicle Radio one when you are out of the car.[/]
[/list]
[b]Mute radio when...[/b]
Fourteen switches, all on by default. These switches determine which situations will temporarily mute the RadioXL radio - so these separate from the games own stations. Toggling something here does not affect the games own stations.

[b]Debug[/b]
[b]Write a discovery log[/b] lists which stations were found and why any were skipped. It needs RedLogger and writes to
[code]r6\logs\mods\[/code]Leave it off unless a station is not appearing.


[color=#e06666][size=6][b]- A station is not showing up -[/b][/size][/color]

Turn on the Debug toggle above, restart, and read the log. A station has to clear two checks, and the log names whichever one it failed.

[list]
[][b]no record RadioStation.<name>[/b] - the name you registered in script does not match the record id in your .yaml. Check for a typo, and check TweakXL loaded the file at all.[/]
[][b]no audio rows named <name>_01[/b] - AudioXL did not register your songs under that prefix. The row names in sounds.json have to start with the same name, numbered from 01. AudioXL's own log says how many rows it found.[/]
[/list]
If a station appears but sorts oddly against another one, check the frequency in [b]displayName[/b]: two stations on the same number have no defined order between them.


[color=#e06666][size=6][b]- Known Limits -[/b][/size][/color]
[list]
[]Playlists run in order. No shuffle etc. Maybe next version.[/]
[]Station names and song titles are plain text, not localised.[/]
[]Resuming after the radio hotkey restarts the current track, because the audio registry currently has no seek.[/]
[]The positioned modes (1 and 2) only apply to a track started while you are in the car.[/]
[/list]

[color=#e06666][size=6][b]- Updates -[/b][/size][/color]

[i][u]0.1.0[/u][/i] - First release.


[color=#e06666][size=6][b]- Credits -[/b][/size][/color]

All my fantastic mod users who asked me to build this! I probably wouldn't have otherwise. :)

[url=https://www.nexusmods.com/cyberpunk2077/mods/32248]Audioware Radio Framework[/url] which had solved several issues I too found, without which it would have taken much longer to get this done.

[url=https://www.nexusmods.com/cyberpunk2077/mods/4591]RadioExt[/url] for getting there first and showing that people want their own stations.

[url=https://www.nexusmods.com/profile/psiberx]psiberx[/url] for [url=https://www.nexusmods.com/cyberpunk2077/mods/7780]Codeware[/url] and [url=https://www.nexusmods.com/cyberpunk2077/mods/4197]TweakXL[/url], without which none of this suite exists.

Thank you to all the wonderful mod authors who continue to create content for us all to enjoy for free!

[center][size=2]Part of the DigitalVixen mod suite.[/size][/center]
[center][size=2]You can now find me on Discord [url=https://discord.gg/TRuuDSrGWJ]here![/url][/size][/center]