tModLoader

tModLoader

58 arvostelua
Jukebox: Merge Music Packs
2
2
   
Palkinto
Lisää suosikkeihin
Lisätty suosikkeihin
Poista suosikeista
Mod Side: Both
tModLoader Version: 1.4.4
Language: English
Tiedostokoko
Julkaistu
Päivitetty
128.948 KB
20.11. klo 20.07
22.11. klo 0.14
5 muutosilmoitusta ( näytä )

Tilaa ladataksesi
Jukebox: Merge Music Packs

Kuvaus
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

tModLoader RandomPackMusic lähetti viestin:
Developed By LevitatingGT
33 kommenttia
Bucketsmith 21 tuntia sitten 
Okay thank you, it works well with the resource packs!
LevitatingGT  [tekijä] 21 tuntia sitten 
id say that this mod only works with terraria music packs man
Bucketsmith 30.11. klo 2.39 
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  [tekijä] 29.11. klo 13.38 
what is a resource pack downloaded on the TModloader workshop? I thought you could only download resource packs from the Terraria workshop
Bucketsmith 29.11. klo 6.38 
I should add; music packs downloaded on the tmodloader workshop instead of the terraria workshop.
Bucketsmith 29.11. klo 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.11. klo 2.19 
holy damn, this is interesting
LevitatingGT  [tekijä] 28.11. klo 14.12 
sadly I think that'd be way too far out of my field though
Zeb 28.11. klo 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  [tekijä] 27.11. klo 23.34 
Sweet, I'll add it to my mod ideas. Expect a release sometime in the future. and thanks for the kind words 🥂