ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
949
Reaction score
497
First Language
English
Primarily Uses
RMMV
So there's this annoying quirk in the plugins I'm using...I found an old thread with the same problem, but it didn't have any replies, much less solutions, so I hope I can fare a bit better.

When I enable Yanfly's Target Core and Selection Control any skill that targets Allies (with no notetags pertaining to the plugins) now scrolls through the party members using left and right, instead of up and down. As the party is standing in a vertical row, and their names are listed in a vertical column in the battle status window, this is bizarre.

I can't figure out where this change is coming from. I've searched both plugins (and even the Battle Engine) for the word "input" that might reference any pertinent function, the string 'left', and I just don't see anything that looks like it's overwriting the default keybindings for navigating the party members list.

Does anyone more experienced in JavaScript than I have suggestions on how to look for this? Or know specifically what functions are involved?
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
994
Reaction score
581
First Language
Poland
Primarily Uses
RMMV
I have - had - same problem, but I simply used notetags for skills to solve problem:

To target enemy or group of enemies
Code:
<Select Conditions>
condition = (target.isEnemy());
</Select Conditions>

To target party member(s)
Code:
<Select Conditions>
condition = (!target.isEnemy());
</Select Conditions>

To target only user of ability:
Code:
<Select Conditions>
condition = (target === user);
</Select Conditions>

But if you insist to edit plugins then in YEP_TargetCore.js those methods starts from line 555

and in YEP_X_SelectionControl.js from line (i think 1088)
 

Traverse

Veteran
Veteran
Joined
Jul 3, 2014
Messages
193
Reaction score
125
First Language
English
Primarily Uses
Wow, I wonder why I don't use Yanfly plugins.
I have - had - same problem, but I simply used notetags for skills to solve problem:
I don't think his problem is with restricting targets to enemies/allies.

If I understand right, his problem is that when the player is selecting allies to target, the Yanfly plugins make it so that you have to use the left/right input buttons to select from the actor list, even though the actor list is arranged top-to-bottom. Not left-to-right like the enemy list.

And he wants it to use up/down input buttons again for it, like the default engine usually does.
I can't figure out where this change is coming from.
Well that would be because it's not, in fact, a "change".

It's the MV engine's default behaviour..... of the ENEMY SELECTION window.

Which Yanfly seemingly shanghai'd into being able to select party actors from with the Target Core/Selection Control plugins.

He/she somehow co-opted Window_BattleEnemy into having ally selection functionality, probably by pushing ally actors onto the end of the list, but (somewhat understandably) never altered the input functionality of it for when the player reached the "ally" portion of the list. And since it's the BattleEnemy window, naturally the original input scheme for it uses left-to-right selection.

Seems like the ally selection window has just been left there only for display purposes and becomes non-functional when the plugins are installed.

...Yeah, you'd probably need some extensive modifications to make it accept up-down input for the ally portion of the list.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
949
Reaction score
497
First Language
English
Primarily Uses
RMMV
I have - had - same problem, but I simply used notetags for skills to solve problem:
You seem to have misread my post. It was not a question of how to use the notetags to target groups.
Well that would be because it's not, in fact, a "change".

It's the MV engine's default behaviour..... of the ENEMY SELECTION window.

Which Yanfly seemingly shanghai'd into being able to select party actors from with the Target Core/Selection Control plugins.
Oh my gawrsh! I see that now.
...Yeah, you'd probably need some extensive modifications to make it accept up-down input for the ally portion of the list.
It shouldn't be that bad! I just need to find in the base code where it takes the input to scroll through enemy targets and allow it to use left/up and right/down.

It doesn't harm anything when scrolling through enemies - either players will never think to push those buttons, or it will be additional functionality. And it will make the party work intuitively again.

Thanks!
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
949
Reaction score
497
First Language
English
Primarily Uses
RMMV
Thanks again to @Traverse for the important clue - the solution is just two statements of code :smile:

If anyone else finds this thread because Yanfly's plugins are using the wrong keys, just put this function into a plugin:

Code:
Window_Selectable.prototype.processCursorMove = function() {
    if (this.isCursorMovable()) {
        var lastIndex = this.index();
        if (Input.isRepeated('down')) {
            if (SceneManager._scene._enemyWindow && SceneManager._scene._enemyWindow.active)
                this.cursorRight(Input.isTriggered('right'));
            else
                this.cursorDown(Input.isTriggered('down'));
        }
        if (Input.isRepeated('up')) {
            if (SceneManager._scene._enemyWindow && SceneManager._scene._enemyWindow.active)
                this.cursorLeft(Input.isTriggered('left'));
            else
                this.cursorUp(Input.isTriggered('up'));
        }
        if (Input.isRepeated('right')) {
            this.cursorRight(Input.isTriggered('right'));
        }
        if (Input.isRepeated('left')) {
            this.cursorLeft(Input.isTriggered('left'));
        }
        if (!this.isHandled('pagedown') && Input.isTriggered('pagedown')) {
            this.cursorPagedown();
        }
        if (!this.isHandled('pageup') && Input.isTriggered('pageup')) {
            this.cursorPageup();
        }
        if (this.index() !== lastIndex) {
            SoundManager.playCursor();
        }
    }
};
 

Latest Threads

Latest Posts

Latest Profile Posts

Thursday AM
Him: When can you have this ready to test?
Me: With the amt of work plus other things on my plate, 2 weeks
Him: Can you have it ready by Monday?
Me: IF I can give my other work to someone else AND don't run into any issues AND I rush, I MIGHT be able to make it next Wednesday
Him: So Monday then?
Me: Maybe Wednesday
...
Realized virus affecting my NJS and MZ!
I feel so dumb I forgot to set parameters and thought the plugin wasn't working
I can come up with all of the magic skills in the world, but I can hardly think of creative physical weapon skills within the JRPG realm. One of those ones....
It's time for episode 19 of our Make a Cliff Map in RPG Maker MZ... I mean, Make a Game in RPG Maker MZ! Today we're working on our cliff map again. Let's see if we can finish it this time!

Forum statistics

Threads
111,417
Messages
1,060,950
Members
144,771
Latest member
Buraddorei
Top