Space Age Music Playlist Extender

by tjjinx

The music playlist extender mod only applies to the "Space Age" expansion. It allows players to expand the music playlist to include other planet's songs. The players can therefore enjoy the wonderful new music from the "Space Age" expansion before they have left Nauvis.

Utilities
7 months ago
2.0
627

g Amazing mod, a few requests

6 months ago

Hello! This mod is amazing, I love being able to hear other planets' music while on Nauvis or in space, listening to the OST just doesn't have that same natural feel as the programmed intervals. But I was curious if it was possible to streamline the options, so instead of checking every single song to either listen to, omit, or naturally play on planet, you could choose songs based on planet, and/or have a mass selection option for all the songs with the available parameters. Sometimes I'd just like to listen to one planet's music, and it's pretty awful to have to individually map every song to what I'd like them to play as. But again, great mod!

4 months ago

Eloeri,

Great idea! This might be possible, but I'd have to spend the time to investigate (I spend most of my off-time playing games versus coding).

When the expansion arrived I found the music to be very good but not accessible everywhere, which was disappointing. I first explored the in-game options and then started searching the install directory on my machine to determine if this could easily be handled via some sort of configuration file (e.g. JSON or XML); to my delight, it could. So I originally started mucking with the JSON files and found that experience to be very cumbersome, partly for the same reasons you mentioned (but for myself alone). That and that technique had a chance to be clobbered by patches from the game's developers.

I also knew the game had a LUA-based modding API, and I'm a software engineer by trade, so I spent a day learning the API and created a mod to replace my manual JSON-based technique.

The first release of the mod I created added all the songs everywhere without allowing it to be configurable. My kids suggested making it configurable. So I reviewed the settings stage, which is the first stage in the Factorio modding API life-cycle. That's what led to the second release with the "individual songs" alternative you see now.

During the implementation of this alternative, I discovered a couple of things about the settings stage:
1. It appears to be the only stage in the API where these options can be added and/or manipulated. The options are immutable once the life-cycle progresses to the next stage.
2. The settings stage appears to be the most limiting with respect to the API and what can be done.
3. It uses a lexicographical-based sorting mechanism for the options that one sees in the UI.
3. All mods that have been loaded by a user share this same settings stage and will have their options added to the same UI screen. They are grouped by mod, but it convolutes the display. Granted, the sheer volume of songs I added also convolutes it.

So with that said, I'm pretty sure I could streamline it for planet's (let's call that "select a planet" alternative). But, because of the limited capabilities in the settings stage, I'm not sure I can support both alternatives at the same time. In other words, if a user chooses one of the three options for the "select a planet" alternative for a particular planet, have the code also auto-set the associated songs from the "individual songs" alternative. I personally prefer to use the "individual songs" alternative because I only turn off a couple of songs across all planets/space.

4 months ago

Thank you for the response! I appreciate you breaking it down for me! Even if it's not possible, what you've done so far is fantastic. Thank you again!

New response