- Joined
- Dec 16, 2017
- Messages
- 7
- Reaction score
- 0
- First Language
- Portuguese
- Primarily Uses
- RMMV
I'm trying to create a window in a new scene but it is throwing an error when calling HorzCommand (Window_Command)'s initialize.
The error log
My window's class
I'm new to scripting in RPGMMV, sorry if it's a dumb problem.
The error log
Code:
Window_Command.prototype.initialize@file:///C:/Users/kawthar/Desktop/Forge/js/rpg_windows.js:1300:5
Window_HorzCommand.prototype.initialize@file:///C:/Users/kawthar/Desktop/Forge/js/rpg_windows.js:1454:5
Window_ForgeCommand.prototype.initialize@file:///C:/Users/kawthar/Desktop/Forge/js/plugins/Forge.js:111:2
Window_ForgeCommand@file:///C:/Users/kawthar/Desktop/Forge/js/plugins/Forge.js:101:2
Scene_Forge.prototype.createForgeCommandWindow@file:///C:/Users/kawthar/Desktop/Forge/js/plugins/Forge.js:72:23
Scene_Forge.prototype.create@file:///C:/Users/kawthar/Desktop/Forge/js/plugins/Forge.js:65:2
SceneManager.changeScene@file:///C:/Users/kawthar/Desktop/Forge/js/rpg_managers.js:2005:13
SceneManager.updateMain@file:///C:/Users/kawthar/Desktop/Forge/js/rpg_managers.js:1982:13
SceneManager.update@file:///C:/Users/kawthar/Desktop/Forge/js/rpg_managers.js:1907:9
Code:
function Window_ForgeCommand() {
this.initialize.apply(this, arguments);
}
Window_ForgeCommand.prototype = Object.create(Window_HorzCommand.prototype);
Window_ForgeCommand.prototype.constructor = Window_ForgeCommand;
Window_ForgeCommand.prototype.initialize = (width, cantForge, cantDismantle) => {
this.windowWidth = width;
this.cantForge = cantForge;
this.cantDismantle = cantDismantle;
Window_HorzCommand.prototype.initialize.call(this, 0, 0);
}
Window_ForgeCommand.prototype.windowWidth = () => this.windowWidth ;
Window_ForgeCommand.prototype.maxCols = () => 3;
Window_ForgeCommand.prototype.makeCommandList = () => {
this.addCommand(Forge.forgeWindowName, 'forge', !this.cantForge);
this.addCommand(Forge.dismantleWindowName, 'dismantle', !this.cantDismantle);
this.addCommand(TextManager.cancel, 'cancel');
}


