Preface: I don't know how to code in JS - I had to look up a few posts just to get a basic idea of how to do this.
So I'm attempting to re-write the victory processing in the Battle Manager in order to make the BGM fade out for a second or two before actually playing the victory ME and showing the victory message. I'm using setTimeOut to create the delay - which worked well enough in defeat processing - but here, it causes issues. Again, I don't know anything about JS, but it seems like the code within the setTimeOut snippet is firing every frame of runtime, until the delay is over.
Sauce:
If anybody knows what I should be doing, I'd appreciate your help. Thanks! :mrsatan:
So I'm attempting to re-write the victory processing in the Battle Manager in order to make the BGM fade out for a second or two before actually playing the victory ME and showing the victory message. I'm using setTimeOut to create the delay - which worked well enough in defeat processing - but here, it causes issues. Again, I don't know anything about JS, but it seems like the code within the setTimeOut snippet is firing every frame of runtime, until the delay is over.
Sauce:
Code:
BattleManager.processVictory = function() {
var self = this;
setTimeout(function () {
$gameParty.removeBattleStates();
$gameParty.performVictory();
self.playVictoryMe();
self.replayBgmAndBgs();
self.makeRewards();
self.displayVictoryMessage();
self.displayRewards();
self.gainRewards();
self.endBattle(0);
}, 2000);
};
If anybody knows what I should be doing, I'd appreciate your help. Thanks! :mrsatan: