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.
mogplugins.wordpress.com
Thanks.
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);
}
}
};
Rpg Maker MV
Battle Engine NameVersionUpdatedLinear Battle Systemv0.32b2021/05/01Chrono Enginev0.2b2021/05/01 Battle Plugins Name Version Updated Mog Aura Effect v3.0 2021/05/01 Mog ATB v0.3b 2021/05/01 Mog ATB…
Thanks.