MV Fixing Yanfly's Animated Sideview Enemies Plugin

The issue is simple, static battlers won't face backwards during action sequences, even when specified with lines like: "face target: backward"

This script is overriding something but I'm not sure what. I'm not the only one who's experienced this problem so any help would be greatly appreciated by the community.


Animated Sideview Enemies link: http://www.yanfly.moe/wiki/Animated_Sideview_Enemies_(YEP)

Action Sequence Pack 2 link: http://www.yanfly.moe/wiki/Action_Sequence_Pack_2_(YEP)
So...I'm trying to narrow this down. I have figured out that it doesn't seem to have anything to do with action sequence 2, it's inherent to SV enemies that mirroring is broken. Something in there is making the mirroring get called many times instead of one, so it ends up in the direction it started.

If I can nail it down, I'll let you know.
So...I'm trying to narrow this down. I have figured out that it doesn't seem to have anything to do with action sequence 2, it's inherent to SV enemies that mirroring is broken. Something in there is making the mirroring get called many times instead of one, so it ends up in the direction it started.

If I can nail it down, I'll let you know.
Thank you. I should have specified that I knew there was nothing wrong with action sequence 2, but rather the code from "actionFace" in that script isn't being properly read. I linked it just for a quick reference.
Bump
Bump
Hello @alcreator440. I'm willing to help you with this.

However, my ability to assist you will have certain caveats.
Spoiler: Caveats
I have only used Yanfly's Animated Sideview Enemies plugin once, very recently, and that is to help someone else with a... frog thingy. Worse still is that I've never used Yanfly's Action Sequence plugins like, ever; but since they're free I'm willing to try them out in a fresh project in your behalf.
If you don't mind the above, my course of action would be to replicate the essential aspects of your problem on my own device using the barest of plugins installed and then attempt to, hopefully, find an acceptable solution. To do this, you will need to help me as well:
Spoiler: Request for Information
I should have specified that I knew there was nothing wrong with action sequence 2, but rather the code from "actionFace" in that script isn't being properly read.
  1. How can you be sure the fault lies not with Action Sequence 2 but solely with Animated Sideview Enemies? How can I verify this on my end?
  2. Do I need to install Action Sequence Packs 1 & 3 as well or would Pack 2 suffice?
  3. Can you give me the action sequence notetags you have used in your test skill? The simpler the better. This is really important as I don't yet know how to properly use action sequence notetags.
  4. Do I need to use any Animated Sideview Enemies notetags during my test e.g. <Floating>? Do I need to modify any of this particular plugin's parameters e.g. breathing option? Kindly enumerate these, if any.
  5. Anything else that I need to keep in mind as I try to replicate your problem?
Please understand that I'm not guaranteeing results, if any.
Spoiler: Disclaimer
As previously mentioned I have minimal to non-existent experience with regards to the plugins involved with this issue. Additionally this thread is nearly a month old already. Furthermore, in the unlikely event that I concoct something, there's also no guarantee that my "fix" will not have unforeseen unwanted consequences. Finally, someone might have already known the solution to this problem, rendering this post unnecessary.
On the other hand you have nothing to lose by giving me the chance to help you, yes?
  1. How can you be sure the fault lies not with Action Sequence 2 but solely with Animated Sideview Enemies? How can I verify this on my end?
  2. Do I need to install Action Sequence Packs 1 & 3 as well or would Pack 2 suffice?
  3. Can you give me the action sequence notetags you have used in your test skill? The simpler the better. This is really important as I don't yet know how to properly use action sequence notetags.
  4. Do I need to use any Animated Sideview Enemies notetags during my test e.g. <Floating>? Do I need to modify any of this particular plugin's parameters e.g. breathing option? Kindly enumerate these, if any.
  5. Anything else that I need to keep in mind as I try to replicate your problem?

  1. Because the action sequences work as intended when Animated Sideview Enemies is turned off.
  2. I don't think so.
  3. <Setup Action>
    move user: forward, 30, 30
    wait: 40
    face user: backward
    wait: 30
    face user: forward
    wait: 30
    move user: origin, 30
    wait: 30
    face user: forward
    </Setup Action>
    <Target Action>
    </Target Action>
    <Finish Action>
    </Finish Action>
  4. No, not that I'm aware of.
  5. I think the Animated Sideview Enemies script is in some way overriding the Action Sequence Pack 2 script, thus making the above action sequence work for only sideview enemies and not static ones as well.
  1. Because the action sequences work as intended when Animated Sideview Enemies is turned off.
  2. I don't think so.
  3. <Setup Action>
    move user: forward, 30, 30
    wait: 40
    face user: backward
    wait: 30
    face user: forward
    wait: 30
    move user: origin, 30
    wait: 30
    face user: forward
    </Setup Action>
    <Target Action>
    </Target Action>
    <Finish Action>
    </Finish Action>
  4. No, not that I'm aware of.
  5. I think the Animated Sideview Enemies script is in some way overriding the Action Sequence Pack 2 script, thus making the above action sequence work for only sideview enemies and not static ones as well.
Thank you for the information.

So this action sequence is supposed to make the user turn forward and backward without applying the effects of the skill, yes? Indeed, it works in the case of static enemy battlers when Animated Sideview Enemies is turned OFF. When turned ON, it doesn't work with static enemy battlers but it does work with animated sideview enemy battlers taken from the img\sv_actors folder.

I started a new RMMV project specifically for this thread. Excluding the patch plugin below, I only used the following plugins installed in order:
  1. YEP_CoreEngine
  2. YEP_BattleEngineCore
  3. YEP_X_ActSeqPack2
  4. YEP_X_AnimatedSVEnemies
I replaced the default attack skill with your action sequence notetags. So far, with the patch below installed, upon using the attack skill the static enemy battler can turn its face backward. This is the same behavior observed earlier with just Action Sequence Pack 2 turned ON with Animated Sideview Enemies turned OFF. The action sequence still works properly with animated sideview enemy battlers taken from the img\sv_actors folder.

For good measure I also tested a scenario where the static enemy battler has the <Floating> notetag. It will still properly perform the action sequence while simultaneously floating.

Kindly create a blank javascript (.js) file and install it immediately after YEP_X_AnimatedSVEnemies in your plugin list. Then just copy and paste the code below within that JS file.

Spoiler: Tentative YEP_X_AnimatedSVEnemies Patch Plugin Version 1.00
JavaScript:
if (Imported.YEP_X_AnimatedSVEnemies) {   
    Sprite_Enemy.prototype.updateScale = function() {
        if (!this._svBattlerEnabled) {// for enemy sprites taken from img\sv_enemies
            var mirror = this.scale.x > 0 ? 1 : -1;           
            this.scale.x = this._enemy.spriteScaleX();
            this.scale.x = Math.abs(this.scale.x) * mirror;
        } else {// for enemy sprites taken from img\sv_actors
            this.scale.x = this._enemy.spriteScaleX();
        }       
        this.scale.y = this._enemy.spriteScaleY();
        if (this._stateIconSprite) {
            var safe = 1 / 100000;
            var sprite = this._stateIconSprite;
            sprite.scale.x = 1 / Math.max(safe, Math.abs(this.scale.x));
            sprite.scale.y = 1 / Math.max(safe, Math.abs(this.scale.y));
        }
    };
}

Please test the above code for potential bugs.
Thank you for the information.

So this action sequence is supposed to make the user turn forward and backward without applying the effects of the skill, yes? Indeed, it works in the case of static enemy battlers when Animated Sideview Enemies is turned OFF. When turned ON, it doesn't work with static enemy battlers but it does work with animated sideview enemy battlers taken from the img\sv_actors folder.

I started a new RMMV project specifically for this thread. Excluding the patch plugin below, I only used the following plugins installed in order:
  1. YEP_CoreEngine
  2. YEP_BattleEngineCore
  3. YEP_X_ActSeqPack2
  4. YEP_X_AnimatedSVEnemies
I replaced the default attack skill with your action sequence notetags. So far, with the patch below installed, upon using the attack skill the static enemy battler can turn its face backward. This is the same behavior observed earlier with just Action Sequence Pack 2 turned ON with Animated Sideview Enemies turned OFF. The action sequence still works properly with animated sideview enemy battlers taken from the img\sv_actors folder.

For good measure I also tested a scenario where the static enemy battler has the <Floating> notetag. It will still properly perform the action sequence while simultaneously floating.

Kindly create a blank javascript (.js) file and install it immediately after YEP_X_AnimatedSVEnemies in your plugin list. Then just copy and paste the code below within that JS file.

Spoiler: Tentative YEP_X_AnimatedSVEnemies Patch Plugin Version 1.00
JavaScript:
if (Imported.YEP_X_AnimatedSVEnemies) {  
    Sprite_Enemy.prototype.updateScale = function() {
        if (!this._svBattlerEnabled) {// for enemy sprites taken from img\sv_enemies
            var mirror = this.scale.x > 0 ? 1 : -1;          
            this.scale.x = this._enemy.spriteScaleX();
            this.scale.x = Math.abs(this.scale.x) * mirror;
        } else {// for enemy sprites taken from img\sv_actors
            this.scale.x = this._enemy.spriteScaleX();
        }      
        this.scale.y = this._enemy.spriteScaleY();
        if (this._stateIconSprite) {
            var safe = 1 / 100000;
            var sprite = this._stateIconSprite;
            sprite.scale.x = 1 / Math.max(safe, Math.abs(this.scale.x));
            sprite.scale.y = 1 / Math.max(safe, Math.abs(this.scale.y));
        }
    };
}

Please test the above code for potential bugs.
It works! Thank you so much for the script!

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/fixing-yanflys-animated-sideview-enemies-plugin.144089/