Hello,
Like said in the title I'm trying to add a scene on top of another scene, but when I do that it terminates the first scene, and when the second scene is closed, the first one reinitializes.
My first scene:
In the update function I call another plugin which will push another scene:
And in the other plugin:
So what it does here is: load the first scene, at some point, the first scene will call the other plugin which will push another scene, but the first scene will terminate itself (call the stop and terminate function), after the second scene finished doing its thing, I will pop the scene so it goes back to the first one. But when I do that, it will call the initialize function again, and reload everything like it loaded the first time. So it completely resets.
But from what I understood, when you push a scene it shouldn't do that, it should just put the first scene in pause and resume when the second scene is over.
Do you know how I could fix this ?
I'm sorry if my explanation isn't very good, feel free to ask for more information
Like said in the title I'm trying to add a scene on top of another scene, but when I do that it terminates the first scene, and when the second scene is closed, the first one reinitializes.
My first scene:
JavaScript:
PluginManager.registerCommand(plugin_name, "battle_1_1", () => {
SceneManager.push(Scene_P1_Card_Battle);
})
function Scene_P1_Card_Battle() { Scene_Base.call(this) }
Scene_P1_Card_Battle.prototype = Object.create(Scene_Base.prototype)
Scene_P1_Card_Battle.prototype.constructor = Scene_P1_Card_Battle
Scene_P1_Card_Battle.prototype.initialize = function() {
Scene_Base.prototype.initialize.call(this)
this.load_data()
this.load_sprites()
}
Scene_P1_Card_Battle.prototype.create = function() {
Scene_Base.prototype.create.call(this)
}
Scene_P1_Card_Battle.prototype.start = function() {
Scene_Base.prototype.start.call(this);
}
In the update function I call another plugin which will push another scene:
JavaScript:
if (!this.dialogue_called) {
this.dialogue_called = true
PluginManager.callCommand(this, "cool_dialogues", this.cutscenes[this.current_cutscene].name, {})
}
And in the other plugin:
JavaScript:
PluginManager.registerCommand(pluginName, "C1_1_battle_intro", () => {
SceneManager.push(Cool_Dialogues);
})
function Cool_Dialogues() {
this.initialize(...arguments)
}
Cool_Dialogues.prototype = Object.create(Scene_Base.prototype)
Cool_Dialogues.prototype.constructor = Cool_Dialogues
So what it does here is: load the first scene, at some point, the first scene will call the other plugin which will push another scene, but the first scene will terminate itself (call the stop and terminate function), after the second scene finished doing its thing, I will pop the scene so it goes back to the first one. But when I do that, it will call the initialize function again, and reload everything like it loaded the first time. So it completely resets.
But from what I understood, when you push a scene it shouldn't do that, it should just put the first scene in pause and resume when the second scene is over.
Do you know how I could fix this ?
I'm sorry if my explanation isn't very good, feel free to ask for more information