Is it possible to create an item that would mute the currently playing background music? I know how to make an item play a song, such as the musicbox, but I want this item to also mute whatever music is currently playing in the background. Is this possible?
I only want to mute the bgm when the player enters a certain area. I'd like to create an invisible item in the background that will override the bgm and play something different instead, until the player leaves that area. It isn't so simple as just turning the bgm off. I want an effect similar to the Shoggoth mission in the Frackin' Universe mod, where certain sound effects are triggered when you reach certain areas; except it also mutes whatever music is already playing. Unfortunately I can't just look at his code to see how he did it and learn from it, as the mission file seems to be encrypted somehow.
By encrypted you mean that is a file .pak? You must unpack it, see this thread. I don't use that mod so i can't tell what it does.
No, I have the .pak unpacked itself, but when I get to the json file that contains, it's encrypted with zlib, so I can't examine the actual information I want to see. I was just now thinking that perhaps he uses a stagehand to get the desired effect, but I can't seem to find any documentation on how stagehands work or how to implement them, so if anyone has information on that, I'd really appreciate it if you could share it.
Look the files /quest/story/protectorate.json and /quest/scripts/tutorial/protectorate.lua In the tutorial they change the music using this function: world.sendEntityMessage(entity.id(), "playAltMusic", config.getParameter("startingMusicTracks"))