Hello again. I am in a bit of a conundrum. I am trying to create a message box with a choice and text above it.
I have most of the script done, however, when the scene advances to the next frame, it shows a black screen (as planned) but no choice option or text.
I know I'm missing something important, but I can't figure out what it is.
Bascially, I copied to choice window in the javascript files, as well as added a new scene. Haven't figured out how to add a message to it above the choice window as the same window or if it's already been supplied.
Yes, I know I'm diving headfirst into javascript with little knowledge, but I found I can understand programming language a bit, it just takes a bit of logic. Still, sometimes, I hit snags here and there that I cannot figure out.
Here's my code:
As a last minute thought before I post this, I am beginning to think that RPGMaker MV didn't come with a default message and choice dialogue script. Which makes me think it's not as simple as copying and pasting. Anyone might know of a plugin that can simply create windows and options out of scratch for scenes?
NOTE: This dialogue and choice option is initialized before the map is drawn! And it's part of the main menu, so it won't simply be an event.
I have most of the script done, however, when the scene advances to the next frame, it shows a black screen (as planned) but no choice option or text.
I know I'm missing something important, but I can't figure out what it is.
Bascially, I copied to choice window in the javascript files, as well as added a new scene. Haven't figured out how to add a message to it above the choice window as the same window or if it's already been supplied.
Yes, I know I'm diving headfirst into javascript with little knowledge, but I found I can understand programming language a bit, it just takes a bit of logic. Still, sometimes, I hit snags here and there that I cannot figure out.
Here's my code:
JavaScript:
Scene_SubTitle.prototype.commandFifthGame = function() {
this._commandWindow.close();
SceneManager.push(Scene_NewGameQuery);
// BNTKids_Scene_Subtitle_Command_FifthGame.call(this);
};
// Scene_NewGameQuery
//-----------------------------------------------------------------------------
//Initializes the scene and adds message and choice options, and initializes
//command options.
function Scene_NewGameQuery(){
this.initialize.apply(this,arguments);}
Scene_NewGameQuery.prototype = Object.create(Scene_MenuBase.prototype);
Scene_NewGameQuery.prototype.constructor = Scene_NewGameQuery;
Scene_NewGameQuery.prototype.prepare = function() {
};
Scene_NewGameQuery.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
};
Scene_NewGameQuery.prototype.start = function() {
Scene_MenuBase.prototype.start.call(this);
}
Scene_NewGameQuery.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
Scene_Base.prototype.create.call(this);
this.createMessageWindow();
this.createCommandWindow();
};
Scene_NewGameQuery.prototype.update = function() {
Scene_MenuBase.prototype.update.call(this);
};
Scene_NewGameQuery.prototype.terminate = function() {
Scene_MenuBase.prototype.terminate.call(this);
};
Scene_NewGameQuery.prototype.createMessageWindow = function() {
this._messageWindow = new Window_NewGameQueryMessage();
this.addWindow(this._messageWindow);
};
Scene_NewGameQuery.prototype.createCommandWindow = function() {
this._choiceWindow = new Window_NewGameCommand();
this._choiceWindow.setHandler('Yes', this.commandYes.bind(this));
this._choiceWindow.setHandler('No', this.commandNo.bind(this));
this.addWindow(this._choiceWindow);
};
Scene_NewGameQuery.prototype.commandYes = function() {;
this._choiceWindow.close();
this.fadeOutAll();
// Change start point.
SceneManager.goto(Scene_LoadFifthGame_Step1);
};
Scene_NewGameQuery.prototype.commandNo = function() {
gameid = 5;
$dataSystem.startMapId = $dataSystem.coordlist[0].id;
$dataSystem.startX = $dataSystem.coordlist[0].x;
$dataSystem.startY = $dataSystem.coordlist[0].y;
DataManager.setupNewGame(gameid);
this._choiceWindow.close();
this.fadeOutAll();
// Change start point.
SceneManager.goto(Scene_Map);
};
//-----------------------------------------------------------------------------
// Window_NewGameCommand
//
// The window for selecting a variety of games on the title screen.
function Window_NewGameCommand() {
this.initialize.apply(this, arguments);
}
Window_NewGameCommand.prototype = Object.create(Window_Command.prototype);
Window_NewGameCommand.prototype.constructor = Window_NewGameCommand;
//==============================
// * Initialize
//==============================
Window_NewGameCommand.prototype.initialize = function() {
Window_Command.prototype.initialize.call(this, 0, 0);
this.updatePlacement();
this.openness = 0;
this.makeCommandList();
this.selectLast();
};
Window_NewGameCommand._lastCommandSymbol = null;
Window_NewGameCommand.initCommandPosition = function() {
this._lastCommandSymbol = null;
};
Window_NewGameCommand.prototype.windowWidth = function() {
return 240;
};
Window_NewGameCommand.prototype.updatePlacement = function() {
this.x = (Graphics.boxWidth - this.width) / 2;
this.y = Graphics.boxHeight - this.height - 96;
};
Window_NewGameCommand.prototype.makeCommandList = function() {
this.addCommand('Yes', 'Yes');
this.addCommand('No', 'No');
};
Window_NewGameCommand.prototype.isContinueEnabled = function() {
return DataManager.isAnySavefileExists();
};
Window_NewGameCommand.prototype.processOk = function() {
Window_NewGameCommand._lastCommandSymbol = this.currentSymbol();
Window_Command.prototype.processOk.call(this);
};
Window_NewGameCommand.prototype.selectLast = function() {
if (Window_NewGameCommand._lastCommandSymbol) {
this.selectSymbol(Window_NewGameCommand._lastCommandSymbol);
}
};
//-----------------------------------------------------------------------------
// Window_NewGameQueryMessage
//
// The window for displaying text messages.
function Window_NewGameQueryMessage() {
this.initialize.apply(this, arguments);
}
Window_NewGameQueryMessage.prototype = Object.create(Window_Message.prototype);
Window_NewGameQueryMessage.prototype.constructor = Window_NewGameQueryMessage;
Window_NewGameQueryMessage.prototype.initialize = function() {
var width = this.windowWidth();
var height = this.windowHeight();
var x = (Graphics.boxWidth - width) / 2;
Window_Base.prototype.initialize.call(this, x, 0, width, height);
this.openness = 0;
this.initMembers();
this.createSubWindows();
this.updatePlacement();
};
Window_NewGameQueryMessage.prototype.initMembers = function() {
this._imageReservationId = Utils.generateRuntimeId();
this._background = 0;
this._positionType = 1;
this._waitCount = 0;
this._faceBitmap = null;
this._textState = null;
this.clearFlags();
};
Window_NewGameQueryMessage.prototype.subWindows = function() {
return [this._choiceWindow];
};
Window_NewGameQueryMessage.prototype.createSubWindows = function() {
this._goldWindow = new Window_Gold(0, 0);
this._goldWindow.x = Graphics.boxWidth - this._goldWindow.width;
this._goldWindow.openness = 0;
this._choiceWindow = new Window_NewGameQuery(this);
this._numberWindow = new Window_NumberInput(this);
this._itemWindow = new Window_EventItem(this);
};
//-----------------------------------------------------------------------------
// Window_NewGameQuery
//
// The window for selecting a command on the menu screen.
function Window_NewGameQuery() {
this.initialize.apply(this, arguments);
}
Window_NewGameQuery.prototype = Object.create(Window_Command.prototype);
Window_NewGameQuery.prototype.constructor = Window_NewGameQuery;
Window_NewGameQuery.prototype.initialize = function(x, y) {
Window_Command.prototype.initialize.call(this, x, y);
this.selectLast();
};
Window_NewGameQuery._lastCommandSymbol = null;
Window_NewGameQuery.initCommandPosition = function() {
this._lastCommandSymbol = null;
};
Window_NewGameQuery.prototype.windowWidth = function() {
return 240;
};
Window_NewGameQuery.prototype.numVisibleRows = function() {
return 2;
};
Window_NewGameQuery.prototype.makeCommandList = function() {
this.addYesNoCommands();
};
Window_NewGameQuery.prototype.addYesNoCommands = function() {
this.addCommand('Yes', 'Yes', true);
this.addCommand('No', 'No', true);
};
Window_NewGameQuery.prototype.selectLast = function() {
this.selectSymbol(Window_MenuCommand._lastCommandSymbol);
};
As a last minute thought before I post this, I am beginning to think that RPGMaker MV didn't come with a default message and choice dialogue script. Which makes me think it's not as simple as copying and pasting. Anyone might know of a plugin that can simply create windows and options out of scratch for scenes?
NOTE: This dialogue and choice option is initialized before the map is drawn! And it's part of the main menu, so it won't simply be an event.