Jump to content

Welcome to the Forum!

The best place to exchange builds and ideas! Vote for the best ideas and suggestions here.

Join the Avorion Discord!

Connect with other passionate players and talk about the latest news.
Discord

DLC Avorion Into the Rift Out Now!

Now available on Steam!
Steam

[Avo v1.3.8 - BB 2.0] Your Music In-Game After Patch 0.21


Shrooblord
 Share

Recommended Posts

Still works on Avorion 1.3.8 and on the 2.0 Beta Branch update!

For older versions of Avorion (< 1.0), check the archived first post.

----

[ ! ] Scroll to the bottom of the post for my own full music.lua file to copy-paste into yours in case you need a complete example.

[ ! ] To my knowledge, music modding is an entirely client-side process. I.e. the client needs to install the music files themselves, and they cannot be installed through Steam Workshop. I would love to hear if you figured out how to do this, though! Server owners, please read step 10 in the Background / Ambient Tracks section to allow clients to use their music mods on your server.
----

Hey gang,

Avorion's Music Coordinator builds a playlist of tracks based on "moods", and chooses tracks that are appropriate for that Sector based on how many Stations are left alive there, how many Wreckages are there, whether the Sector is neutral, hostile, or friendly to you, whether it's completely empty, etc. etc.

Basically, you get played tracks that feel "appropriate" for that environment.


Introduction

 

For example, there's the collection of

TrackCollection.All(), one for TrackCollection.Happy(), one for TrackCollection.Neutral(), TrackCollection.Desolate() etc.


Also there's this one TrackCollection.HappyNoParticle() which is literally what it sounds like: the collection from TrackCollection.Happy() minus Particle.ogg. RIP

There's also this helpful line:

-- modders: reserve track numbers 15 - 1000 for additional future music

which is a pointer that you should start using tracks with IDs 1001 and up to avoid conflicts with future Avorion updates.

 

What does this mean for all of you out there who had a vast library of music added into the game? Well, I am one of them (3 GB of music to be precise), so let me walk you through the steps of making your music show up in game again. In my case, it's time to categorise 3 GB worth of music into "moods"... ^^"


[NOTE:]

  •  For all directories, move into your Avorion Steam installation directory first: YourSteamFolder/(...)/Avorion/, typically something like
    C:\Program Files (x86)\Steam\steamapps\common\Avorion\.
  • All music files need to be in .OGG format, or Avorion will not play them.
  • I've installed my own music files directly into my Avorion installation folder, i.e. in the Steam Directory (see above), not in any other place like AppData nor a /steamworkshop/ folder. I've always done it that way and never tested the others; you might be able to pull it off by installing it there. Let me know if it works!

 

Main Menu

 

The Main Menu just plays whatever's in the data/music/main/ folder.

 

Background / Ambient Tracks

 

Step 1.

Create a new mod by going to the Main Menu > Settings > Mods > Upload to Workshop and click New Mod / Faction Pack. Select Mod as the type. This will create an empty mod in your %appdata%/Avorion/mods directory.


Step 2.

Create the following folder structure in your mod's folder: data/scripts/lib/ and create a file called music.lua.


Step 3.

Add this as your first lines:

package.path = package.path .. ";data/scripts/lib/?.lua"
package.path = package.path .. ";data/scripts/?.lua"
newTrackType =
{
-- modders: reserve track numbers 15 - 1000 for additional future music
}


We will insert our new keys here, in the newTrackType table.


Step 4.

Add indices for your music tracks:

newTrackType =
{
-- modders: reserve track numbers 15 - 1000 for additional future music
    MikiSatellite           = 1001,
    GumiECHO                = 1002,
    MEWSchwarzerRegen       = 1003,
    NekomuraIrohaSandPlanet = 1004,
    HatsuneMikuTsumugiuta   = 1005,
    LILYMarieLuise          = 1006,
    BGCOutsideTheRealm      = 1007,
    SporeGAUniverse         = 1008,
    CnC3MourningHour        = 1009,
    LiliaYSbg               = 1010,
    XenogearsMelkaba        = 1011,
    --...
    BoukenDeshoDeshoHaruhi  = 1107,
    OceanReturns            = 1108,
    CrystalGemsPilot        = 1109
}


Step 5.

After the newTrackType table, let's make sure to append the Vanilla music.lua's TrackType table with our own new one:

--insert our new tracks into the old TrackType table
for k, v in pairs(newTrackType) do
    TrackType[k] = v
end

 

Step 6.

Add them as keys in the Tracks table:

Tracks[TrackType.MikiSatellite]           = {type = TrackType.MikiSatellite,                    path = "data/music/background/[MMD] Satellite - Miki.ogg"}
Tracks[TrackType.GumiECHO]                = {type = TrackType.GumiECHO,                         path = "data/music/background/ECHO [Gumi English].ogg"}
Tracks[TrackType.MEWSchwarzerRegen]       = {type = TrackType.MEWSchwarzerRegen,                path = "data/music/background/MEW - Schwarzer Regen.ogg"}
Tracks[TrackType.NekomuraIrohaSandPlanet] = {type = TrackType.NekomuraIrohaSandPlanet,          path = "data/music/background/Nekomura Iroha V4 Sand Planet.ogg"}
Tracks[TrackType.HatsuneMikuTsumugiuta]   = {type = TrackType.HatsuneMikuTsumugiuta,            path = "data/music/background/[VOCALOID] Tsumugiuta - Hatsune Miku [Append Dark].ogg"}
Tracks[TrackType.LILYMarieLuise]          = {type = TrackType.LILYMarieLuise,                   path = "data/music/background/[LILY] Marie-Luise (Romaji+English Subbed) +mp3.ogg"}
Tracks[TrackType.BGCOutsideTheRealm]      = {type = TrackType.BGCOutsideTheRealm,               path = "data/music/background/[Stranger Things 2] Outside the Realm - Big Giant Circles feat. Ashly Burch & Malukah.ogg"}
Tracks[TrackType.SporeGAUniverse]         = {type = TrackType.SporeGAUniverse,                  path = "data/music/background/01 - Spore Galactic Adventures Soundtrack - A Universe in Your Hands.ogg"}
Tracks[TrackType.CnC3MourningHour]        = {type = TrackType.CnC3MourningHour,                 path = "data/music/background/01 Mourning Hour.ogg"}
Tracks[TrackType.LiliaYSbg]               = {type = TrackType.LiliaYSbg,                        path = "data/music/background/01-lilia ys bg.ogg"}
Tracks[TrackType.XenogearsMelkaba]        = {type = TrackType.XenogearsMelkaba,                 path = "data/music/background/01-melkaba bg.ogg"}
--...
Tracks[TrackType.BoukenDeshoDeshoHaruhi]    = {type = TrackType.BoukenDeshoDeshoHaruhi,         path = "data/music/background/The Melancholy of Haruhi Suzumiya Opening 1 Bouken Desho Desho Full Fan AMV.ogg"}
Tracks[TrackType.OceanReturns]              = {type = TrackType.OceanReturns,                   path = "data/music/background/The Ocean Returns (Symphonic Metal Tribute to Steven Universe).ogg"}
Tracks[TrackType.CrystalGemsPilot]          = {type = TrackType.CrystalGemsPilot,               path = "data/music/background/The Original Crystal Gem Theme (Steven Universe Pilot).ogg"}
--Tracks[TrackType.]            = {type = TrackType.,                 path = "data/music/background/.ogg"}


                         
This has the path to the actual tracks. Remember to include the .ogg file extension in your file paths! See also the comment at the end of my block of code. A little template I wrote for myself for convenience to add new music to the Tracks table quickly.


Step 7.

Let's create a table to put them into. We will add this table to the other existing tables in the Music Coordinator, so Avorion knows for which Mood to play them.

local ShroobMusic = {
    TrackType.MikiSatellite,
    TrackType.GumiECHO,
    TrackType.MEWSchwarzerRegen,
    TrackType.NekomuraIrohaSandPlanet,
    TrackType.HatsuneMikuTsumugiuta,
    TrackType.LILYMarieLuise,
    TrackType.BGCOutsideTheRealm,
    TrackType.SporeGAUniverse,
    TrackType.CnC3MourningHour,
    TrackType.LiliaYSbg,
    TrackType.XenogearsMelkaba,
    --...
    TrackType.BoukenDeshoDeshoHaruhi,
    TrackType.OceanReturns,
    TrackType.CrystalGemsPilot
    
}

 

Step 8.

Make a decision about which mood your tracks fit to, and put them in the appropriate function. I'm putting them in all of them myself, because I just want to hear my music in each Sector, and haven't made a decision yet about which ones to categorise into which Moods. I'll have to properly categorise them later, but for now, this is good enough for me.

--SHROOBLORD::MUSIC --> JUST COMBINE MY MUSIC WITH ALL TRACK LISTS. I DON'T CARE ABOUT ASSIGNING A "MOOD" TO MY TRACKS RIGHT NOW. JUST WANNA HEAR MY MUSIC.
TrackCollection.oldAll = TrackCollection.All
function TrackCollection.All()
    local oldAllCollection = TrackCollection.oldAll()
    return combine(oldAllCollection, ShroobMusic)
end
	TrackCollection.oldHappy = TrackCollection.Happy
function TrackCollection.Happy()
    local oldHappyCollection = TrackCollection.oldHappy()
    return combine(oldHappyCollection, ShroobMusic)
end
	TrackCollection.oldNeutral = TrackCollection.Neutral
function TrackCollection.Neutral()
    local oldNeutralCollection = TrackCollection.oldNeutral()
    return combine(oldNeutralCollection, ShroobMusic)
end
	TrackCollection.oldMiddle = TrackCollection.Middle
function TrackCollection.Middle()
    local oldMiddleCollection = TrackCollection.oldMiddle()
    return combine(oldMiddleCollection, ShroobMusic)
end
	TrackCollection.oldHappyNoParticle = TrackCollection.HappyNoParticle
function TrackCollection.HappyNoParticle()
    local oldHappyNoParticleCollection = TrackCollection.oldHappyNoParticle()
    return combine(oldHappyNoParticleCollection, ShroobMusic)
end
	TrackCollection.oldCold = TrackCollection.Cold
function TrackCollection.Cold()
    local oldColdCollection = TrackCollection.oldCold()
    return combine(oldColdCollection, ShroobMusic)
end
	TrackCollection.oldDesolate = TrackCollection.Desolate
function TrackCollection.Desolate()
    local oldDesolateCollection = TrackCollection.oldDesolate()
    return combine(oldDesolateCollection, ShroobMusic)
end
	TrackCollection.oldMelancholic = TrackCollection.Melancholic
function TrackCollection.Melancholic()
    local oldMelancholicCollection = TrackCollection.oldMelancholic()
    return combine(oldMelancholicCollection, ShroobMusic)
end
TrackCollection.oldHappyNeutral = TrackCollection.HappyNeutral
function TrackCollection.HappyNeutral()
    local oldHappyNeutralCollection = TrackCollection.oldHappyNeutral()
    return combine(oldHappyNeutralCollection, ShroobMusic)
end


To find out which moods the Sectors pull from, you're gonna have to do some digging. Search for the TrackCollection. function inside all scripts in the data/scripts/sectors/ folder -- this defines which tables the game pulls from in order to build a music playlist for that Sector. Use a code editor like Visual Studio Code to quickly search within files inside a directory, or use my favourite search engine Everything by VoidTools (#notSponsored).


[NOTE:]

See how we're calling the old Vanilla music.lua functions before adding our own tracks on top of them? This is the proper way to do it. This means that if Boxelware adds more music, we won't replace anything. It also means you could install multiple music mods, if they all use this method, and all use unique keys for their music tracks.
The combine() function is one Boxelware gave us. It's included in the vanilla music.lua to make our lives easier. Yay for mod-awareness!


Step 9.

Turn up the volume to 11.


That's it! Your Background Music will now play in-game. ^^

 

Step 10. (SERVER OWNERS)

To allow Clients to use their music mod, you must add an entry to your server's modconfig.lua:

--Client-Sided mods that are allowed by Server (optional mods)
allowed =
{
    --[[Shrooblord]]
    {id = "2090153967"},         --Shroob's Music Pack (CLIENT-ONLY; optional!)
    {id = "ShroobMusicPack"},     --Shroob's Music Pack (CLIENT-ONLY; optional!) -- alternate non-WS version
}

        

[NOTE:] You see me adding my Music Pack mod twice. Once for a Steam Workshop version, which I've shared with my friends, and one for a local version of the mod that has its id set to ShroobMusicPack (see documentation on a mod's modinfo.lua file to learn more).

 

Combat Tracks

 

The game plays any track from the data/music/combat/ folder. Just put your music there; it works the same like the Main Menu tracks.


Boss Tracks

 

Each Boss has a unique track that is defined in the data/music/special/ folder. When a Boss gets spawned and goes into attack mode, the Boss defines which track to play:


The AI
registerBoss(Uuid(), nil, nil, "data/music/special/ai.ogg")

Don't worry about the other arguments -- they detail the Boss's Entity UUID index, health bar and shield bar colour values, but we're not interested in that right now. The good part is the fourth argument, which is the path to the music track.


The Guardian
registerBoss(Entity().index, nil, nil, "data/music/special/guardian.ogg")


Not Specified / Generic Boss
Bosses that don't specify a special track use the boss track data/music/special/boss.ogg.

 

----------------


Have fun modding your game, and listening to some cool tunes!

~Shrooblord

 

P.S.

Note that the file paths described above can be any subdirectory of the Steam Avorion installation path you want! This means that if you package a mod with, for example, a cool new Boss to fight, you can give it custom music that sits in its own folder separate from the data/music folder, so that you don't even have to tell your users to drag the file into the appropriate folder; just "plug 'n play" and there you go!


This system means adapting, a little, but it is more flexible than the old one, and you as a modder (or user) have more control. Excellent~!

 

P.P.S.

Here's my own music.lua in its entirety, in case you want a more complete example; also included as a downloadable attachment:

 
				
			package.path = package.path .. ";data/scripts/lib/?.lua"				
			package.path = package.path .. ";data/scripts/?.lua"				
			 				
			newTrackType =				
			{				
			-- modders: reserve track numbers 15 - 1000 for additional future music								
			    MikiSatellite           = 1001,				
			    GumiECHO                = 1002,				
			    MEWSchwarzerRegen       = 1003,				
			    NekomuraIrohaSandPlanet = 1004,				
			    HatsuneMikuTsumugiuta   = 1005,				
			    LILYMarieLuise          = 1006,				
			    BGCOutsideTheRealm      = 1007,				
			    SporeGAUniverse         = 1008,				
			    CnC3MourningHour        = 1009,				
			    LiliaYSbg               = 1010,				
			    XenogearsMelkaba        = 1011,				
			    Castlevania3Prelude     = 1012,				
			    SeventhSaga             = 1013,				
			    Ecco2Title              = 1014,				
			    EccoTitle               = 1015,				
			    Xenosaga3Title          = 1016,				
			    XenobladeThemeX         = 1017,				
			    BlackAndWhiteIntro      = 1018,				
			    MLPiTTitle              = 1019,				
			    SporeGAAlienAbduction   = 1020,				
			    CnC3Crystalline         = 1021,				
			    CnCTSNoMercy            = 1022,				
			    BlasterMaster           = 1023,				
			    CrystalSprings          = 1024,				
			    MotherEarth             = 1025,				
			    SilentPalace            = 1026,				
			    Tristram                = 1027,				
			    BlackAndWhiteGood       = 1028,				
			    MLPiTLoadMenu           = 1029,				
			    CnCTSIndustrial         = 1030,				
			    FieldBG                 = 1031,				
			    BlackAndWhiteNeutral    = 1032,				
			    MLPiTIntro              = 1033,				
			    SporeGAAncientKingdom   = 1034,				
			    ChrisBischoffGhostShip  = 1035,				
			    CelcetaSeaOfTrees       = 1036,				
			    BlueControl             = 1037,				
			    LAPDFCGriffithPark      = 1038,				
			    LAPDFCVeniceBeach       = 1039,				
			    LAPDFCHellsGatePrison   = 1040,				
			    LAPDFCStudioCity        = 1041,				
			    LAPDFCLAXSpaceport      = 1042,				
			    LAPDFCLongBeach         = 1043,				
			    LAPDFCUrbanJungle       = 1044,				
			 				
			    AloneTogether           = 1045,				
			    BadApple                = 1046,				
			    BadAppleEN              = 1047,				
			 				
			    MosaicRole              = 1049,				
			    DropTheStrawberry       = 1050,				
			    LAPDFCMainMenu          = 1051,				
			    GodKnowsHaruhi          = 1052,				
			    IAmLapisLazuli          = 1053,				
			    Egao                    = 1054,				
			    LMDMVIYH                = 1055,				
			    LoveIsWar               = 1056,				
			    LoveLikeYou             = 1057,				
			    ForADeadGirl            = 1058,				
			    MoroseMakeBelieve       = 1059,				
			    NetsujouNoSpectrum      = 1060,				
			    OverlordOP              = 1061,				
			    Pearl                   = 1062,				
			    PilencePee              = 1063,				
			    PlayingEveryNoteOnce    = 1064,				
			    StrongInTheRealWay      = 1065,				
			    YBLMAILBOY              = 1066,				
			    ItsOverIsntIt           = 1067,				
			    WeAreTheCrystalGems     = 1068,				
			    StrangerThingsEulogy    = 1069,				
			    StrangerThingsTitle     = 1070,				
			    StrangerThings2Return   = 1071,				
			    StrangerThingsKids      = 1072,				
			 				
			    TarboyTwosAParty        = 1073,				
			    SteinsGateUrd           = 1074,				
			    utanlands               = 1075,				
			    vetr                    = 1076,				
			    SGWalkingOnSleeping     = 1077,				
			    SUSMTWeAreTheCrystalGems= 1078,				
			    WintergatanMarbleMachine= 1079,				
			    SteinsGateYanagibayashi = 1080,				
			    OverlordMYTHANDROIDHYDRA= 1081,				
			    Eve                     = 1082,				
			    ChivalryIdentity        = 1083,				
			 				
			    R2BtSoRaL               = 1084,				
			    R2DarkSwamp             = 1085,				
			    R2EnteringThePirateShip = 1086,				
			    R2FairyGlade            = 1087,				
			    R2FlowerRide            = 1088,				
			    R2GloboxMyFriend        = 1089,				
			    R2IronMountains         = 1090,				
			    R2Ly                    = 1091,				
			    R2Prologue              = 1092,				
			    R2Bayou1                = 1093,				
			    R2Bayou2                = 1094,				
			    R2Canopy                = 1095,				
			    R2CaveOfBadDreams       = 1096,				
			    R2MarshesOfAwakening    = 1097,				
			    R2Marshlands            = 1098,				
			    R2Precipice             = 1099,				
			    R2BtSoRaL               = 1100,				
			    R2SoRaF                 = 1101,				
			    R2WalkOfLife            = 1102,				
			    R2WoodsOfLight          = 1103,				
			    R2TombOfAncients        = 1104,				
			    R2WhaleBay              = 1105,				
			    Brother                 = 1106,				
			    BoukenDeshoDeshoHaruhi  = 1107,				
			    OceanReturns            = 1108,				
			    CrystalGemsPilot        = 1109							
			}				
			 				
			--insert our new tracks into the old TrackType table				
			for k, v in pairs(newTrackType) do				
			    TrackType[k] = v				
			end				
			
		 				
			--[[ ** VANILLA ** -- DO NOT OVERWRITE				
			Tracks = {}				
			Tracks[TrackType.Particle] = {type = TrackType.Particle, path = "data/music/background/particle.ogg"}				
			Tracks[TrackType.BlindingNebula] = {type = TrackType.BlindingNebula, path = "data/music/background/blinding_nebula.ogg"}				
			Tracks[TrackType.Exhale] = {type = TrackType.Exhale, path = "data/music/background/exhale.ogg"}				
			Tracks[TrackType.Float] = {type = TrackType.Float, path = "data/music/background/float.ogg"}				
			Tracks[TrackType.HappilyLost] = {type = TrackType.HappilyLost, path = "data/music/background/happily_lost.ogg"}				
			Tracks[TrackType.Beyond] = {type = TrackType.Beyond, path = "data/music/background/beyond.ogg"}				
			Tracks[TrackType.InSight] = {type = TrackType.InSight, path = "data/music/background/in_sight.ogg"}				
			Tracks[TrackType.Befog] = {type = TrackType.Befog, path = "data/music/background/befog.ogg"}				
			Tracks[TrackType.LightDance] = {type = TrackType.LightDance, path = "data/music/background/light_dance.ogg"}				
			Tracks[TrackType.LongForgotten] = {type = TrackType.LongForgotten, path = "data/music/background/long_forgotten.ogg"}				
			Tracks[TrackType.Interim] = {type = TrackType.Interim, path = "data/music/background/interim.ogg"}				
			Tracks[TrackType.Impact] = {type = TrackType.Impact, path = "data/music/background/impact.ogg"}				
			Tracks[TrackType.Found] = {type = TrackType.Found, path = "data/music/background/found.ogg"}				
			Tracks[TrackType.BehindStorms] = {type = TrackType.BehindStorms, path = "data/music/background/behind_storms.ogg"}				
			]]--				
			
		 				
			--"data/music/background/.ogg"				
			--Tracks[TrackType.x]           = {type = x,           path = y}				
			 						
			Tracks[TrackType.MikiSatellite]           = {type = TrackType.MikiSatellite,                    path = "data/music/background/[MMD] Satellite - Miki.ogg"}				
			Tracks[TrackType.GumiECHO]                = {type = TrackType.GumiECHO,                         path = "data/music/background/ECHO [Gumi English].ogg"}				
			Tracks[TrackType.MEWSchwarzerRegen]       = {type = TrackType.MEWSchwarzerRegen,                path = "data/music/background/MEW - Schwarzer Regen.ogg"}				
			Tracks[TrackType.NekomuraIrohaSandPlanet] = {type = TrackType.NekomuraIrohaSandPlanet,          path = "data/music/background/Nekomura Iroha V4 Sand Planet.ogg"}				
			Tracks[TrackType.HatsuneMikuTsumugiuta]   = {type = TrackType.HatsuneMikuTsumugiuta,            path = "data/music/background/[VOCALOID] Tsumugiuta - Hatsune Miku [Append Dark].ogg"}				
			Tracks[TrackType.LILYMarieLuise]          = {type = TrackType.LILYMarieLuise,                   path = "data/music/background/[LILY] Marie-Luise (Romaji+English Subbed) +mp3.ogg"}				
			Tracks[TrackType.BGCOutsideTheRealm]      = {type = TrackType.BGCOutsideTheRealm,               path = "data/music/background/[Stranger Things 2] Outside the Realm - Big Giant Circles feat. Ashly Burch & Malukah.ogg"}				
			Tracks[TrackType.SporeGAUniverse]         = {type = TrackType.SporeGAUniverse,                  path = "data/music/background/01 - Spore Galactic Adventures Soundtrack - A Universe in Your Hands.ogg"}				
			Tracks[TrackType.CnC3MourningHour]        = {type = TrackType.CnC3MourningHour,                 path = "data/music/background/01 Mourning Hour.ogg"}				
			Tracks[TrackType.LiliaYSbg]               = {type = TrackType.LiliaYSbg,                        path = "data/music/background/01-lilia ys bg.ogg"}				
			Tracks[TrackType.XenogearsMelkaba]        = {type = TrackType.XenogearsMelkaba,                 path = "data/music/background/01-melkaba bg.ogg"}				
			Tracks[TrackType.Castlevania3Prelude]     = {type = TrackType.Castlevania3Prelude,              path = "data/music/background/01-prelude-intro-castlevania3 bg.ogg"}				
			Tracks[TrackType.SeventhSaga]             = {type = TrackType.SeventhSaga,                      path = "data/music/background/01-the-7th-saga bg.ogg"}				
			Tracks[TrackType.Ecco2Title]              = {type = TrackType.Ecco2Title,                       path = "data/music/background/01-title ecco 2 bg.ogg"}				
			Tracks[TrackType.EccoTitle]               = {type = TrackType.EccoTitle,                        path = "data/music/background/01-title ecco bg.ogg"}				
			Tracks[TrackType.Xenosaga3Title]          = {type = TrackType.Xenosaga3Title,                   path = "data/music/background/01-title-screen xenosaga3 bg.ogg"}				
			Tracks[TrackType.XenobladeThemeX]         = {type = TrackType.XenobladeThemeX,                  path = "data/music/background/1-02 Theme X xenoblade bg remix.ogg"}				
			Tracks[TrackType.BlackAndWhiteIntro]      = {type = TrackType.BlackAndWhiteIntro,               path = "data/music/background/002 - Black & White - Introduction music.ogg"}				
			Tracks[TrackType.MLPiTTitle]              = {type = TrackType.MLPiTTitle,                       path = "data/music/background/002 title.ogg"}				
			Tracks[TrackType.SporeGAAlienAbduction]   = {type = TrackType.SporeGAAlienAbduction,            path = "data/music/background/02 - Spore Galactic Adventures Soundtrack - Alien Abduction.ogg"}				
			Tracks[TrackType.CnC3Crystalline]         = {type = TrackType.CnC3Crystalline,                  path = "data/music/background/02 Crystalline.ogg"}				
			Tracks[TrackType.CnCTSNoMercy]            = {type = TrackType.CnCTSNoMercy,                     path = "data/music/background/02. No Mercy.ogg"}				
			Tracks[TrackType.BlasterMaster]           = {type = TrackType.BlasterMaster,                    path = "data/music/background/02.-blaster-master-stage-1 bg.ogg"}				
			Tracks[TrackType.CrystalSprings]          = {type = TrackType.CrystalSprings,                   path = "data/music/background/02-crystal-springs bg.ogg"}				
			Tracks[TrackType.MotherEarth]             = {type = TrackType.MotherEarth,                      path = "data/music/background/02-mother-earth bg.ogg"}				
			Tracks[TrackType.SilentPalace]            = {type = TrackType.SilentPalace,                     path = "data/music/background/02-silent-palace bg.ogg"}				
			Tracks[TrackType.Tristram]                = {type = TrackType.Tristram,                         path = "data/music/background/02-tristram bg.ogg"}				
			Tracks[TrackType.BlackAndWhiteGood]       = {type = TrackType.BlackAndWhiteGood,                path = "data/music/background/003 - Black & White music - Good.ogg"}				
			Tracks[TrackType.MLPiTLoadMenu]           = {type = TrackType.MLPiTLoadMenu,                    path = "data/music/background/003 load menu.ogg"}				
			Tracks[TrackType.CnCTSIndustrial]         = {type = TrackType.CnCTSIndustrial,                  path = "data/music/background/03. Industrial.ogg"}				
			Tracks[TrackType.FieldBG]                 = {type = TrackType.FieldBG,                          path = "data/music/background/03-field bg.ogg"}				
			Tracks[TrackType.BlackAndWhiteNeutral]    = {type = TrackType.BlackAndWhiteNeutral,             path = "data/music/background/004 - Black & White music - Neutral.ogg"}				
			Tracks[TrackType.MLPiTIntro]              = {type = TrackType.MLPiTIntro,                       path = "data/music/background/004 intro.ogg"}				
			Tracks[TrackType.SporeGAAncientKingdom]   = {type = TrackType.SporeGAAncientKingdom,            path = "data/music/background/04 - Spore Galactic Adventures Soundtrack - Ancient Kingdom (1&2).ogg"}				
			Tracks[TrackType.ChrisBischoffGhostShip]  = {type = TrackType.ChrisBischoffGhostShip,           path = "data/music/background/04.-christopher-bischoff-ghost-ship bg.ogg"}				
			Tracks[TrackType.CelcetaSeaOfTrees]       = {type = TrackType.CelcetaSeaOfTrees,                path = "data/music/background/04-celceta-the-sea-of-trees bg.ogg"}				
			Tracks[TrackType.BlueControl]             = {type = TrackType.BlueControl,                      path = "data/music/background/04 Blue Control.ogg"}				
			 				
			Tracks[TrackType.LAPDFCGriffithPark]        = {type = TrackType.LAPDFCGriffithPark,             path = "data/music/background/Track 1 - Griffith Park - Future Cop LAPD.ogg"}				
			Tracks[TrackType.LAPDFCVeniceBeach]         = {type = TrackType.LAPDFCVeniceBeach,              path = "data/music/background/Track 4 - Venice Beach - Future Cop LAPD.ogg"}				
			Tracks[TrackType.LAPDFCHellsGatePrison]     = {type = TrackType.LAPDFCHellsGatePrison,          path = "data/music/background/Track 5 - Hells Gate Prison - Future Cop LAPD.ogg"}				
			Tracks[TrackType.LAPDFCStudioCity]          = {type = TrackType.LAPDFCStudioCity,               path = "data/music/background/Track 6 - Studio City - Future Cop LAPD.ogg"}				
			Tracks[TrackType.LAPDFCLAXSpaceport]        = {type = TrackType.LAPDFCLAXSpaceport,             path = "data/music/background/Track 7 - LAX Spaceport - Future Cop LAPD.ogg"}				
			Tracks[TrackType.LAPDFCLongBeach]           = {type = TrackType.LAPDFCLongBeach,                path = "data/music/background/Track 8 - Long Beach - Future Cop LAPD.ogg"}				
			Tracks[TrackType.LAPDFCUrbanJungle]         = {type = TrackType.LAPDFCUrbanJungle,              path = "data/music/background/Track 11 - Urban Jungle - Future Cop LAPD.ogg"}				
			Tracks[TrackType.LAPDFCMainMenu]            = {type = TrackType.LAPDFCMainMenu,                 path = "data/music/background/Future Cop - Menu Theme [HD].ogg"}				
			 				
			Tracks[TrackType.BadApple]                  = {type = TrackType.BadApple,                       path = "data/music/background/Bad Apple!!   Lyrics English Subtitles & Japanese Kanji & Romaji ENG SUB.ogg"}				
			Tracks[TrackType.BadAppleEN]                = {type = TrackType.BadAppleEN,                     path = "data/music/background/Bad Apple!! (English Cover) [JubyPhonic].ogg"}				
			Tracks[TrackType.MosaicRole]                = {type = TrackType.MosaicRole,                     path = "data/music/background/DECO_27 - Mosaic Role feat. GUMI.ogg"}				
			 				
			Tracks[TrackType.AloneTogether]             = {type = TrackType.AloneTogether,                  path = "data/music/background/Alone Together (Symphonic Metal Tribute to Steven Universe).ogg"}				
			Tracks[TrackType.DropTheStrawberry]         = {type = TrackType.DropTheStrawberry,              path = "data/music/background/Drop the Strawberry (Symphonic Metal Tribute to Steven Universe).ogg"}				
			Tracks[TrackType.IAmLapisLazuli]            = {type = TrackType.IAmLapisLazuli,                 path = "data/music/background/I Am Lapis Lazuli (Symphonic Metal Tribute to Steven Universe).ogg"}				
			Tracks[TrackType.LMDMVIYH]                  = {type = TrackType.LMDMVIYH,                       path = "data/music/background/Let Me Drive My Van Into Your Heart (Symphonic Metal Tribute to Steven Universe).ogg"}				
			Tracks[TrackType.LoveLikeYou]               = {type = TrackType.LoveLikeYou,                    path = "data/music/background/Love Like You (Symphonic Metal Tribute to Steven Universe).ogg"}				
			Tracks[TrackType.Pearl]                     = {type = TrackType.Pearl,                          path = "data/music/background/Pearl (Symphonic Metal Tribute to Steven Universe).ogg"}				
			Tracks[TrackType.StrongInTheRealWay]        = {type = TrackType.StrongInTheRealWay,             path = "data/music/background/Steven Universe - 'Strong In the Real Way' Song.ogg"}				
			Tracks[TrackType.YBLMAILBOY]                = {type = TrackType.YBLMAILBOY,                     path = "data/music/background/Steven Universe - You Both Love Me And I Love Both Of You- (HD).ogg"}				
			Tracks[TrackType.ItsOverIsntIt]             = {type = TrackType.ItsOverIsntIt,                  path = "data/music/background/Steven Universe -It's Over Isn't It- (HD).ogg"}				
			Tracks[TrackType.WeAreTheCrystalGems]       = {type = TrackType.WeAreTheCrystalGems,            path = "data/music/background/Steven Universe Soundtrack - We Are the Crystal Gems (Full Song) [Raw Audio].ogg"}				
			 				
			Tracks[TrackType.GodKnowsHaruhi]            = {type = TrackType.GodKnowsHaruhi,                 path = "data/music/background/God knows... The Melancholy of Haruhi Suzumiya.ogg"}				
			Tracks[TrackType.Egao]                      = {type = TrackType.Egao,                           path = "data/music/background/Ikimono Gakari - Egao [With Lyrics].ogg"}				
			Tracks[TrackType.LoveIsWar]                 = {type = TrackType.LoveIsWar,                      path = "data/music/background/Love Is War (Miku Hatsune) (Original).ogg"}				
			Tracks[TrackType.ForADeadGirl]              = {type = TrackType.ForADeadGirl,                   path = "data/music/background/Megurine Luka - For a dead girl+.ogg"}				
			Tracks[TrackType.MoroseMakeBelieve]         = {type = TrackType.MoroseMakeBelieve,              path = "data/music/background/Mew - Morose Make-Believe.ogg"}				
			Tracks[TrackType.NetsujouNoSpectrum]        = {type = TrackType.NetsujouNoSpectrum,             path = "data/music/background/Nanatsu no Taizai OP - Netsujou no Spectrum [Lyrics].ogg"}				
			Tracks[TrackType.OverlordOP]                = {type = TrackType.OverlordOP,                     path = "data/music/background/Overlord - Opening.ogg"}				
			Tracks[TrackType.PilencePee]                = {type = TrackType.PilencePee,                     path = "data/music/background/Pilence pee - The Great Voices of Bulgaria, Conductor Ilia Mihaylov.ogg"}				
			Tracks[TrackType.PlayingEveryNoteOnce]      = {type = TrackType.PlayingEveryNoteOnce,           path = "data/music/background/Playing Every Note Exactly Once.ogg"}				
			 				
			Tracks[TrackType.StrangerThingsEulogy]      = {type = TrackType.StrangerThingsEulogy,           path = "data/music/background/Stranger Things - Eulogy [ OST ] Soundtrack.ogg"}				
			Tracks[TrackType.StrangerThingsTitle]       = {type = TrackType.StrangerThingsTitle,            path = "data/music/background/Stranger Things _ Title Sequence [HD] _ Netflix.ogg"}				
			Tracks[TrackType.StrangerThings2Return]     = {type = TrackType.StrangerThings2Return,          path = "data/music/background/Stranger Things 2 Soundtrack_ The Return.ogg"}				
			Tracks[TrackType.StrangerThingsKids]        = {type = TrackType.StrangerThingsKids,             path = "data/music/background/Stranger Things ORIGINAL Sountrack Kids mp3.ogg"}				
			 				
			Tracks[TrackType.TarboyTwosAParty]          = {type = TrackType.TarboyTwosAParty,               path = "data/music/background/Two's a Party - Hania Zdunek [Tarboy OST] [SotD].ogg"}				
			Tracks[TrackType.SteinsGateUrd]             = {type = TrackType.SteinsGateUrd,                  path = "data/music/background/Urd [Steins;Gate OST].ogg"}				
			Tracks[TrackType.utanlands]                 = {type = TrackType.utanlands,                      path = "data/music/background/útanlands.ogg"}				
			Tracks[TrackType.vetr]                      = {type = TrackType.vetr,                           path = "data/music/background/vetr.ogg"}				
			Tracks[TrackType.SGWalkingOnSleeping]       = {type = TrackType.SGWalkingOnSleeping,            path = "data/music/background/Walking on sleeping [Steins;Gate OST].ogg"}				
			Tracks[TrackType.SUSMTWeAreTheCrystalGems]  = {type = TrackType.SUSMTWeAreTheCrystalGems,       path = "data/music/background/We Are the Crystal Gems (Symphonic Metal Tribute to Steven Universe).ogg"}				
			Tracks[TrackType.WintergatanMarbleMachine]  = {type = TrackType.WintergatanMarbleMachine,       path = "data/music/background/Wintergatan - Marble Machine (music instrument using 2000 marbles).ogg"}				
			Tracks[TrackType.SteinsGateYanagibayashi]   = {type = TrackType.SteinsGateYanagibayashi,        path = "data/music/background/Yanagibayashi [Steins;Gate OST].ogg"}				
			Tracks[TrackType.OverlordMYTHANDROIDHYDRA]  = {type = TrackType.OverlordMYTHANDROIDHYDRA,       path = "data/music/background/Overlord Season 2 Ending Full MYTH & ROID - HYDRA (ENG SUB).ogg"}				
			Tracks[TrackType.Eve]                       = {type = TrackType.Eve,                            path = "data/music/background/Nonsense Literature - Eve  MV.ogg"}				
			Tracks[TrackType.ChivalryIdentity]          = {type = TrackType.ChivalryIdentity,               path = "data/music/background/Identity Chivalry of a Failed Knight OP.ogg"}				
			 				
			Tracks[TrackType.R2BtSoRaL]                 = {type = TrackType.R2BtSoRaL,                      path = "data/music/background/R2 - Beneath the Sanctuary of Rock and Lava.ogg"}				
			Tracks[TrackType.R2DarkSwamp]               = {type = TrackType.R2DarkSwamp,                    path = "data/music/background/R2 - Dark Swamp.ogg"}				
			Tracks[TrackType.R2EnteringThePirateShip]   = {type = TrackType.R2EnteringThePirateShip,        path = "data/music/background/R2 - Entering the Pirate Ship.ogg"}				
			Tracks[TrackType.R2FairyGlade]              = {type = TrackType.R2FairyGlade,                   path = "data/music/background/R2 - Fairy Glade.ogg"}				
			Tracks[TrackType.R2FlowerRide]              = {type = TrackType.R2FlowerRide,                   path = "data/music/background/R2 - Flower Ride.ogg"}				
			Tracks[TrackType.R2GloboxMyFriend]          = {type = TrackType.R2GloboxMyFriend,               path = "data/music/background/R2 - Globox My Friend.ogg"}				
			Tracks[TrackType.R2IronMountains]           = {type = TrackType.R2IronMountains,                path = "data/music/background/R2 - Iron Mountains.ogg"}				
			Tracks[TrackType.R2Ly]                      = {type = TrackType.R2Ly,                           path = "data/music/background/R2 - Ly.ogg"}				
			Tracks[TrackType.R2Prologue]                = {type = TrackType.R2Prologue,                     path = "data/music/background/R2 - Prologue.ogg"}				
			Tracks[TrackType.R2Bayou1]                  = {type = TrackType.R2Bayou1,                       path = "data/music/background/R2 - The Bayou Part 1.ogg"}				
			Tracks[TrackType.R2Bayou2]                  = {type = TrackType.R2Bayou2,                       path = "data/music/background/R2 - The Bayou Part 2.ogg"}				
			Tracks[TrackType.R2Canopy]                  = {type = TrackType.R2Canopy,                       path = "data/music/background/R2 - The Canopy.ogg"}				
			Tracks[TrackType.R2CaveOfBadDreams]         = {type = TrackType.R2CaveOfBadDreams,              path = "data/music/background/R2 - The Cave of Bad Dreams.ogg"}				
			Tracks[TrackType.R2MarshesOfAwakening]      = {type = TrackType.R2MarshesOfAwakening,           path = "data/music/background/R2 - The Marshes of Awakening.ogg"}				
			Tracks[TrackType.R2Marshlands]              = {type = TrackType.R2Marshlands,                   path = "data/music/background/R2 - The Marshlands.ogg"}				
			Tracks[TrackType.R2Precipice]               = {type = TrackType.R2Precipice,                    path = "data/music/background/R2 - The Precipice.ogg"}				
			Tracks[TrackType.R2BtSoRaL]                 = {type = TrackType.R2BtSoRaL,                      path = "data/music/background/R2 - The Sanctuary of Rock and Lava.ogg"}				
			Tracks[TrackType.R2SoRaF]                   = {type = TrackType.R2SoRaF,                        path = "data/music/background/R2 - The Sanctuary of Stone and Fire.ogg"}				
			Tracks[TrackType.R2WalkOfLife]              = {type = TrackType.R2WalkOfLife,                   path = "data/music/background/R2 - The Walk of Life.ogg"}				
			Tracks[TrackType.R2WoodsOfLight]            = {type = TrackType.R2WoodsOfLight,                 path = "data/music/background/R2 - The Woods of Light.ogg"}				
			Tracks[TrackType.R2TombOfAncients]          = {type = TrackType.R2TombOfAncients,               path = "data/music/background/R2 - Tomb of Ancients.ogg"}				
			Tracks[TrackType.R2WhaleBay]                = {type = TrackType.R2WhaleBay,                     path = "data/music/background/R2 - Whale Bay.ogg"}				
			 				
			Tracks[TrackType.Brother]                   = {type = TrackType.Brother,                        path = "data/music/background/Stuck In The Sound  - Brother [Official Video].ogg"}				
			Tracks[TrackType.BoukenDeshoDeshoHaruhi]    = {type = TrackType.BoukenDeshoDeshoHaruhi,         path = "data/music/background/The Melancholy of Haruhi Suzumiya Opening 1 Bouken Desho Desho Full Fan AMV.ogg"}				
			Tracks[TrackType.OceanReturns]              = {type = TrackType.OceanReturns,                   path = "data/music/background/The Ocean Returns (Symphonic Metal Tribute to Steven Universe).ogg"}				
			Tracks[TrackType.CrystalGemsPilot]          = {type = TrackType.CrystalGemsPilot,               path = "data/music/background/The Original Crystal Gem Theme (Steven Universe Pilot).ogg"}				
			 				
			--Tracks[TrackType.]            = {type = TrackType.,                 path = "data/music/background/.ogg"}								
			 				
			--TrackCollection = {}				
			 				
			local ShroobMusic = {							
			    TrackType.MikiSatellite,				
			    TrackType.GumiECHO,				
			    TrackType.MEWSchwarzerRegen,				
			    TrackType.NekomuraIrohaSandPlanet,				
			    TrackType.HatsuneMikuTsumugiuta,				
			    TrackType.LILYMarieLuise,				
			    TrackType.BGCOutsideTheRealm,				
			    TrackType.SporeGAUniverse,				
			    TrackType.CnC3MourningHour,				
			    TrackType.LiliaYSbg,				
			    TrackType.XenogearsMelkaba,				
			    TrackType.Castlevania3Prelude,				
			    TrackType.SeventhSaga,				
			    TrackType.Ecco2Title,				
			    TrackType.EccoTitle,				
			    TrackType.Xenosaga3Title,				
			    TrackType.XenobladeThemeX,				
			    TrackType.BlackAndWhiteIntro,				
			    TrackType.MLPiTTitle,				
			    TrackType.SporeGAAlienAbduction,				
			    TrackType.CnC3Crystalline,				
			    TrackType.CnCTSNoMercy,				
			    TrackType.BlasterMaster,				
			    TrackType.CrystalSprings,				
			    TrackType.MotherEarth,				
			    TrackType.SilentPalace,				
			    TrackType.Tristram,				
			    TrackType.BlackAndWhiteGood,				
			    TrackType.MLPiTLoadMenu,				
			    TrackType.CnCTSIndustrial,				
			    TrackType.FieldBG,				
			    TrackType.BlackAndWhiteNeutral,				
			    TrackType.MLPiTIntro,				
			    TrackType.SporeGAAncientKingdom,				
			    TrackType.ChrisBischoffGhostShip,				
			    TrackType.CelcetaSeaOfTrees,				
			    TrackType.BlueControl,				
			    TrackType.LAPDFCGriffithPark,				
			    TrackType.LAPDFCVeniceBeach,				
			    TrackType.LAPDFCHellsGatePrison,				
			    TrackType.LAPDFCStudioCity,				
			    TrackType.LAPDFCLAXSpaceport,				
			    TrackType.LAPDFCLongBeach,				
			    TrackType.LAPDFCUrbanJungle,				
			    TrackType.LAPDFCMainMenu,				
			    TrackType.TarboyTwosAParty,				
			    TrackType.SteinsGateUrd,				
			    TrackType.utanlands,				
			    TrackType.vetr,				
			    TrackType.SGWalkingOnSleeping,				
			    TrackType.SUSMTWeAreTheCrystalGems,				
			    TrackType.WintergatanMarbleMachine,				
			    TrackType.SteinsGateYanagibayashi,				
			    TrackType.OverlordMYTHANDROIDHYDRA,				
			    TrackType.Eve,				
			    TrackType.ChivalryIdentity,				
			 				
			    TrackType.AloneTogether,				
			    TrackType.BadApple,				
			    TrackType.BadAppleEN,				
			 				
			    TrackType.MosaicRole,				
			    TrackType.DropTheStrawberry,				
			    TrackType.LAPDFCMainMenu,				
			    TrackType.GodKnowsHaruhi,				
			    TrackType.IAmLapisLazuli,				
			    TrackType.Egao,				
			    TrackType.LMDMVIYH,				
			    TrackType.LoveIsWar,				
			    TrackType.LoveLikeYou,				
			    TrackType.ForADeadGirl,				
			    TrackType.MoroseMakeBelieve,				
			    TrackType.NetsujouNoSpectrum,				
			    TrackType.OverlordOP,				
			    TrackType.Pearl,				
			    TrackType.PilencePee,				
			    TrackType.PlayingEveryNoteOnce,				
			    TrackType.StrongInTheRealWay,				
			    TrackType.YBLMAILBOY,				
			    TrackType.ItsOverIsntIt,				
			    TrackType.WeAreTheCrystalGems,				
			    TrackType.StrangerThingsEulogy,				
			    TrackType.StrangerThingsTitle,				
			    TrackType.StrangerThings2Return,				
			    TrackType.StrangerThingsKids,				
			 				
			    TrackType.R2BtSoRaL,				
			    TrackType.R2DarkSwamp,				
			    TrackType.R2EnteringThePirateShip,				
			    TrackType.R2FairyGlade,				
			    TrackType.R2FlowerRide,				
			    TrackType.R2GloboxMyFriend,				
			    TrackType.R2IronMountains,				
			    TrackType.R2Ly,				
			    TrackType.R2Prologue,				
			    TrackType.R2Bayou1,				
			    TrackType.R2Bayou2,				
			    TrackType.R2Canopy,				
			    TrackType.R2CaveOfBadDreams,				
			    TrackType.R2MarshesOfAwakening,				
			    TrackType.R2Marshlands,				
			    TrackType.R2Precipice,				
			    TrackType.R2BtSoRaL,				
			    TrackType.R2SoRaF,				
			    TrackType.R2WalkOfLife,				
			    TrackType.R2WoodsOfLight,				
			    TrackType.R2TombOfAncients,				
			    TrackType.R2WhaleBay,				
			    TrackType.Brother,				
			    TrackType.BoukenDeshoDeshoHaruhi,				
			    TrackType.OceanReturns,				
			    TrackType.CrystalGemsPilot				
			    								
			}				
			 				
			-- Happy + Neutral + Middle -> All				
			--SHROOBLORD::MUSIC --> JUST COMBINE MY MUSIC WITH ALL TRACK LISTS. I DON'T CARE ABOUT ASSIGNING A "MOOD" TO MY TRACKS RIGHT NOW. JUST WANNA HEAR MY MUSIC.				
			TrackCollection.oldAll = TrackCollection.All				
			function TrackCollection.All()				
			    local oldAllCollection = TrackCollection.oldAll()				
			    return combine(oldAllCollection, ShroobMusic)				
			end				
			 				
			TrackCollection.oldHappy = TrackCollection.Happy				
			function TrackCollection.Happy()				
			    local oldHappyCollection = TrackCollection.oldHappy()				
			    return combine(oldHappyCollection, ShroobMusic)				
			end				
			 				
			TrackCollection.oldNeutral = TrackCollection.Neutral				
			function TrackCollection.Neutral()				
			    local oldNeutralCollection = TrackCollection.oldNeutral()				
			    return combine(oldNeutralCollection, ShroobMusic)				
			end				
			 				
			TrackCollection.oldMiddle = TrackCollection.Middle				
			function TrackCollection.Middle()				
			    local oldMiddleCollection = TrackCollection.oldMiddle()				
			    return combine(oldMiddleCollection, ShroobMusic)				
			end				
			 				
			TrackCollection.oldHappyNoParticle = TrackCollection.HappyNoParticle				
			function TrackCollection.HappyNoParticle()				
			    local oldHappyNoParticleCollection = TrackCollection.oldHappyNoParticle()				
			    return combine(oldHappyNoParticleCollection, ShroobMusic)				
			end				
			 				
			TrackCollection.oldCold = TrackCollection.Cold				
			function TrackCollection.Cold()				
			    local oldColdCollection = TrackCollection.oldCold()				
			    return combine(oldColdCollection, ShroobMusic)				
			end				
			 				
			TrackCollection.oldDesolate = TrackCollection.Desolate				
			function TrackCollection.Desolate()				
			    local oldDesolateCollection = TrackCollection.oldDesolate()				
			    return combine(oldDesolateCollection, ShroobMusic)				
			end				
			 				
			TrackCollection.oldMelancholic = TrackCollection.Melancholic				
			function TrackCollection.Melancholic()				
			    local oldMelancholicCollection = TrackCollection.oldMelancholic()				
			    return combine(oldMelancholicCollection, ShroobMusic)				
			end				
			 				
			TrackCollection.oldHappyNeutral = TrackCollection.HappyNeutral				
			function TrackCollection.HappyNeutral()				
			    local oldHappyNeutralCollection = TrackCollection.oldHappyNeutral()				
			    return combine(oldHappyNeutralCollection, ShroobMusic)				
			end				
			 				
			

 

music.lua

Edited by Shrooblord
Complete revision. Rewritten large parts, and moved away from using images in favour of text elements that will persist throughout the Heat Death of the Universe. Now with functional spoilers, and proper headings and text formatting! Appended music.lua.
Link to comment
Share on other sites

  • 1 year later...

Just to confirm for all y'all 1.0 players: this still works! I just made a mod for the Workshop using the new modding system, but the basic fundamentals of this are still the same. To make it friendlier towards other modders, and to allow Boxel to add new music without your mod overwriting the vanilla file so that their new music doesn't show up, I suggest adding to the tables rather than straight-up replacing them. You know how it is, using the new modding techniques outlined in the Wiki. I'll edit the first post soon with new instructions.

 

There's actually two very friendly ease-of-use functions at the very end of music.lua that seem to be built specifically so we can insert new tracks into the tables quickly. It's almost like they built that thing with us modders in mind...! ;)

Link to comment
Share on other sites

THIS IS AN ARCHIVE OF THE OLD INSTRUCTIONS.

If for some reason you are running an ancient version of Avorion between version 0.21-1.0, read on:

 

----

 

Hey gang,

 

Avorion recently got an overhaul to its Music Player. It now builds a playlist of tracks based on "moods", and chooses tracks that are appropriate for that Sector based on how many Stations are left alive there, how many Wreckages are there, whether the Sector is neutral, hostile, or friendly to you, whether it's completely empty, etc. etc.

 

Basically, you no longer have a list of random tracks, but tracks that feel "appropriate" for that environment.

 

[spoiler=introduction]For example, there's the collection of TrackCollection.All(), one for TrackCollection.Happy(), one for TrackCollection.Neutral(), TrackCollection.Desolate() etc.

 

Also there's this one TrackCollection.HappyNoParticle() which is literally what it sounds like: the collection from TrackCollection.Happy() minus Particle.ogg. RIP

There's also this helpful line:

-- modders: reserve track numbers 15 - 1000 for additional future music

which is a pointer that you should start using tracks with IDs 1001 and up to avoid conflicts with future Avorion updates.

 

 

 

 

What does this mean for all of you out there who had a vast library of music added into the game? Well, I am one of them (3 GB of music to be precise), so let me walk you through the steps of making your music show up in game again. In my case, it's time to categorise 3 GB worth of music into "moods"... ^^"

 

[NOTE:]

  • For all directories, move into your Avorion Steam installation directory first: YourSteamFolder/(...)/Avorion/, typically something like
    C:\Program Files (x86)\Steam\steamapps\common\Avorion\.
     
  • All music files need to be in .OGG format, or Avorion will not play them.

 

 

Main Menu

 

 

The Main Menu just plays whatever's in the data/music/main/ folder.

 

 

 

 

Background / Ambient Tracks

 

 

Step 1.

Navigate to data/scripts/lib and open music.lua.

 

 

Step 2.

Add indeces for your music tracks:

music1.png

 

 

Step 3.

Add them as keys in the Tracks table:

music.png

 

This has the path to the actual tracks. Note how I've forgotten to add .ogg at the end of most of my files? Don't do that! The filepath includes the .ogg extension.

 

[NOTE:] The track "long_forgotten.ogg" will never be played, because it is erroneously called "loing_forgotten.ogg" in your /background/ folder. I have already submitted a bug report.

To get it to show up in-game, rename the file in the /background/ folder to "long_forgotten.ogg" as it should be.

 

 

Step 4.

Add the keys to the TrackCollection.All() function.

music2.png

 

 

Step 5.

Make a decision about which mood your tracks fit to, and put them in the appropriate function. I'm putting them in Neutral myself, because I'm currently in a Sector that pulls from this list, so I want my music to show up there. I'll have to properly categorise them later, but for now, this is good enough for me.

music3.png

 

To find out which moods the Sectors pull from, you're gonna have to do some digging. Search for the TrackCollection. function inside all scripts in the data/scripts/sectors/ folder -- this defines which tables the game pulls from in order to build a music playlist for that Sector.

 

 

Step 6.

Turn up the volume to 11.

 

That's it! Your Background Music will now play in-game. ^^

 

 

 

Combat Tracks

 

 

Not sure yet! I haven't investigated combat music yet, but I expect it either plays any of the files inside the data/music/combat/ folder, or operates in a similar fashion as Background Tracks and has a music table of its own. But I haven't gotten to that part yet so I don't know for now.

 

 

 

 

Boss Tracks

 

 

Each Boss has a unique track that is defined in the data/music/special/ folder. When a Boss gets spawned and goes into attack mode, the Boss defines which track to play:

 

The AI

registerBoss(Uuid(), nil, nil, "data/music/special/ai.ogg")

Don't worry about the other arguments -- they detail the Boss's Entity UUID index, health bar and shield bar colour values, but we're not interested in that right now. The good part is the fourth argument, which is the path to the music track.

 

The Guardian

registerBoss(Entity().index, nil, nil, "data/music/special/guardian.ogg")

 

Not Specified / Generic Boss

Bosses that don't specify a special track use the boss track data/music/special/boss.ogg.

 

 

 

----------------

 

Have fun modding your game, and listening to some cool tunes!

 

 

Shrooblord

 

 

P.S.

Note that the file paths described above can be any subdirectory of the Steam Avorion installation path you want! This means that if you package a mod with, for example, a cool new Boss to fight, you can give it custom music that sits in its own folder separate from the data/music folder, so that you don't even have to tell your users to drag the file into the appropriate folder; just "plug 'n play" and there you go!

 

This system means adapting, a little, but it is more flexible than the old one, and you as a modder (or user) have more control. Excellent~!

Link to comment
Share on other sites

Hi there! Just bumping the topic to let you know I've rewritten the first post entirely. No more pictures; just plain text code blocks for easier copy-pasting (and also to ensure the images don't get deleted over time like with the previous version... yuck!).

Furthermore, slightly edited some instructions for clarity, and added my own music.lua to the end of the first post in case you want/need to copy it over in its entirety for whatever reason or just like seeing a complete example. There's also a downloadable attachment. See the first post of the topic!

Edited by Shrooblord
Done editing the first post. Now formalising this as an update bump.
Link to comment
Share on other sites

  • 1 month later...
  • Shrooblord changed the title to [Avo v1.3.8 - BB 2.0] Your Music In-Game After Patch 0.21

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...