Looping Victory Music

● ARCHIVED · READ-ONLY
Started by psipumpkin 4 posts View original ↗
  1. Hello! Basically, I'm looking for a plugin that allows victory music to loop until the player returns to the map after a battle. I know there is a yanfly plugin that has a feature similar to this, however the plugins I'm using conflict with yanfly's battle plugins.

    Thank you for your time!
  2. Feel free to try the plugin below. It makes the Victory ME loop until the battle scene ends. I'm not sure how it will affect whatever plugins you are currently using.
    Code:
    // LoopVictoryMusic.js
    // Created on 9/24/2018
    
    /*:
    * @plugindesc This plugin is meant to loop the victory
    * music until the player returns to the map.
    * @author Yethwhinger
    *
    * @help This plugin causes the victory music after a
    * battle to continue looping until the player has
    * returned to the map scene.
    */
    
    //----------------------------
    // Changes to BattleManager
    //----------------------------
    
    BattleManager.playVictoryMe = function () {
        AudioManager.playMeLoop($gameSystem.victoryMe());
    };
    
    BattleManager.processVictory = function () {
        $gameParty.removeBattleStates();
        $gameParty.performVictory();
        this.playVictoryMe();
        this.makeRewards();
        this.displayVictoryMessage();
        this.displayRewards();
        this.gainRewards();
        this.endBattle(0);
    };
    
    BattleManager.updateBattleEnd = function () {
        if (this.isBattleTest()) {
            AudioManager.stopBgm();
            SceneManager.exit();
        } else if (!this._escaped && $gameParty.isAllDead()) {
            if (this._canLose) {
                $gameParty.reviveBattleMembers();
                SceneManager.pop();
            } else {
                SceneManager.goto(Scene_Gameover);
            }
        } else if (!this._escaped) {
            this.replayBgmAndBgs();
            SceneManager.pop();
        } else {
            SceneManager.pop();
        }
        this._phase = null;
    };
    
    //----------------------------
    // Changes to AudioManager
    //----------------------------
    
    AudioManager.playMeLoop = function (me, pos) {
        if (this.isCurrentBgm(me)) {
            this.updateBgmParameters(me);
        } else {
            this.stopBgm();
            if (me.name) {
                this._bgmBuffer = this.createBuffer('me', me.name);
                this.updateBgmParameters(me);
                if (!this._meBuffer) {
                    this._bgmBuffer.play(true, pos || 0);
                }
            }
        }
        this.updateCurrentBgm(me, pos);
    };
  3. Worked like a charm! Thank you!
  4. This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.