ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
908
Reaction score
480
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
908
Reaction score
480
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
908
Reaction score
480
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

[My favorite slow moving track I've made so far]
dd_airport2.jpgdd_combat.jpg
dd_town.jpg
I did an experiment to try to solve the art style problem between RTP and 3D models.
But, it feels this grimdark world is going to end even faster. :kaoswt2:
Solovei wrote on caethyril's profile.
Hi, just wanted to say, thank you for helping me fix that event with the step count! I followed your example exactly and it works now:kaojoy:
still waiting for original character contest 3 bust/face dlc release :kaoluv:
Stimpaks and More.png
Continued work. Still a WIP, some need some retouching. Stimpak, Radaway, Psycho, Jet, Mentats, Medex(ish/needs to be purple), bloodpack, glowing bloodpack. Made some Nuka too. Need to make Rad-X.
Nuka Sheet WIP FR.png

Forum statistics

Threads
111,187
Messages
1,059,090
Members
144,430
Latest member
Kruesser
Top