Hi, everyone! This may seem basic but for some reason it's giving me some trouble that I haven't really had when making custom Windows. Whenever I try to call this scene after a battle has ended I just get a black screen with the victory music still playing in the background. This is my plugin in its entirety (so far, and a couple things are not how they will be in the final version, I wanted to make sure I could transition the scene before continuing.)
Code:
//Scene_Battle Scene_Battle.prototype.displayEvolution = function () { SceneManager.push(Scene_Evolution) } //Scene_Evolution function Scene_Evolution() { this.initialize.apply(this, arguments); } Scene_Evolution.prototype = Object.create(Scene_Base.prototype); Scene_Evolution.prototype.constructor = Scene_Evolution; Scene_Evolution.prototype.endMusic() = function () { AudioManager.stopBgm(); AudioManager.stopBgs(); } Scene_Evolution.prototype.createFlashFrame = function () { var pictureName = 'Metamorph_Flash7' console.log('frames') this._flashFrame = new Sprite(); this._flashFrame.bitmap = ImageManager.loadSystem(pictureName); this.addChild(this._flashFrame); if (!this._flashFrame){ this._currentFrame += 1 var pictureName = 'Metamorph_Flash7' var Image = ImageManager.loadPicture(pictureName); this._flashFrame = new Sprite(); Image.addLoadListener(function() { this._flashFrame.bitmap = Image; this._flashFrame.x = 0; this._flashFrame.y = 0; }.bind(this)); this.addChild(this._flashFrame); this.setWait(3) return } if (this._waitCount===0){ this.children.pop() this._currentFrame += 1 var pictureName = 'Metamorph_Flash' + this._currentFrame var Image = ImageManager.loadPicture(pictureName); this._flashFrame = new Sprite(); Image.addLoadListener(function() { this._flashFrame.bitmap = Image; this._flashFrame.x = 0; this._flashFrame.y = 0; }.bind(this)); this.addChild(this._flashFrame); this.setWait(3) return } if (Image){ console.log(Image) } }; Scene_Evolution.prototype.initialize = function () { Scene_Base.prototype.initialize.call(this); this._sceneName = 'Scene_Evolution' this._waitCount = 1 this._currentFrame = 0 // this._background = '' // this._startSprite = '' // this._endSprite = '' // this._flashFrame = '' console.log('initialized') console.log(SceneManager._scene) this.endMusic() this.createFlashFrame() }; Scene_Evolution.prototype.create = function () { Scene_Base.prototype.create.call(this); }; Scene_Evolution.prototype.update() = function () { console.log('updated') this.updateWaitCount() this.createFlashFrame() $gameTimer.update(active); $gameScreen.update(); Scene_Base.prototype.update.call(this); } Scene_Evolution.prototype.setWait = function (time){ this._waitCount = time } Scene_Evolution.prototype.updateWaitCount() = function () { if (this._waitCount > 0) { this._waitCount--; return true; } return false; }
I originally had endMusic() and createFlashFrame() at the end of the plugin, but it said the function didn't exist. Even when I moved it to the beginning, however, it still didn't work although it stopped giving the error message.
EDIT: Just for clarity, I put displayEvolution() in another file to activate it. It seems to activate, given the battles don't end the way they did before, but just nothing in the new scene really does.