MV Requesting edits to JakeMSG_QTEWindow.js (extra button + wait times)

Hi! Sorry if the title explains the requests poorly, I'll explain in more detail what I need.
I'm here to humbly request a few edits to JakeMSG's QTE Window plugin.
Jake's QTE plugin works by creating a 'match the sequence' quick-time event window, in which players need to press the buttons that appear on-screen in the right order. If the player fails the sequence, the window closes, the skill is aborted, and the battle continues. And if the player succeeds in pressing the keys, then the skill goes works and the battle continues.



My first request is a simple one: currently, the plugin only supports the keys Z, X, Up, Down, Left and Right. I'd like to request that the C button be added as a compatible input for the quick-time events. I've tried to do it myself, but I'm unsure how to add C as a recognized key by RPGMaker, let alone by the plugin too.



My second request is a more important QOL feature, that being a short moment before the QTE timer starts for the player to look at the sequence and prepare, before the timer starts or runs out too quickly. I've made & attached a short mockup video below showing what it currently looks like, and how I'd like it to work.



Hopefully with this video you'd know what I mean by adding a new input button, too.



One more thing - I'm already using an edited version of this plugin, due to the version on the Forum page having a bug where the game crashes upon a game over. This isn't an issue now, but I'm just mentioning so anyone kind enough to take on these requests knows to download the version of the plugin I've linked just below.

Thanks so much to any who decides to read this or take the requests on!!
I added the "c", but you have to test it out, as the icon index 6, but
you need to see where it is placed, as I can't find any spots where it is added
than on 3 places.

keep in mind, than I did add the Input.keymapper[67] to is (which is the c.

I could make it cleaner, but if its modified differently, and altered, you could
make use of the entire keyboard though.
Hi! Thanks so much for the quick response, I really appreciate that you're helping me!

I've tried out the new plugin and there seems to be an issue... now, whenever I use a QTE skill, regardless of if it has the new 'c' key or not, it immediately fails without the window popping up.
I've attached a YouTube link of the new issue...



Sorry to be a bother, I do appreciate your help
I didn't mess with battle, so I tried to add where it seems be the most logical
places that uses the input, and where it is added.

so there may be a different spot I missed, but looking to it, did you alter this one?
```
* @param IconArray
* @desc The index of each icon to use for the display. [up,down,left,right,ok,cancel]
* @Default [12,13,14,15,28,29]
```
same for sound? which has also 5 entries (6 = 0), but you should match them.
if you did this to match, than I double check what I miss.

Edit:
I forgot 3 places, as checkFailure was one spot and 2 other places.
I re-upload the previous post with a new version.

if that doesn't work, than I don't know as I made a ocarina evented, but not for battle.
so if this one doesn't work, than I don't know what I miss though.
I've tried the new file but the same issue as in the second video persists...
Sorry for not clarifying it was for the battle, but I am thankful that you're putting in the time to help me
Hmmm, I just copied the code in 3 places for the other keys and added it for "c" at the end of the methods and it seemed to work for me (just tested the qte on map). But you need to add the c key to the keymap or whatever (or use a plugin that lets you add extra keys). I added at the bottom the keymap with 'c' added.

For your other question, isn't there a tip mode script in the plugin instructions, where you can set a delay before the timer start?
Like $gameMap.QTEt("QTE",5000,["normal"],300,["ok","up","left"],true)

c-key code in spoilers (edit: icon number for 'c' added in the code, instead of plugin settings)

Spoiler
Window_QTE.prototype.getIconIndex = function(string) {
var iconar = eval(PluginManager.parameters('JakeMSG_QTEWindow').IconArray);
switch (string) {
case "ok":
return iconar[4];
break;
case "cancel":
return iconar[5];
break;
case "up":
return iconar[0];
break;
case "down":
return iconar[1];
break;
case "left":
return iconar[2];
break;
case "right":
return iconar[3];
break;
case "c":
return 87;
break;
default:
return 0;
break;
}
}

//

Window_QTE.prototype.checkFailure = function() {
if (Input.isTriggered("up") && this._currentB !== "up") {
return false
} else if (Input.isTriggered("down") && this._currentB !== "down") {
return false
} else if (Input.isTriggered("left") && this._currentB !== "left") {
return false
} else if (Input.isTriggered("right") && this._currentB !== "right") {
return false
} else if (Input.isTriggered("ok") && this._currentB !== "ok") {
return false
} else if ((Input.isTriggered("cancel") || Input.isTriggered("escape")) && this._currentB !== "cancel") {
return false
} else if (Input.isTriggered("shift") && this._currentB !== "shift") {
return false
} else if (Input.isTriggered("menu") && this._currentB !== "menu") {
return false
} else if (Input.isTriggered("pageup") && this._currentB !== "pageup") {
return false
} else if (Input.isTriggered("pagedown") && this._currentB !== "pagedown") {
return false
} else if (Input.isTriggered("c") && this._currentB !== "c") {
return false
} else {
return true
}
}

//

Window_QTE.prototype.checkInput = function(endButton) {
if (Input.isTriggered("up") && (endButton !== "up")) {
return "up"
} else if (Input.isTriggered("down") && (endButton !== "down")) {
return "down"
} else if (Input.isTriggered("left") && (endButton !== "left")) {
return "left"
} else if (Input.isTriggered("right") && (endButton !== "right")) {
return "right"
} else if (Input.isTriggered("ok") && (endButton !== "ok")) {
return "ok"
} else if (Input.isTriggered("cancel") && (endButton !== "cancel")) {
return "cancel"
} else if (Input.isTriggered("shift") && (endButton !== "shift")) {
return "shift"
} else if (Input.isTriggered("menu") && (endButton !== "menu")) {
return "menu"
} else if (Input.isTriggered("pageup") && (endButton !== "pageup")) {
return "pageup"
} else if (Input.isTriggered("pagedown") && (endButton !== "pagedown")) {
return "pagedown"
} else if (Input.isTriggered("c") && (endButton !== "c")) {
return "c"
} else {
return 0
}
}

//

KEYMAP:

Input.keyMapper = {
9: 'tab', // tab
13: 'ok', // enter
16: 'shift', // shift
17: 'control', // control
18: 'control', // alt
27: 'escape', // escape
32: 'ok', // space
33: 'pageup', // pageup
34: 'pagedown', // pagedown
37: 'left', // left arrow
38: 'up', // up arrow
39: 'right', // right arrow
40: 'down', // down arrow
45: 'escape', // insert
81: 'pageup', // Q
87: 'pagedown', // W
88: 'escape', // X
90: 'ok', // Z
96: 'escape', // numpad 0
98: 'down', // numpad 2
100: 'left', // numpad 4
102: 'right', // numpad 6
104: 'up', // numpad 8
120: 'debug', // F9
67: 'c'
};
Okay, thank you!
So, just to clarify, I edit the plugin with those new updated lines of code for the C key?
Do you have a recommendation for a plugin for adding additional input keys?

Also, I had no idea about the tip mode... Sorry, that's on me!!
I had just one more question: When tip mode is active, it creates room in the window to add a tip, shown below:
1771787733299.png


I don't plan on adding any actual tips, so is there a way I can edit the plugin's code to reduce the window's size back down to 100px tall? I tried editing it in SRD's Menu Editor but it just reverts back every time...
Thanks so much for your help!

Quick edit: the C key edits worked!! Thank you so much, I really appreciate it!!
Yeah, you edit the plugin code.

For the tip window size, I think comment out some lines in these areas with //:
// if (this._tipped) {this.drawTip();}
and
// qte.height = qte.height + 100;
and
// if (tipMessage !== undefined) {qte._tipMessage = tipMessage};

I quickly tested it and the plugin seemed to have some bug where it didn't register the tip duration if I restarted the map qte after finishing it once. Does it work in battles normally?

For the c-key, I think you can just copy-paste the keymap code that I wrote above to notepad, save as .js file in plugin folder and add as a plugin. Like the code:

Input.keyMapper = {
9: 'tab', // tab
13: 'ok', // enter
16: 'shift', // shift
17: 'control', // control
18: 'control', // alt
27: 'escape', // escape
32: 'ok', // space
33: 'pageup', // pageup
34: 'pagedown', // pagedown
37: 'left', // left arrow
38: 'up', // up arrow
39: 'right', // right arrow
40: 'down', // down arrow
45: 'escape', // insert
81: 'pageup', // Q
87: 'pagedown', // W
88: 'escape', // X
90: 'ok', // Z
96: 'escape', // numpad 0
98: 'down', // numpad 2
100: 'left', // numpad 4
102: 'right', // numpad 6
104: 'up', // numpad 8
120: 'debug', // F9
67: 'c'
};

EDIT:
Ah okay, you got the c-keys working already, nice.
I commented those lines out like you said - the window size does go back to normal, but in battles it has a similar issue where it does register the tip duration but doesn't work properly - the tip duration is defined in frames, but with the edited code you need to put in an absurdly high amount of frames for it to register as a substantial amount of time before beginning, if that makes sense.
A strange bug to occur for only window size lines being edited... But I'm not sure how to fix it from there.
And yes, I got the C key working! Thank you for your advice there!!
The tip duration is in milliseconds not frames. So 2000 is 2 seconds.

Iirc when I tested it, the plugin was bugged on map before I made any edits (the tip duration didn't reset when interacting after the first time). So is that also happening in battle or with your settings? Or does everything else work if you take into account that the value is milliseconds?
I see, thank you!!

I appreciate your help, this does work as I'd like now. There aren't any issues with the tip duration not registering in the battle scene, even through different battles, which is good.

I just had one more question - which is purely for the game's polish, but I was just wondering if you'd know how to fix this...

The tip mode sort of makes the timer jump a little bit at the start after the tip duration time ends... as can be seen in this video



Is there any way to fix this? Alongside possibly the timer freezing a tiny moment after the it begins; I worry that the game might look rough around the edges with these jumps...

No worries at all if you're not sure, I'm very grateful for all your help!!!
Cool.

For your new questions, I've no interest to look at it so deeply. I would guess the first part has something to do with it turning that _frozen to true and false repeatedly in the methods and allowing the gauge to reduce slightly before it's stopped. But yeah, hope someone else can help you or you can hire some coder to look at it or get another plugin or ask AI LOL.

Original thread: https://forums.rpgmakerweb.com/threads/requesting-edits-to-jakemsg_qtewindow-js-extra-button-wait-times.182538/