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

JiaWei

Warper
Member
Joined
Apr 23, 2019
Messages
4
Reaction score
0
First Language
Chinese
Primarily Uses
RMMV
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!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
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.
 

JiaWei

Warper
Member
Joined
Apr 23, 2019
Messages
4
Reaction score
0
First Language
Chinese
Primarily Uses
RMMV
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...
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,047
Messages
1,018,540
Members
137,834
Latest member
EverNoir
Top