tModLoader

tModLoader

57 betyg
Jukebox: Merge Music Packs
2
2
   
Utmärkelse
Favorit
Favoritmarkerad
Avfavoritmarkerad
Mod Side: Both
tModLoader Version: 1.4.4
Language: English
Filstorlek
Lades upp
Uppdaterades
128.948 KB
20 nov @ 20:07
22 nov @ 0:14
5 ändringsnotiser ( visa )

Abonnera för att ladda ner
Jukebox: Merge Music Packs

Beskrivning
Have you ever felt indecisive on what music pack to use? Have you ever wished you could use multiple music packs... all at the same time? Well wish no more! This mod lets you use all of your favourite music packs together with just a simple click. Load into a world and let the mod do its magic, all music packs will be used and tracks will be picked out at random depending on the biome, time, and weather. This works with music boxes too! Hence the name JukeBox...

Jukebox: Merge Music Packs is a mod that randomizes music from all enabled resource packs instead of just the top one, allowing you to use multiple music packs at once and experience all of them.



COMMANDS:

/next - plays a track at random out of your music packs (based on what biome you are in, with time and weather considered)
/song - tells you what track is currently playing in the chat, as well as what resource pack its from, who the author is, and what the track ID is.

WHAT DOES THIS DO?

In detail, this mod uses complex but lightweight systems to randomize the song that is used from your music packs that are enabled. This mod entirely bypasses the standard Terraria and tModLoader Resource Pack prioritization system, which normally loads assets only from the single, top-most enabled pack. It does this through a multi-layered approach: first, a specialized scanner accurately reads the user's config.json file to build a strict, verified list of all truly enabled music packs, ensuring disabled packs are never included.

Second, using the ModSystem.PostUpdateEverything hook, the mod intercepts the game's music selection after the vanilla biome/time/event logic decides which song ID to play. Instead of allowing the vanilla game to retrieve the single cached song for that ID, the mod selects a file at random from its indexed list of variants. Finally, it uses Reflection to manually instantiate a specialized IAudioTrack (OGG, MP3, or WAV) by creating a fresh MemoryStream of the chosen file's data. This new, random track is then injected directly into the game's live audio array, wrapped in a SafeAudioTrack class that catches critical stream/format errors, allowing the engine to skip corrupted songs without crashing the entire game.

This combination of deep system access and safety wrappers forces Terraria to play randomized music from all enabled sources.

KNOWN BUGS

- Resource packs that are disabled, but are installed, play their tracks. // Im not sure how to fix this, but i am working on it. If anyone has a fix, lmk in the comments. Fixed!
- An error message appears occasionally, upon entering a new biome or on startup of a world. // I will fix this ASAP Fixed!


Enjoy!
Texture packs used for visuals were:
UI PACK: Fancy UI by SanDragon
(top) Secrets of the Shadows Texture Pack
(below) TerraEnhanced

Resource packs used for music shown in the photo above was:
(any order obviously)
- Zelda Music by Magicalkitnip
- TLoZ: Twilight Princess Music by MadaxTheShadow

Ursprungligen skrivet av tModLoader RandomPackMusic:
Developed By LevitatingGT
31 kommentarer
Bucketsmith 5 timmar sedan 
Resource packs from the Terraria workshop, music packs from the tModloader workshop.
There are music packs there that don't act like a resource pack. They don't show up in the resource pack list in the menu.
That is why I am wondering if they will still be picked up by your mod?
Does it only look for resource packs, or does it look for anything that presents itself as a music track?
LevitatingGT  [skapare] 18 timmar sedan 
what is a resource pack downloaded on the TModloader workshop? I thought you could only download resource packs from the Terraria workshop
Bucketsmith 29 nov @ 6:38 
I should add; music packs downloaded on the tmodloader workshop instead of the terraria workshop.
Bucketsmith 29 nov @ 6:31 
I've not played in a very long time and the mod vs resource pack thing is new to me, so excuse this dumb question.
Does this work with the music packs I download on the workshop that are seemingly a mod?
Or does it specifically have to be a resource pack and show up in the resource pack list?
Marisa Freeman 29 nov @ 2:19 
holy damn, this is interesting
LevitatingGT  [skapare] 28 nov @ 14:12 
sadly I think that'd be way too far out of my field though
Zeb 28 nov @ 6:47 
A mod like this that makes use of resource packs makes me imagine a different mod that allows for replacing modded textures using packs instead of stacking additional mods (assumably making use of formatted txt files)
LevitatingGT  [skapare] 27 nov @ 23:34 
Sweet, I'll add it to my mod ideas. Expect a release sometime in the future. and thanks for the kind words 🥂
Im_Blkx 27 nov @ 18:53 
@LevitatingGT That would be so cool! I can't deny that the idea is interesting; I installed all your mods and noticed a level of realism that fits perfectly with my modpack. I believe the idea won't deviate from this pattern. Feel free to make the mod if possible! By the way, your mods are great!
LevitatingGT  [skapare] 27 nov @ 17:47 
@Im_Blkx Im currently taking mod suggestions, so if you want I can make a mod that inflicts some sort of debuffs when you havent had sleep for a while. Also have some sort of pulsing vignette when youre tired. If you want me to go ahead with something like that lmk!