RPG Maker Forums

Hello, I am trying to create a simple plugin that adds a confirmation window after the last actor in the party selects their action. A window should pop up in the middle of the screen asking if the player wishes to continue with the action. I am making this plugin for players just in case they select too fast and want to think things over. I have some Javascript and programming knowledge, but little knowledge of how the code structure of RMMV works. I'm still figuring that out!

The logic flow for this plugin should be like so:
  1. After last actor selects an action, open window.
  2. If 'confirm' is selected, startTurn();
  3. Else if 'cancel' is selected: return back to PartyCommandWindow.
This is a snippet of what I have so far:

Code:
function Window_ActionConfirm() {
  this.initialize.apply(this, arguments);
}

Window_ActionConfirm.prototype = Object.create(Window_Command.prototype);
Window_ActionConfirm.prototype.constructor = Window_Command;

Window_ActionConfirm.prototype.windowWidth = function() {
  return 300;
};

Window_ActionConfirm.prototype.windowHeight = function() {
  return this.fittingHeight(3);
};

Window_ActionConfirm.prototype.makeCommandList = function() {
  this.addCommand("Confirm Actions", 'confirm');
  this.addCommand("Cancel", 'cancel');
};

BattleManager.selectNextCommand = function() {
    do {
        if (!this.actor() || !this.actor().selectNextCommand()) {
            this.changeActor(this._actorIndex + 1, 'waiting');
            if (this._actorIndex >= $gameParty.size()) {
                //open confirm window here
                this._actionConfirmWindow = new Window_ActionConfirm(640, 360);
                // if confirm is selected, startTurn, else return to the beginning.
                this.startTurn();
                break;
            }
        }
    } while (!this.actor().canInput());
};
The trouble I'm having is within the BattleManager.selectNextCommand function. I'm not sure how to bind the 'confirm' and 'cancel' actions appropriately to do as I described. Can anyone help me with this? I feel like I'm almost there.

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,034
Messages
1,018,446
Members
137,820
Latest member
georg09byron
Top