じ☆ve冰风 发表于 7 天前

Learning to make proper Scenes [SOLVED]

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_BattleScene_Battle.prototype.displayEvolution = function () {   SceneManager.push(Scene_Evolution) }//Scene_Evolutionfunction 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 += 1var 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.


本贴来自国际rpgmaker官方论坛作者:SJFzone处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/learning-to-make-proper-scenes-solved.183260/
页: [1]
查看完整版本: Learning to make proper Scenes [SOLVED]