tModLoader

tModLoader

49 个评价
Jukebox: Merge Music Packs
2
2
   
奖励
收藏
已收藏
取消收藏
tModLoader版本: 1.4.4
语言: 英语
文件大小
发表于
更新日期
128.948 KB
11 月 20 日 下午 8:07
11 月 22 日 上午 12:14
5 项改动说明 ( 查看 )

订阅以下载
Jukebox: Merge Music Packs

描述
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
Developed By LevitatingGT
16 条留言
LevitatingGT  [作者] 1 小时以前 
Thanks so much!! so happy you're happy
Unishine 6 小时以前 
this is literally my favorite mod EVER! !!! im NOt joking oh my GOD !~!! this is CRAZY !!!!!!!!!!!!!!!!!!!! my replayability and enjoyment of this game is goign to be so high thank you !! please make more like this in the future :steamhappy:
Sanftes Blöken 11 月 24 日 下午 3:52 
Sorry for slipping in,but it doesnt,since resource packs swap vanilla themes,if replaced by a mod,they wont work,im playing with Calamity music mod and it barely lets the music appears in some places
LevitatingGT  [作者] 11 月 24 日 下午 3:18 
I'm not sure if it works with music mods, since I only made this change how tmod handles resource packs
Mick0604 11 月 24 日 下午 2:09 
does this work with music mods aswell? like if i wanted to use the old calamity music mod and vanilla calamity music mod together?
Sanftes Blöken 11 月 23 日 下午 8:56 
you are the goat
evil moth 11 月 23 日 下午 6:50 
♥♥♥♥♥♥♥♥♥ I was just thinking about this!!!
Uncle Badass 11 月 23 日 下午 6:45 
Absolutely stunning, I love you.
This is the kind of thing dreams are made of, this is a work of wizardry that once was thought impossible.
LevitatingGT  [作者] 11 月 22 日 上午 6:26 
Haha appreciate it. this took quite a lot of work and troubleshooting as obviously it recodes how tmodloader handles its own code, but we got there in the end. and i may make an update for this with that feature in the config sometime if its something youre interested in!
WatchingTheLambs 11 月 22 日 上午 2:45 
I never expected this to be possible for some reason, but you just blew my mind. Well done!
Now all we need is a version for player death and hurt sounds instead of music tracks.