MV "Cannot set property 'opacity' of undefined" when transforming an enemy

Hello! I just found a problem that probably requires changing some code but due to my poor knowledge of javascript I'm going to need some help:
When, in battle, I want to transform an enemy into another, this error shows up.
1659431077184.png
1659431117302.png

Judging from what the console says, I have guessed the error is in this code inside the Yanfly AnimatedSVEnemies plugin:

Code:
Sprite_Enemy.prototype.setTransform = function(battler) {
    this._shadowSprite.opacity = 0;
    this._weaponSprite.opacity = 0;
    this._mainSprite.opacity = 0;
    this._stateSprite.opacity = 0;
    if (battler.svBattlerName()) {
      this.createShadowSprite();
      this.createWeaponSprite();
      this.createMainSprite();
      this.createStateSprite();
      this._shadowSprite.opacity = 255;
      this._weaponSprite.opacity = 255;
      this._mainSprite.opacity = 255;
      this._stateSprite.opacity = 255;
    }
};

More precisely this line:
Code:
this._stateSprite.opacity = 0;
But I don't know what I should put there to fix it. Can anyone help me?

Note: My yanfly plugins are placed in order in my plugin manager:
PluginManager2.png
I have guessed the error is in this code inside the Yanfly AnimatedSVEnemies plugin:
not really - that plugin is just the one that reports the problem.

the key is the "of undefined" in the error message.
that basically says that the engine is missing a data object that was referenced.

from context it means that the animated enemy plugin is missing data required to handle the new enemy, the one that you want to transform to.

and now there is a 50/50 chance as to what it really is:
either you configured that new enemy in a wrong way, or the plugin is missing data that was assigned at battlesetup and therefore is missing in the new enemy that happens later.

in the second case - that is why you need special summoning plugins compatible to battleplugins that add new data.
and a possible 3rd issue Andar didn't say, probably your YEP plugins
are in the incorrect order, so we can use a screenshot of your
plugin database to see how the plugins are ordered.

if they are in the incorrect order, plugins behave differently, and
YEP plugins MUST be in a specific order as given on his website.

(or use the plugin in my spoiler) to see which one is out of place.
the key is the "of undefined" in the error message.
that basically says that the engine is missing a data object that was referenced.

from context it means that the animated enemy plugin is missing data required to handle the new enemy, the one that you want to transform to.

and now there is a 50/50 chance as to what it really is:
either you configured that new enemy in a wrong way, or the plugin is missing data that was assigned at battlesetup and therefore is missing in the new enemy that happens later.

in the second case - that is why you need special summoning plugins compatible to battleplugins that add new data.
How should I look for the missing data?
if they are in the incorrect order, plugins behave differently, and
YEP plugins MUST be in a specific order as given on his website.

(or use the plugin in my spoiler) to see which one is out of place.
I used the order checker plugin and the problem still persists.
How should I look for the missing data?
that depends on the plugin, you need to follow its instructions.

first step should be to check if the enemy can be used without transform command
that depends on the plugin, you need to follow its instructions.

first step should be to check if the enemy can be used without transform command
It can be used, it's just another normal enemy. I just transform it using the default Enemy Transform command.
Please show screenshots of the two enemies you're transforming to/from and the event where you're using transform.

The first guess would be that the enemy you're transforming into doesn't have a sprite defined or the file isn't there - that would result in trying to change the opacity on a nonexistent sprite.
Please show screenshots of the two enemies you're transforming to/from and the event where you're using transform.

The first guess would be that the enemy you're transforming into doesn't have a sprite defined or the file isn't there - that would result in trying to change the opacity on a nonexistent sprite.
1659447836436.png

Here's the transforming enemy (enemy 1).
1659447867739.png

Here's the transformed enemy (enemy 2).
1659447903958.png

And this is the event in which enemy 1 is supposed to transform into enemy 2.

At first I thought it happened because only enemy 2 had a sideview actor assigned but I tested it with both having actors assigned and it still happens. The problem gets fixed if I deactivate the AnimatedSVEnemies plugin.
have you started a new game after assigning the sideview battler to the first enemy?
if you continue with a savegame that might not have the added data but still uses the old note.
have you started a new game after assigning the sideview battler to the first enemy?
if you continue with a savegame that might not have the added data but still uses the old note.
Yes, I have started a new game and the problem persists (I always start a new game to test stuff).

Original thread: https://forums.rpgmakerweb.com/threads/cannot-set-property-opacity-of-undefined-when-transforming-an-enemy.150023/