I'm not sure if this is the right place for this, but I'm trying to create a custom plugin for myself. essentially, one of the grating points for working in RPGmaker for me is doing all the clicking around to create dialog. What I'd like to do is have pre-created Js objects that I can load in with plugin commands. Eventually they'd be exported from a folder elsewhere and imported into the plugin file. But this is my current code.
Basically what I'm running into is that it just adds each message to the current text box instead of waiting for the box to close and creating a new window. I've looked around but I haven't found any solutions. I just know that "setWaitMode" doesn't seem to work outside of script calls. I had considered awaiting a promise which would resolve when the current window is confirmed, but I can't seem to find documentation on the events that fire.
Can anyone help me figure out how to set the next window to wait on the current one?
JavaScript:
(function() {
const dialogs = {}
dialogs.testDialog = [
{
id: 1,
text: "Hey you guys whazzup",
},
{
id: 2,
text: "Not much bro."
}
]
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function (command, args) {
_Game_Interpreter_pluginCommand.call(this, command, args);
if(command === "dialog") {
const messages = dialogs[args[0]]
console.log(messages)
for (let message in messages) {
talk = messages[message]
Game_Interpreter.setWaitMode('message');
$gameMessage.add(`${talk.id}: ${talk.text}`);
}
}
}
})()
Basically what I'm running into is that it just adds each message to the current text box instead of waiting for the box to close and creating a new window. I've looked around but I haven't found any solutions. I just know that "setWaitMode" doesn't seem to work outside of script calls. I had considered awaiting a promise which would resolve when the current window is confirmed, but I can't seem to find documentation on the events that fire.
Can anyone help me figure out how to set the next window to wait on the current one?