I wrote this simple JS script:
/*: * @plugindesc Simple scene that doesn't do . * @author Ryth * @*/(function() { var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; Game_Interpreter.prototype.pluginCommand = function (command, args) { _Game_Interpreter_pluginCommand.call(this, command, args); if (command === 'SimpleWindow') { switch (args[0]) { case 'open': SceneManager.push(Scene_Simple); break; } } }; function Scene_Simple() { this.initialize.apply(this, arguments); } Scene_Simple.prototype = Object.create(Scene_Base.prototype); Scene_Simple.prototype.constructor = Scene_Simple; Scene_Simple.prototype.initialize = function () { Scene_Base.prototype.initialize.call(this); }; Scene_Simple.prototype.create = function () { Scene_Base.prototype.create.call(this); var _wind = new Window_Greeting(); this.addWindow(_wind); }; function Window_Greeting() { this.initialize.apply(this, arguments); } Window_Greeting.prototype = Object.create(Window_Base.prototype); Window_Greeting.prototype.constructor = Window_Greeting; Window_Greeting.prototype.initialize = function () { var width = Graphics.boxWidth; var height = Graphics.boxHeight / 2; Window_Base.prototype.initialize.call(this, 0, 0, width, height); var padding = 10; //this.drawText("Swir Ssie", padding, Graphics.boxHeight / 4, Graphics.boxWidth - (2 * padding), 'center'); };})();Can someone point me in the right direction? I don't know what I'm doing wrong here. When I use the plugin command I get an error:
Type Error: Can't get property 'addChild' of undefined.
/*: * @plugindesc Simple scene that doesn't do . * @author Ryth * @*/(function() { var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; Game_Interpreter.prototype.pluginCommand = function (command, args) { _Game_Interpreter_pluginCommand.call(this, command, args); if (command === 'SimpleWindow') { switch (args[0]) { case 'open': SceneManager.push(Scene_Simple); break; } } }; function Scene_Simple() { this.initialize.apply(this, arguments); } Scene_Simple.prototype = Object.create(Scene_Base.prototype); Scene_Simple.prototype.constructor = Scene_Simple; Scene_Simple.prototype.initialize = function () { Scene_Base.prototype.initialize.call(this); }; Scene_Simple.prototype.create = function () { Scene_Base.prototype.create.call(this); var _wind = new Window_Greeting(); this.addWindow(_wind); }; function Window_Greeting() { this.initialize.apply(this, arguments); } Window_Greeting.prototype = Object.create(Window_Base.prototype); Window_Greeting.prototype.constructor = Window_Greeting; Window_Greeting.prototype.initialize = function () { var width = Graphics.boxWidth; var height = Graphics.boxHeight / 2; Window_Base.prototype.initialize.call(this, 0, 0, width, height); var padding = 10; //this.drawText("Swir Ssie", padding, Graphics.boxHeight / 4, Graphics.boxWidth - (2 * padding), 'center'); };})();Can someone point me in the right direction? I don't know what I'm doing wrong here. When I use the plugin command I get an error:
Type Error: Can't get property 'addChild' of undefined.