Playlists allow to create a list of music tracks that the game can play in the background while playing.
The configuration of playlists are located in the res/config/playlist
folder and have to end with a .plist.lua
suffix and file extension. The script needs to have a data()
function that returns a struct like this:
function data() return { name = _("Train Fever"), tracks = { { name = "Cricket Post - Admiral James T.", fileName = "Admiral James T. - 01 - Cricket Post.ogg", yearFrom = 1950, -- only play this track beginning from the year 1950 yearTo = 2000, -- only play this track until the end of year 2000 }, { fileName = "Admiral James T. - 02 - Lower East.ogg" }, { fileName = "Admiral James T. - 03 - Love Train.ogg" }, ... }, order = 1, } end
The playlist struct has three properties:
name
the display name of the playlist used in the games settings menutracks
a list of track structsname
the display name of the track used in the music playerfileName
reference to an audio file relative to res/audio/music/
yearFrom
starting year when the track should play (inclusive)yearTo
last year the track should be played (inclusive)order
determines the position in the playlist selection in the games settingsPlaylists can be selected in the Audio tab of the settings.
The list of the tracks will update everytime the year changes. During this update the game selects all available tracks for the actual game year. A value of 0 (zero) means that there is no limit for either yearFrom
or yearTo
.