Hi everyone, just as the title suggest. I'm trying to create a custom command window with options that will open another custom scene that I'm working on, and so far I'm having a trouble at this command window. I got the thing working, but for some reason the text aren't showing up and just looks like this.
This is just some random window that I'm fiddling around with to try and figure out how things work. I was hoping to get it to look like this at the end.
Here's the code that I'm working on. I replaced the custom scenes that it's supposed to push with already existing scenes for testing purposes.
I have 0 knowledge in javascript and don't have any coding experience and just got here by watching some youtube videos and fiddling around rpg maker mv's source code and frankenstining things. If somebody can explain what's going on here or point me in the right direction, or better, know a plugin that can get something similar to what I plan it to look like in the end to avoid coding things altogether I'd be extremely happy (I'm working on this for almost a week now ToT) Thanks in advance.
This is just some random window that I'm fiddling around with to try and figure out how things work. I was hoping to get it to look like this at the end.
Here's the code that I'm working on. I replaced the custom scenes that it's supposed to push with already existing scenes for testing purposes.
JavaScript:
function Scene_Datab() {
this.initialize.apply(this, arguments);
}
Scene_Datab.prototype = Object.create(Scene_MenuBase.prototype);
Scene_Datab.prototype.constructor = Scene_Datab;
Scene_Datab.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
};
Scene_Datab.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this.createCommandWindow();
};
Scene_Datab.prototype.createCommandWindow = function() {
this._commandWindow = new Window_DataCommand(109, 217);
this._commandWindow.setHandler('option1', this.commandOption1.bind(this));
this._commandWindow.setHandler('option2', this.commandOption2.bind(this));
this._commandWindow.setHandler('option3', this.commandOption3.bind(this));
this._commandWindow.setHandler('option4', this.commandOption4.bind(this));
this.addWindow(this._commandWindow);
};
Scene_Datab.prototype.commandOption1 = function() {
SceneManager.push(Scene_Item);
};
Scene_Datab.prototype.commandOption2 = function() {
SceneManager.push(Scene_Options);
};
Scene_Datab.prototype.commandOption3 = function() {
SceneManager.push(Scene_Save);
};
Scene_Datab.prototype.commandOption4 = function() {
SceneManager.push(Scene_GameEnd);
};
//////////////////////////////////////
function Window_DataCommand() {
this.initialize.apply(this, arguments);
}
Window_DataCommand.prototype = Object.create(Window_Command.prototype);
Window_DataCommand.prototype.constructor = Window_DataCommand;
Window_DataCommand.prototype.initialize = function(x, y) {
Window_Command.prototype.initialize.call(this, x, y);
this.selectLast();
};
Window_DataCommand._lastCommandSymbol = null;
Window_DataCommand.initCommandPosition = function() {
this._lastCommandSymbol = null;
};
Window_DataCommand.prototype.windowWidth = function() {
return 240;
};
Window_DataCommand.prototype.numVisibleRows = function() {
return this.maxItems();
};
Window_DataCommand.prototype.makeCommandList = function() {
this.addOption1Command();
this.addOption2Command();
this.addOption3Command();
this.addOption4Command();
};
Window_DataCommand.prototype.addOption1Command = function() {
this.addCommand(TextManager.option1, 'option1');
};
Window_DataCommand.prototype.addOption2Command = function() {
this.addCommand(TextManager.option2, 'option2');
};
Window_DataCommand.prototype.addOption3Command = function() {
this.addCommand(TextManager.option3, 'option3');
};
Window_DataCommand.prototype.addOption4Command = function() {
this.addCommand(TextManager.option4, 'option4');
};
Window_DataCommand.prototype.needsCommand = function(name) {
var flags = $dataSystem.menuCommands;
if (flags) {
switch (name) {
case 'option1':
return flags[0];
case 'option2':
return flags[1];
case 'option3':
return flags[2];
case 'option4':
return flags[3];
}
}
return true;
};
Window_DataCommand.prototype.processOk = function() {
Window_DataCommand._lastCommandSymbol = this.currentSymbol();
Window_Command.prototype.processOk.call(this);
};
Window_DataCommand.prototype.selectLast = function() {
this.selectSymbol(Window_DataCommand._lastCommandSymbol);
};
I have 0 knowledge in javascript and don't have any coding experience and just got here by watching some youtube videos and fiddling around rpg maker mv's source code and frankenstining things. If somebody can explain what's going on here or point me in the right direction, or better, know a plugin that can get something similar to what I plan it to look like in the end to avoid coding things altogether I'd be extremely happy (I'm working on this for almost a week now ToT) Thanks in advance.