Based off this code it seems you can dynamically generate a script with a list of songs pulled from the config. is there a way to dynamically generate a script while tying battle music to victory music, or is it better to keep the individual config files and load those as needed like in RBT's current implementation?
@stark hollow hi hello :D if there is no way to do this then I can keep RBT as is but it is kinda painful having 5 million different PMEs to keep track of right now....
var normalSongsList = new List<string>();
if (config.Normal_Song1)
normalSongsList.Add("SongNameUsedInScript");
// Do the same for other types of songs.
// Create script.
var script = $"
const normalSongs = [{string.Join(',', normalSongsList)}]\n
const BATTLE_THEME = random_song(normalSongs)
";
// Write script to a file.
var modDir = modLoader.GetDirectoryForModId(modConfig.ModId);
var outputFile = Path.Join(modDir, "output.theme.pme");
File.WriteAllText(outputFile, script);
// Add with API.
battleThemeApi.AddPath(modConfig.ModId, outputFile);
more or less what'd you need. You add each song name to a list of songs if the setting for it is enabled. In the script, you combine then insert them into the array of songs. Then write to a file and add that file to battle themes.
[Go to message!](#1340192878940524585 message)



