RMMZ Is there a way to bind a fix set of keys/shortcuts to actor battle command window?

Status
Not open for further replies.

dragoonwys

Freelance Illustrator
Veteran
Joined
Jul 26, 2016
Messages
422
Reaction score
1,162
First Language
english
Primarily Uses
RMMV
Hello! Thank you for reading. I was wondering is there a way to bind a fixed set of keys to the battle command window for actors?

For example, if you press 'W' it selects/triggers whatever is in the first option or Index(0)
and if you press 'A' it selects whatever is in Index(1) ect regardless of what is there

It's suppose to behave like a shortcut alternative to 'press arrow button, then Enter' motion and doesn't change any interaction with sub menus like skills or item if any. Example, if the first option was Attack, pressing 'W' registers like clicking on it. If the 4th option was Items, pressing 'D' will open up the item menu like usual.



example.png
 

Arthran

Veteran
Veteran
Joined
Jun 25, 2021
Messages
604
Reaction score
599
First Language
English
Primarily Uses
RMMZ
Yeah, that's 100% possible, and shouldn't be too difficult. Unfortunately, I'm not at my regular PC right now, so I can't access the core scripts in order to tell you how to do it.
 

dragoonwys

Freelance Illustrator
Veteran
Joined
Jul 26, 2016
Messages
422
Reaction score
1,162
First Language
english
Primarily Uses
RMMV
Ah no problem! Thank you for reading my post ^^
I know how to add WASD player movement to the corescript but when it comes to battle Im not sure what direction to go.
 

Arthran

Veteran
Veteran
Joined
Jun 25, 2021
Messages
604
Reaction score
599
First Language
English
Primarily Uses
RMMZ
Ah no problem! Thank you for reading my post ^^
I know how to add WASD player movement to the corescript but when it comes to battle Im not sure what direction to go.
Are you going to be using WASD for player movement as well? If so, that will slightly change how you should go about this.
 

dragoonwys

Freelance Illustrator
Veteran
Joined
Jul 26, 2016
Messages
422
Reaction score
1,162
First Language
english
Primarily Uses
RMMV
No, I won't be using WASD for player movement. It is still the arrow keys for movements.
WASD will be specifically used only in this particular scene/situation
 

Arthran

Veteran
Veteran
Joined
Jun 25, 2021
Messages
604
Reaction score
599
First Language
English
Primarily Uses
RMMZ
I haven't tested it, but try this and see if it works:

JavaScript:
(() => {
    Input.keyMapper[65] = 'select1';  // a
    Input.keyMapper[68] = 'select3';  // d
    Input.keyMapper[69] = 'pagedown'; // e
    Input.keyMapper[83] = 'select2';  // s
    Input.keyMapper[87] = 'select0';  // w

    const _Window_ActorCommand_update = Window_ActorCommand.prototype.update;
    Window_ActorCommand.prototype.update = function() {
        this.processHotKeys();
        _Window_ActorCommand_update.call(this);
    };

    const _Window_PartyCommand_update = Window_PartyCommand.prototype.update;
    Window_PartyCommand.prototype.update = function() {
        this.processHotKeys();
        _Window_PartyCommand_update.call(this);
    };

    Window_Selectable.prototype.processHotKeys = function() {
        if (this.isCursorMovable()) {
            if (Input.isRepeated('select0')) {
                this.select(0);
                this.processOk();
            }
            if (Input.isRepeated('select1')) {
                this.select(1);
                this.processOk();
            }
            if (Input.isRepeated('select2')) {
                this.select(2);
                this.processOk();
            }
            if (Input.isRepeated('select3')) {
                this.select(3);
                this.processOk();
            }
        }
    };
})();
 
Last edited:

dragoonwys

Freelance Illustrator
Veteran
Joined
Jul 26, 2016
Messages
422
Reaction score
1,162
First Language
english
Primarily Uses
RMMV
@Arthran Yes, that definitely works! ^^
And I see, so this is how it looks like on the inside.
I learnt a lot here, thank you very much for the help
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,902
Reaction score
2,963
First Language
EN
Primarily Uses
RMMZ

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Posts

Latest Profile Posts


Clarn Hold
(No storylines)
There was a tutorial on how to draw anime eyes. Just draw Among Us. So I tried.
Screenshot_107.jpg
DamageActor3_7.png added!
index.php

Making a "characters first appearance" drawing for my game. Now I just have to finish the sprite art animation for her grand entrance.​
ScreenShot_9_24_2022_7_56_24.png
New area being started today. It leads to one of the games 2 optional bosses.

Forum statistics

Threads
125,537
Messages
1,171,803
Members
164,608
Latest member
royeventcompany
Top