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
424
Reaction score
1,168
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
616
Reaction score
612
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
424
Reaction score
1,168
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
616
Reaction score
612
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
424
Reaction score
1,168
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
616
Reaction score
612
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
424
Reaction score
1,168
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,924
Reaction score
2,982
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 Threads

Latest Posts

Latest Profile Posts

Sometimes I wonder why I still try and recruit others to help with my games. It never works.
ScreenShot_10_3_2022_4_27_17.png
welp, thanks to Luna MV, I was able to add the Balloon as a window... thus allowing me to edit the font color and outline... so now it looks like comic bubbles above characters. I have NO idea why I couldn't get this to work through more conventional means, but here we are.
CUTE CUTE CUTE.gif
I cannot cease doing cute art
War and Wonder is a 100% choice-based open-world visual novel.
1664821313732.png
1664821466359.png
1664821547746.png
Going live soon on Twitch, and will continue Fortunastreet's game "Verloren". For those who are curious, you are welcome to join ;)

-> Franz' Twitch channel

Forum statistics

Threads
125,759
Messages
1,173,275
Members
164,917
Latest member
meshowz
Top