Project Zomboid

Project Zomboid

Roadtrip Radio
 This topic has been pinned, so it's probably important
Braven  [developer] 12 May, 2024 @ 1:28pm
Framework for Modders
Hey there, Superstar! Here's a step-by-step guide on how to add custom radio frequencies that play music to Project Zomboid using the provided framework:

Understand the Framework:
Before you start adding custom radio frequencies, familiarize yourself with the provided framework. The framework consists of two main functions:

BB_RoadTripRadio_Utils.AddRadio
This function adds a custom radio frequency to the game.

BB_RoadTripRadio_Utils.ConvertListsToSongCollection
This function is a quality-of-life one to convert lists of songs into a collection ready to be used in the AddRadio function.

Prepare Your Song Lists:
Make sure you have your song lists ready. Each song list should contain the names of the songs you want to add to the radio frequency.

Implement Your Custom Radio Frequencies:
You will need to call the AddRadio function with the following parameters: name, frequency and library.

BB_RoadTripRadio_Utils.AddRadio("Radio Name", Frequency, SongList)
  • Replace "Radio Name" with the name you want to give to your radio station.

  • Replace Frequency with the frequency you want to assign to your radio station. Remember, frequencies must be even numbers, and multiply the desired frequency by 1000.

  • Replace SongList with the table containing the names of the songs you want to include in your radio station.

Quality-of-Life Functions (Optional)
If you have mods where all songs have a prefix followed by a number, you can use the quality-of-life functions provided in the framework to simplify the process of creating song lists.

Execute Code Before EveryOneMinute:
Remember that adding custom frequencies requires code that runs before EveryOneMinute, ideally in a function like onInitGlobalModData.
Code must run on the Server side.

Test Your Changes:
After implementing your custom radio frequencies, launch the game and test them to ensure they work as expected. Make any necessary adjustments if needed.


Enjoy Your Custom Radio Stations!
Once everything is set up and working correctly, enjoy listening to your custom radio stations while surviving the zombie apocalypse! 😊💖
Last edited by Braven; 14 May, 2024 @ 12:33pm