I have been having a weird issue since installing this plugin, but I have so many plugins (including some written by myself) that I want to look into it a little more to be sure where the problem is - more than once I thought the problem was one thing when it was actually another. I'm using Yanfly's CTB, for the record. The problem goes like this:
I have three characters. A, B, and C, in that order. B has the Jump command.
B jumps. While B is in the air, A uses a Potion on C. I clearly see the cursor selecting C. But the Potion is instead used on A.
I suspect B being in the air is screwing with the targeting (it's trying to target the "second character", since C was listed second, but that's technically B, who is untargetable, so it picks a random target), but again, I want to look into it a little deeper before I'm sure it's not some weird interplay of plugins.
EDIT: So far, looks like I was mostly right. The smoothTarget function in rpg_objects.js is looking at the index among the entire party, not just the "reachable" characters. Where I was wrong: It's not randomizing, it's hitting A every time. Which is even more wrong. So the next question is: where is the index set?
Also, I'm seeing that, thanks to Battle Core, moving the cursor over C makes the game appear to select a third blank slot while targeting. Selecting the blank spot actually makes the Potion hit the right target.
SOLUTION: I got good results on the main bug with this:
Window_BattleActor.prototype.reachableIndex = function() {
return this.actor() ? this.actor().index() : 0;
};
Scene_Battle.prototype.onActorOk = function() {
var action = BattleManager.inputtingAction();
action.setTarget(this._actorWindow.reachableIndex());
this._actorWindow.hide();
this._skillWindow.hide();
this._itemWindow.hide();
this.selectNextCommand();
};
The mouse cursor targeting is still wonky (now, selecting the blank third slot causes actor A to always be targeted) but it's a step in the right direction.