(Note: As suggested by @ATT_Turan, I created a post to ask for help with this specific issue.)
So, I'm using some of Yanfly's plugins (namely Buffs & States Core) to create a state that should make all enemies turn against the enemy affected by that state. It should work like this:
1) One actor applies state #55 onto one enemy to mark it as the "target."
2) After that, all the other enemies receive state #116 to make them turn against the "target."
3) During that turn, all enemies with state #116 will attack the enemy with state #55.
So far, step 3 is the only one that isn't working. Here's the code used for state #116:
@Robro33 said it worked for them, but it seems they applied one of the states onto actors instead of enemies. My intention is to make all enemies affected by state #116 attack the enemy affected by #55, kinda like "confusion/chaos" but all attacks are directed toward the same target.
So, I'm using some of Yanfly's plugins (namely Buffs & States Core) to create a state that should make all enemies turn against the enemy affected by that state. It should work like this:
1) One actor applies state #55 onto one enemy to mark it as the "target."
2) After that, all the other enemies receive state #116 to make them turn against the "target."
3) During that turn, all enemies with state #116 will attack the enemy with state #55.
So far, step 3 is the only one that isn't working. Here's the code used for state #116:
Code:
<Custom Action Start Effect>
var action = user.currentAction();
var foes = $gameTroop.aliveMembers();
for (var i = 0; i < foes.length; i++) {
var foe = foes[i];
if (foe.isStateAffected(55)) {
action.setTarget(foe.index());
}
}
</Custom Action Start Effect>
@Robro33 said it worked for them, but it seems they applied one of the states onto actors instead of enemies. My intention is to make all enemies affected by state #116 attack the enemy affected by #55, kinda like "confusion/chaos" but all attacks are directed toward the same target.