MV Prevent holding certain buttons from skipping dialogue

Hi yall, just a simple question:

I'd like to prevent the dialogue from advancing if you're holding certain buttons, some players accidentally skip some text boxes because of this.

I am aware of Galenmereth's No Fast Forward Plugin which does exactly what I'm asking for, however I'd also like to be able to keep using the PgDn/Numpab 3 button to fast forward through dialogue.

What it boils down to: Prevent the players from fast forwarding dialogue with the regular buttons, but keep the fast forward with the PgDn/Numpad3 button.

Hope someone has an idea how to do this 🙂

​

Considering that PageDown is already a mapped key in RPG_CORE, it's not difficult to simply override the functions responsible for fast-forwarding.

rpg_core.js -> line 3036:
Code:
Input.gamepadMapper = {
    0: 'ok',        // A
    1: 'cancel',    // B
    2: 'shift',     // X
    3: 'menu',      // Y
    4: 'pageup',    // LB
    5: 'pagedown',  // RB
    12: 'up',       // D-pad up
    13: 'down',     // D-pad down
    14: 'left',     // D-pad left
    15: 'right',    // D-pad right
};

Simply create a plugin and include the following script:
JavaScript:
(function() {
    const FastForward = 'pagedown';

    /* rpg_window.js:4454 */
    Window_Message.prototype.isTriggered = function() {
        return (Input.isRepeated(FastForward) || Input.isRepeated('cancel') ||
                TouchInput.isRepeated());
    };

    /* rpg_window.js:4633 */
    Window_ScrollText.prototype.isFastForward = function() {
        if ($gameMessage.scrollNoFast()) {
            return false;
        } else {
            return (Input.isPressed(FastForward) || Input.isPressed('shift') ||
                    TouchInput.isPressed());
        }
    };

    /* rpg_window.js:4845 */
    Window_BattleLog.prototype.isFastForward = function() {
        return (Input.isLongPressed(FastForward) || Input.isPressed('shift') ||
                TouchInput.isLongPressed());
    };

    /* rpg_scene.js:614 */
    Scene_Map.prototype.isFastForward = function() {
        return ($gameMap.isEventRunning() && !SceneManager.isSceneChanging() &&
                (Input.isLongPressed(FastForward) || TouchInput.isLongPressed()));
    };
})();
Hi thanks for reaching out!
I just tried the Plugin you made, but now I'm unable to advance the text with space/Z at all?
Did I do something wrong?

Edit: I realize that I didn't specify that I still want the player to advance text with Z/space, but not fast forward through it ^^,
I'm also using YEP_MessageCore
I have a function inside my MV base use the escape code "\SM" or "\STOP"
which allow you to stop the message at a certain point from skipping.

this can be added on each message so they are forced to repress
the button again.

I also have fastforward for autorun events automatically so they can't
skip that, but I need to add a function for flexible as I find galenmereth not
work and work normally after the first message.
Unfortunatly, adding commands to all my text boxes is not an option for me, it'll take ages to correct every single text box in the project 🙁
Do you need this part at all in the plugin? Just try and remove it.

/* rpg_window.js:4454 */
Window_Message.prototype.isTriggered = function() {
return (Input.isRepeated(FastForward) || Input.isRepeated('cancel') ||
TouchInput.isRepeated());
};
Removing those lines of code seems to disable the plugin, holding Z or space still advances the text boxes
Ah yeah I guess I didn't focus on what I was reading LOL.

I think it works if you add in the plugin Window_Message.prototype.isTriggered OR statements also the original Input.isRepeated('ok')

and add in the plugin

Window_Message.prototype.updateShowFast = function() {
if (Input.isRepeated(FastForward)) {
this._showFast = true;
}
};

But yeah, if that don't work, I'll let the other dudes answer you.
I may be able to add something when using "ok" button to automate to
add an "\STOP" after the text so they must retrigger.

as the trigger require to have input repeated and input interval to be reset.
something I did in my base plugin, so I could extend it a little to include
the "\SM" or "\STOP" after each text, so you don't have to add it manually.

it may be used when a switch is ON, just in case you don't want it on each
text message in the game, only on some places.
I really focused on that part of the request, but it seems they've already resolved it.
Prevent the players from fast forwarding dialogue with the regular buttons, but keep the fast forward with the PgDn/Numpad3 button

For the record, the Z and Enter keys correspond to this:
JavaScript:
0: 'ok', // A

So if you want to change or reduce the keys corresponding to the Decision Key this plugin I sent is useless for that, but I need to be sure that's what you really need.
Window_Message.prototype.updateShowFast = function() {
if (Input.isRepeated(FastForward)) {
this._showFast = true;
}
};

I've tried this, but I'm still able to advance the dialogue by holding Z/Space, did I do this wrong?
Spoiler: JS Example
(function() {
const FastForward = 'pagedown';

/* rpg_window.js:4454 */
Window_Message.prototype.isTriggered = function() {
return (Input.isRepeated(FastForward) || Input.isRepeated('cancel') ||
TouchInput.isRepeated()); || Input.isRepeated('ok')
};

/* rpg_window.js:4633 */
Window_ScrollText.prototype.isFastForward = function() {
if ($gameMessage.scrollNoFast()) {
return false;
} else {
return (Input.isPressed(FastForward) || Input.isPressed('shift') ||
TouchInput.isPressed());
}
};

/* rpg_window.js:4845 */
Window_BattleLog.prototype.isFastForward = function() {
return (Input.isLongPressed(FastForward) || Input.isPressed('shift') ||
TouchInput.isLongPressed());
};

/* rpg_scene.js:614 */
Scene_Map.prototype.isFastForward = function() {
return ($gameMap.isEventRunning() && !SceneManager.isSceneChanging() &&
(Input.isLongPressed(FastForward) || TouchInput.isLongPressed()));
};

Window_Message.prototype.updateShowFast = function() {
if (Input.isRepeated(FastForward)) {
this._showFast = true;
}
};

})();
Thanks for trying to get this to work yall 🙂
You don't need to resend the entire plugin (without modifications)

I tested it and it works, considering that the Z key and Enter key correspond to the 'ok' mapping, as I said in the previous message.
I'll be honest, I'm getting kind of lost.
I've added what rpgLord69 said to the plugin (like in the example)
I've tried it on a new project, but still I'm able to fly past the text boxed when I keep holding 'ok'

I do not wish to remap any buttons, just prevent the text boxes from advancing when you keep holding 'ok', but still be able to advance it with 'ok'

I appreciate the help, I'm just a little bit confused rn
In the code you posted you have a semicolon in the middle

TouchInput.isRepeated()); || Input.isRepeated('ok')
Oh my god you're right, I've been staring at this for so long and didn't even see that. It works perfectly now! Thank so much yall!

Original thread: https://forums.rpgmakerweb.com/threads/prevent-holding-certain-buttons-from-skipping-dialogue.181063/