Pretty bad vehicle BGM bug

For example, I get on my ship on MAP32 which has ABC.mp3 as it's BGM. I hit a teleport event that takes me to MAP34 which has XYZ.mp3 as it's BGM. Everything is fine UNTIL I decide to get off my ship, where ABC.mp3 starts playing again.


I have deducted that it is an issue with the engine itself because starting a completely fresh project yields the same results. This happens whether the player manually gets off the boat or if I set it up so it forces them to.


I really need a way to fix this because it's killing the immersion in my project. The music is the most important part of being introduced to a certain section of the game and this bug eats that alive.


Thanks for your help.
Yes, it is an engine bug.  I logged it quite some time ago, but never heard whether it was resolved.


@Archeia?
Damn. I have the latest version and everything but no dice, probably wasn't resolved. Unless there is some obscure plugin I'm missing.
I'm not aware of a plugin being written to fix it, and I don't think the developers would provide a fix as a plugin.  I might write one later if I have time.
Any sort of ideas that would get around this? I've tried a bunch of things to no avail 😛
I also found another bug that's audio related.


For instance, Map 1 and 2 have the same BGM playing. Map 2 has the BGM playing at 60%. After playing an ME in Map 2, going back to Map 1 doesn't change the volume to 100% even though that's what I have it set as in the editor. Going to Map 3 which also has the same BGM playing at 100% resets everything. Not playing the ME in Map 2 doesn't trigger this bug and everything plays as normal.


I figured I would post it here too since it is also audio related and the previous bug may be tied to something wrong with the audio playback rather than the ship/vehicle processing which is what I previously thought.


Sorry if this one has already been found too. Just posting what I find 😛


@Shaz @Archeia
You don't need to tag me - I'm not a mod and can't do anything about this.
Oh got it. You responded to it initially so I forgot even while reading your title that you aren't a mod xD sorry!
Apologies for the pretty big bump, but to my knowledge this still hasn't been fixed (as of the latest update). It's really irritating and a bit game breaking.
My core plugin fixes this bug. https://ltngames.net/ltn-core

I honestly thought this bug was fixed. I was actually going to remove this feature from my core. until I noticed it has still not been fixed, good thing I kept it there. Let me know if it works for you.
Wow that's great news! I'm glad I bumped this. I'm not exactly interested in adding an entirely new core to my project since I have everything else mentioned in that right now just using other plugins and it works perfectly well, but if need be I can remove all that to use yours instead. Do you think you could extract just the vehicle bug fix in its own plugin or is it worked in too well to the rest of the plugin to be used on its own? Thanks again!
You can take it right out, most MV functionality in my core is easily extractable. Especially for those who know Javascript. Anyway here is a quickly modified one you can put in a new js file. It should work fine ,let me know if there are any problems.
Code:
(function () {
    let VehicleBGMFix = {}

    // Save BGM when not in vehicle.
    const GameMap_autoplay = Game_Map.prototype.autoplay
    Game_Map.prototype.autoplay = function () {
      if (!$gamePlayer.isInVehicle()) {
        GameMap_autoplay.call(this)
        VehicleBGMFix = AudioManager.saveBgm()
      }
    }

    // Ensure BGM is not the old BGM before exiting vehicle.
    const Game_Vehicle_getOff = Game_Vehicle.prototype.getOff
    Game_Vehicle.prototype.getOff = function () {
      Game_Vehicle_getOff.call(this)
      if (VehicleBGMFix !== $dataMap.Bgm) {
        AudioManager.playBgm($dataMap.bgm)
      }
    }
  }
})()
Thank you so much! This helps a great deal!! I will definitely let you know if there are any issues!
I edited my previous post, I made a few mistakes copying from my core to here. I was in a hurry and never scanned through it all. Should be good now, I still never tested it though.

Original thread: https://forums.rpgmakerweb.com/threads/pretty-bad-vehicle-bgm-bug.73073/