RMMV How to Change navegation Keys for the actorWindow

STARFALL

Core of the Stars
Veteran
Joined
Jul 6, 2020
Messages
271
Reaction score
73
First Language
spanish
Primarily Uses
RMMV
Hey guys, do you guys know how to switch between actors using the left and right buttons in the actor selection window when you're using an ability that selects allies in battle? You know that window that pops up in battle to heal allies and stuff, normally it only works for me with up and down but since my interface is different (really different) I need it so I can use left and right there too.
i talk about the actorWindow
 

Matrien

Villager
Member
Joined
Aug 23, 2020
Messages
17
Reaction score
6
First Language
English
Primarily Uses
RMMV
JavaScript:
//=============================================================================
// MTC_CycleTargetActorWithRightAndLeftKeys.js
//=============================================================================
/*:
@plugindesc Changes the default controls to use the right and left keys to cycle through 
target actors instead of up and down
@author Matrien Cadrack
@help
==Details==
The Battle Actor window is used to select an actor as the target of a skill 
when in combat, such as when using a common heal skill.

This plugin creates unique cursor direction functions for the Battle Actor 
window that simply copy the original Selectable Window versions, but with the 
content of cursorDown swapped with that of cursorRight and the content of 
cursorUp swapped with that of cursorLeft so that when in the Battle Actor 
window, players will cycle through actors using the right and left keys 
instead of the up and down keys used by default.

==Instructions==
Plug and play

==Terms of Use==
Free for use in commercial and non-commercial projects
Credit is appreciated, but not necessary
*/
Window_BattleActor.prototype.cursorDown = function(wrap) {
    var index = this.index();
    var maxItems = this.maxItems();
    var maxCols = this.maxCols();
    if (maxCols >= 2 && (index < maxItems - 1 || (wrap && this.isHorizontal()))) {
        this.select((index + 1) % maxItems);
    }
};
        
Window_BattleActor.prototype.cursorUp = function(wrap) {
    var index = this.index();
    var maxItems = this.maxItems();
    var maxCols = this.maxCols();
    if (maxCols >= 2 && (index > 0 || (wrap && this.isHorizontal()))) {
        this.select((index - 1 + maxItems) % maxItems);
    }
};
        
Window_BattleActor.prototype.cursorRight = function(wrap) {
    var index = this.index();
    var maxItems = this.maxItems();
    var maxCols = this.maxCols();
    if (index < maxItems - maxCols || (wrap && maxCols === 1)) {
        this.select((index + maxCols) % maxItems);
    }
};
        
Window_BattleActor.prototype.cursorLeft = function(wrap) {
    var index = this.index();
    var maxItems = this.maxItems();
    var maxCols = this.maxCols();
    if (index >= maxCols || (wrap && maxCols === 1)) {
        this.select((index - maxCols + maxItems) % maxItems);
    }
};

I think this may achieve what you want, though based on the fact that you have a "really different" interface, I would guess you are already using other plugins that impact some of the battle windows, which could lead to compatibility issues.

Give it a try and if it doesn't work, reply with a screen shot of your plugin manager and I may be able to figure out a workaround.
 

STARFALL

Core of the Stars
Veteran
Joined
Jul 6, 2020
Messages
271
Reaction score
73
First Language
spanish
Primarily Uses
RMMV
Is just a interface focused in first person view, i try the plugin but nothing happen.

As you can see in the image below, when you select a player I make them be marked with that yellow frame, but since my interface order is horizontal, it looks weird having to switch between them using up and down, for the sake of my project need Left and R. XD
 

Attachments

  • 20220116_171507.png
    20220116_171507.png
    389.2 KB · Views: 3

Matrien

Villager
Member
Joined
Aug 23, 2020
Messages
17
Reaction score
6
First Language
English
Primarily Uses
RMMV
What plugin are you using to get that interface? It appears to be bypassing the usual actor select window entirely, which would explain why the plugin does not work for you. If I know what you are using, it should be possible to get it working with a similar fix designed for that specific plugin, but without seeing the plugin code, there is no way to modify it to get the effect you want.
 

STARFALL

Core of the Stars
Veteran
Joined
Jul 6, 2020
Messages
271
Reaction score
73
First Language
spanish
Primarily Uses
RMMV
Sorry I was busy this past days, finally i re-copy the script and work, i think that the first time i was missing something. This time the Plugin work perfectly <3
Really thanks you!! :)
 

Matrien

Villager
Member
Joined
Aug 23, 2020
Messages
17
Reaction score
6
First Language
English
Primarily Uses
RMMV
Awesome! I am glad it is doing what you need :)
 

Latest Threads

Latest Posts

Latest Profile Posts

I_got_lonely.jpg
So I was working with the save system (yes I'm going to at least use RM's save system, I'm not a total monster)... And I realized I was lonely so I brought along some friends to test stuff out. :LZSexcite:
1653529725808.png
>Wake up in the night
>Can't sleep
>Draw little freak
>Come up with pancake based puns for attacks
>Back to bed
UHHHHH. What is this and how did someone find my game on here? 1653527395160.png
ScreenShot_5_25_2022_7_37_13.png

my game has distinct areas where travel through what are known as "battle stations" these are more or less areas to explore and fight. occasionally, you'll stumble across secret rooms with sidequests ready to be taken. this area is in the high school attic of all places... but how do ya get there is the question.

Forum statistics

Threads
122,125
Messages
1,146,706
Members
160,411
Latest member
WillianAxe
Top