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
Regular
Joined
Jul 26, 2016
Messages
455
Reaction score
1,215
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

Regular
Regular
Joined
Jun 25, 2021
Messages
1,100
Reaction score
1,601
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
Regular
Joined
Jul 26, 2016
Messages
455
Reaction score
1,215
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

Regular
Regular
Joined
Jun 25, 2021
Messages
1,100
Reaction score
1,601
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
Regular
Joined
Jul 26, 2016
Messages
455
Reaction score
1,215
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

Regular
Regular
Joined
Jun 25, 2021
Messages
1,100
Reaction score
1,601
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
Regular
Joined
Jul 26, 2016
Messages
455
Reaction score
1,215
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
5,047
Reaction score
4,405
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

It's been long time since last I'm tinkering with RPG Maker ~
Turns out. I wasn't in my head accounting for when the Actor doesn't have a weapon equipped but DOES still have a Grimoire equipped... 40+ SV Spritesheets!!! D'x
Elemental chart based on taoism could be interesting.
Taotypes.png
Come and join me in 10 minutes for Trihan's Challenge Hour, where I'll be attempting a game of Cartographers where I can only position terrain in the orientation on the explore card! Following that will be the Wifestream, where Kytt will be trying out From Space for the first time! https://twitch.tv/trihanstreams
F***, I promised myself not to make overlong intros anymore, but the dialogues are again getting out of hand in a very visual novel kind of way, and there's only two fights against bats in between them...well, at least there's going to be a proper area with fights after this intro sequence. And the intro is a bit more lively with several locations and different scenes.

Forum statistics

Threads
135,044
Messages
1,253,265
Members
178,021
Latest member
Alcarin
Top