YEP Battle Engine: 'targets.slice is not a function' error

Hi all,

I want to make an 'internal conflicts' skill that forces enemy to attack each other.
This skill simply add a state to all enemies with restriction "attack an ally".
However, whenever an enemy uses any skill with scope = "X random enemy" to target another enemy,
the game crashes with the error below:
YEP_CoreEngine.js:1094 TypeError: targets.slice is not a function at Function.BattleManager.startAction (YEP_BattleEngineCore.js:2291) at Function.BattleManager.startAction (YEP_BuffsStatesCore.js:1129) at Function.BattleManager.startAction (YEP_InstantCast.js:341) at Function.BattleManager.startAction (YEP_WeaponUnleash.js:495) at Function.BattleManager.startATBAction (YEP_X_BattleSysATB.js:1397) at Function.BattleManager.updateATBPhase (YEP_X_BattleSysATB.js:1206) at Function.BattleManager.update (YEP_X_BattleSysATB.js:1177) at Scene_Battle.updateBattleProcess (rpg_scenes.js:2265) at Scene_Battle.update (rpg_scenes.js:2257) at Scene_Battle.update (YEP_CoreEngine.js:1427)

Anyone know how to fix this?
My temporary solution is to seal all skill type in the same state, so enemies can only attack each other with normal attack,
but this is not the feature I really want..
Thanks!
two different things here

1) The target scope "ally" or "enemy" has a different definition than "actor" and "Enemy" on the troop level. In the target scope "ally" means "Battler on the same side" and "enemy" means "Battler on the other side". So if a monster wants to target another monster (no matter if for damaging or healing) it needs a spell to target an "ally".
So if you have a restriction "attack an ally", then all scopes "attack an enemy" are automatically disabled.

2) that said, I doubt that such a combination would result in a crash of that type if yanfly's plugins were installed correctly - I could be wrong in my assumption, but usually yanfly programmed better.
And that means the error might be there because you have the plugins in the wrong order, I suggest to check that order against the required order on yanfly's website.
Hi,

I checked my plugin order, and it follows exactly the required order on yanfly's website.
I created a new project, and did some cross test there,
and the problem happens if YEP_X_BattleSysATB and YEP_WeaponUnleash are both installed.

Without YEP_X_BattleSysATB, enemy under "attack an ally " restriction only uses normal attack.
It is ideal to use only YEP_X_BattleSysATB, as it will change the skill scope from "X random enemy" to "one enemy", but YEP_WeaponUnleash somehow overwrite this function, and makes the game crash.

Here are the only four plugins I used in the test project, and this order is not likely wrong:
YEP_CoreEngine
YEP_BattleEngineCore
YEP_X_BattleSysATB
YEP_WeaponUnleash

Below is the error message:
YEP_CoreEngine.js:1094 TypeError: targets.slice is not a function at Function.BattleManager.startAction (YEP_BattleEngineCore.js:2291) at Function.BattleManager.startAction (YEP_WeaponUnleash.js:495) at Function.BattleManager.startATBAction (YEP_X_BattleSysATB.js:1397) at Function.BattleManager.updateATBPhase (YEP_X_BattleSysATB.js:1206) at Function.BattleManager.update (YEP_X_BattleSysATB.js:1177) at Scene_Battle.updateBattleProcess (rpg_scenes.js:2265) at Scene_Battle.update (rpg_scenes.js:2257) at Scene_Battle.update (YEP_CoreEngine.js:1427) at Scene_Battle.update (YEP_BattleEngineCore.js:4570) at Function.SceneManager.updateScene (rpg_managers.js:2024)
But since Yanfly stops to support ATB for a long time,
I guess there is no simple way to fix it...

Original thread: https://forums.rpgmakerweb.com/threads/yep-battle-engine-targets-slice-is-not-a-function-error.119510/