'targets.slice is not a function' (Resolved)

Hello,
I need help fixing a small bug.
While testing battles in my game, I received the error message "targets.slice is not a function", see image below.
This happens whenever a character affected by a Confused or Charmed state attacks a target.
This seems to be related to the "attack an ally" and "attack anyone" restrictions found in the state settings.
It is likely to be related with Yanfly plugins, I use a lot of them but they are all in the order precaunished by Yanfly.

While searching, I found on the forum someone who had the same problem and who solved it using the "automatic combat" function, but he didn't give more precision, and I can't not solve the problem that way.
I tried to use the plugin "Actor Auto Battle A.I." but it is a bit too complicated for me. If someone is familiar with this plugin, I would like some help please.

I also tried things with the <Custom Action Start Effect> tag, but my knowledge of javascript is very limited. I didn't succeed either.
I specify that all my characters do not have the same basic "Attack". I use the WeaponUnleash" plugin which allows to replace the attack.

Someone would have any idea ?

erreur.png
when yanfly's plugins behave strangely, then that very often is caused by them being installed in the wrong order.
can you give screenshots of your plugin manager so we can check if they are in the correct order?
Sure, I'll show you that.
But unless I'm mistaken, I followed exactly the order advised by Yanfly.
I just tested the bug by disabling the few plugins that don't come from Yanfly, and it doesn't change anything.

Plugins.png
targets mentioned in that error message should be an array. So maybe look for plugins/notetags related to actions/targets? E.g. YEP Target Core and its <Custom Target Eval> notetag.

You could try turning a plugin off, save your project, and test to see if that fixed it. If so then double-check that plugin's parameters and any related notetags, especially if you've used scripting for them.

(Note that if a problem disappears when you turn off a plugin, that might mean the plugin is directly responsible, or it might just be conflicting with another plugin.)
You were right, it had to do with the Target Core plugin.
So that my characters could not target themselves during an attack, I had used the tag <Target: Target 0 Random Foes>

Thanks to you, I realized that this was a problem for the game. So, I replaced by:
<Select Conditions>
Status: 38
</Select Conditions>
With state 38 which is a state named "Enemy" (which does nothing but will be on all enemies).
That doesn't seem to be a problem anymore. Characters cannot strike their allies with a normal attack, but they can (and must) do so if charmed.
Thank you very much for finding the solution =)

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/targets-slice-is-not-a-function-resolved.150152/