I have a simple Heal skill: [Scope: 1 Ally][<srpgRange:1>]. Skills of scope 1 Ally shouldn't be able to target the user.
Yet it is trying to, anyway.
If that was the problem I could just add a tag like <srpgMinRange>, but something else is happening: I _also_ crash whenever I use self-target skills, ever, and this minor bug suddenly becomes a major one:
UX_Cursor code
Same error as before: currentAction() returns null
Looking at PredictionWindow:
PredictionWindow code
JavaScript:
Window_SrpgPrediction.prototype.setTargetAction = function() {
$gameParty.clearSrpgBattleActors();
$gameTroop.clearSrpgBattleEnemys();
$gameTroop.clear();
console.log("prediction members:", this._actionArray[1]._name, this._targetArray[1]._name)
if (this._actionArray[0] === 'actor') {
$gameParty.pushSrpgBattleActors(this._actionArray[1]);
if (this._targetArray[0] === 'actor') {
if (this._actionArray[1] != this._targetArray[1]) {
$gameParty.pushSrpgBattleActors(this._targetArray[1]);
this._actionArray[1].action(0).setTarget(1);
} else {
this._actionArray[1].action(0).setTarget(0);
}
} else if (this._targetArray[0] === 'enemy') {
$gameTroop.pushSrpgBattleEnemys(this._targetArray[1]);
this._actionArray[1].action(0).setTarget(0);
}
} else if (this._actionArray[0] === 'enemy') {
$gameTroop.pushSrpgBattleEnemys(this._actionArray[1]);
this._actionArray[1].action(0).setSrpgEnemySubject(0);
if (this._targetArray[0] === 'actor') {
$gameParty.pushSrpgBattleActors(this._targetArray[1]);
this._actionArray[1].action(0).setTarget(0);
} else if (this._targetArray[0] === 'enemy') {
if (this._actionArray[1] != this._targetArray[1]) {
$gameTroop.pushSrpgBattleEnemys(this._targetArray[1]);
this._actionArray[1].action(0).setTarget(1);
} else {
this._actionArray[1].action(0).setTarget(0);
}
}
}
//対象の行動を設定
if (this._actionArray[1] != this._targetArray[1]) {
this._targetArray[1].srpgMakeNewActions();
if (this._actionArray[0] === 'actor' && this._targetArray[0] === 'enemy' &&
this._targetArray[1].canMove()) {
$gameTroop.pushMembers(this._targetArray[1]);
this._targetArray[1].action(0).setSrpgEnemySubject(0);
this._targetArray[1].action(0).setAttack();
this._targetArray[1].action(0).setTarget(0);
}
if (this._actionArray[0] === 'enemy' && this._targetArray[0] === 'actor' &&
this._targetArray[1].canMove()) {
this._targetArray[1].action(0).setAttack();
this._targetArray[1].action(0).setTarget(0);
}
}
console.log("action after:",this._actionArray[1].currentAction());
};And, like, there is no other call after that one, right? It's setTarget then straight to the console.log. Yet, when the log hits, there's no action to be seen, and thus an error (can't find Game_Item from undefined).
Am I missing something? This has been puzzling me for two hours straight; I'll take a break.
EDIT
Turns out it was, once again, from my own code. For whatever reason 6-months-ago me decided to clear the actions from the target. I have no idea why.
I feel very dumb haha. Just commenting that and adding minRange to the skill solves it.
