MV Conflicts between MOGHunter Battler Motion plugin and custom animation script.

Hi,

I've been using ChatGPT to create scripts that animate enemy sprites during in-game battles. Specifically, I have a script that produces a "scaling" animation, causing enemy sprites to increase/decrease in size before attacking, making battles feel more animated. But MOGHunter's "MOG_BattlerMotion.js", which I'm using to create a damage animation for enemies, prevents it from playing (the enemy sprite freezes when the animation is supposed to trigger).

I want to use both plugins together, but don't know how. My knowledge of coding and JavaScript is limited. I assume the problem is both scripts manipulate similar properties simultaneously, causing conflicts, but I'm unsure.

Here's the script that handles the scaling animation. Can anybody suggest a solution? You can download MOGHunter's plugin from their blog, which I've also linked below.

JavaScript:
// SQ-battlelog_v4.js

Window_BattleLog.prototype.getActionMessage = function(subjectName, item) {
    if (item) {
        return subjectName + ' uses ' + item.name;
    } else {
        return '';
    }
};

Window_BattleLog.prototype.displayAction = function(subject, item) {
    var subjectName = subject.name();
    var message = this.getActionMessage(subjectName, item);

    if (item) {
        if (DataManager.isSkill(item)) {
            var skillMessage = subjectName + " " + item.message1;
            $gameMessage.add(skillMessage);
        } else if (DataManager.isItem(item)) {
            var itemMessage = subjectName + " used " + item.name;
            $gameMessage.add(itemMessage);

            var soundEffect = { name: 'useitem', volume: 90, pitch: 100, pan: 0 };
            AudioManager.playSe(soundEffect);
        }
    }

    if (subject.isEnemy()) {
        var enemyIndex = subject.index();
        var spriteset = SceneManager._scene._spriteset;
        var enemySprites = spriteset._enemySprites;
        var enemySprite = enemySprites[enemyIndex];

        if (enemySprite) {
            var originalScaleX = enemySprite.scale.x;
            var originalScaleY = enemySprite.scale.y;

            var skillSoundEffect = { name: 'useskill', volume: 90, pitch: 100, pan: 0 };
            AudioManager.playSe(skillSoundEffect);

            enemySprite.pauseStretchingAnimation();

            var enlargedScale = 1.5;
            var animationDuration = 45;
            var scaleStep = (enlargedScale - 1) / animationDuration;
            var currentScale = 1;
            var counter = 0;

            var intervalId = setInterval(function() {
                counter++;
                if (counter <= animationDuration / 2) {
                    currentScale += scaleStep;
                } else {
                    currentScale -= scaleStep;
                }

                enemySprite.scale.x = originalScaleX * currentScale;
                enemySprite.scale.y = originalScaleY * currentScale;

                if (counter === animationDuration) {
                    clearInterval(intervalId);
                    enemySprite.scale.x = originalScaleX;
                    enemySprite.scale.y = originalScaleY;
                    enemySprite.resumeStretchingAnimation();
                }

                if (counter <= animationDuration / 2) {
                    currentScale += scaleStep;
                    var offset = enemySprite._originalScaleY * enemySprite.bitmap.height * 0.5;
                    enemySprite.y += offset * scaleStep;
                } else {
                    currentScale -= scaleStep;
                    var offset = enemySprite._originalScaleY * enemySprite.bitmap.height * 0.5;
                    enemySprite.y -= offset * scaleStep;
                }
            }, 16);
        }
    }
};


Thanks.
Most programmers here wont look at AI generated scripts, and the effect you want can be done with NRP dynamic motion plugins anyway. The site is in Japanese but all the plugin files have English instructions.

Most programmers here wont look at AI generated scripts, and the effect you want can be done with NRP dynamic motion plugins anyway. The site is in Japanese but all the plugin files have English instructions.

I'll check it out. Thanks.
After adding the Dynamic Animation/Motion plugins to my database and launching a playtest, I received this error when loading an in-game battle:

Capture.JPG


The Dynamic Motion plugin conflicts with another script, JM_EarthboundBackgrounds.js (https://jengamon.itch.io/jms-earthbound-backgrounds-for-rpg-maker-mv). How can I bypass this issue?
Alternatively, how could I create a damage animation for enemies that does not conflict with the scaling animation function from the initial script?

Original thread: https://forums.rpgmakerweb.com/threads/conflicts-between-moghunter-battler-motion-plugin-and-custom-animation-script.162862/