Preventing vehicles from changing the background music

Hi,

How can I prevent vehicles from changing the background music?

I've tried looking for plugins, but can't really find anything that fixes this problem.

Thanks!
You could try this:

Code:
/*:
* @plugindesc Causes getting on and off vehicles to no longer change background music.
* @author Zevia
*
* @help This Plugin overwrites the getOn and getOff methods, so could
* have compatibility issues with other Plugins that reference them. It
* should be placed above other Plugins for best chances at preventing
* incompatibility.
*/
(function() {
    'use strict';

    Game_Vehicle.prototype.getOn = function() {
        this._driving = true;
        this.setWalkAnime(true);
        this.setStepAnime(true);
        $gameSystem.saveWalkingBgm();
    };

    Game_Vehicle.prototype.getOff = function() {
        this._driving = false;
        this.setWalkAnime(false);
        this.setStepAnime(false);
        this.resetDirection();
    };
})();

Normally, those methods have this.playBgm(); and $gameSystem.replayWalkingBgm();, respectively, as their last lines. This Plugin removes them, so that getting on and off a vehicle shouldn't affect background music.
That worked, thanks! Really appreciate the help.
Actually I spoke too soon. This script seems a bit bugged, because if you traverse on boat from one map to another, it doesn't change the music to the new map's music.
That is a known bug, and there are scripts/plugins (I think) that fix it.

To stop vehicles changing BGM, did you try just setting the Boat/Ship/Airship music to (none) in the System tab? Did that stop the change and leave the existing BGM playing, or did it just stop the existing BGM but play nothing else?
This should probably do it :

Code:
/*:
* @plugindesc Causes getting on and off vehicles to no longer change background music.
* @author Zevia
*
* @help This Plugin overwrites the getOn and getOff methods, so could
* have compatibility issues with other Plugins that reference them. It
* should be placed above other Plugins for best chances at preventing
* incompatibility.
*/
(function() {
    'use strict';

    Game_Vehicle.prototype.getOn = function() {
        this._driving = true;
        this.setWalkAnime(true);
        this.setStepAnime(true);
        $gameSystem.saveWalkingBgm();
    };

    Game_Vehicle.prototype.getOff = function() {
        this._driving = false;
        this.setWalkAnime(false);
        this.setStepAnime(false);
        this.resetDirection();
    };
   
    Game_Map.prototype.autoplay = function() {
        if ($dataMap.autoplayBgm) {
            AudioManager.playBgm($dataMap.bgm);
        }
        if ($dataMap.autoplayBgs) {
            AudioManager.playBgs($dataMap.bgs);
        }
    };
})();

Simply setting the vehicle BGM to 'none' will not work, unfortunately. I tested that out right away, because I thought it would be the easiest solution.
you could work around this with some eventing.
transfer event:
darken screen
if character on boat
> switch on: boat
> exit boat
if character on airship
> switch on: airship
> exit airship
switch on: transfer
transfer to new map

map loading event
autorun
req switch: transfer
if switch on: boat
>board boat
>turn off switch: boat
if switch on: airship
>board airship
>turn off switch: airship
screen brightness reset
turn off switch: transfer
you could work around this with some eventing.
transfer event:
darken screen
if character on boat
> switch on: boat
> exit boat
if character on airship
> switch on: airship
> exit airship
switch on: transfer
transfer to new map

map loading event
autorun
req switch: transfer
if switch on: boat
>board boat
>turn off switch: boat
if switch on: airship
>board airship
>turn off switch: airship
screen brightness reset
turn off switch: transfer

That's not going to prevent the vehicle music from playing, unfortunately.

This should probably do it :

Code:
/*:
* @plugindesc Causes getting on and off vehicles to no longer change background music.
* @author Zevia
*
* @help This Plugin overwrites the getOn and getOff methods, so could
* have compatibility issues with other Plugins that reference them. It
* should be placed above other Plugins for best chances at preventing
* incompatibility.
*/
(function() {
    'use strict';

    Game_Vehicle.prototype.getOn = function() {
        this._driving = true;
        this.setWalkAnime(true);
        this.setStepAnime(true);
        $gameSystem.saveWalkingBgm();
    };

    Game_Vehicle.prototype.getOff = function() {
        this._driving = false;
        this.setWalkAnime(false);
        this.setStepAnime(false);
        this.resetDirection();
    };
  
    Game_Map.prototype.autoplay = function() {
        if ($dataMap.autoplayBgm) {
            AudioManager.playBgm($dataMap.bgm);
        }
        if ($dataMap.autoplayBgs) {
            AudioManager.playBgs($dataMap.bgs);
        }
    };
})();

Simply setting the vehicle BGM to 'none' will not work, unfortunately. I tested that out right away, because I thought it would be the easiest solution.

That worked! Thank you very much.

Original thread: https://forums.rpgmakerweb.com/threads/preventing-vehicles-from-changing-the-background-music.124775/