MZ Crashing when allies attack enemy. (Solved! :))

Hey guys,

Having an odd problem - hopefully, an easy fix or something I am forgetting.

I recently started my game over in MZ from MV, so as I set up in MZ I am trying to get my battle system fully functional. The Battle system is almost ready, but suddenly, whenever one of my heroes attacks an enemy the game crashes.

I am using a bunch of Visustella plugins so feel free to let me know if you think the problem is something I altered in there.

Enemies can attack and damage me no problem (how unfair!) lol.

Here is the crash info if anyone can pick out what I've got done wrong.

EDIT: It appears I have messed up something in the battlecore, removing it and the STB system, seemed to fix the problem. So certainly must be something in there that I should not have altered.

I think I figured it out - SvActorPoisition won't work with Visuastella Battle core. Oddly the MV static actor plugin works fine.

Does anyone know of SVactorposition plugin that works with Visustella's battlecore? Unfortunately, it is a bit of a necessity due to my large-sized heroes. Little did I know it would not work with visustella...
mz - battle error 1.png
mz - battle error 2.png
mz - battle error 3.png
The console information you posted in the first part of the screenshot isn't actually showing what the error you're getting is.

Click the console tab at the top and show the actual crash error from there, rather than the elements tab.

I suspect whatever the error is being caused by, the message probably isn't going to be super useful to anyone other than the VisuStella team, as their code is obfuscated, and the error message is likely going to show a function name with a weird hexcode as it's name rather than the actual name of the function, and the line number on the error won't be useful as all of their code shows up on one line.

I would start by looking at things you've modified in engine already, like the action sequence for the attack skill, or if the crash happens when a specific skill is used, the common event on that skill.
Moved to: Plugin Support
The console information you posted in the first part of the screenshot isn't actually showing what the error you're getting is.

Click the console tab at the top and show the actual crash error from there, rather than the elements tab.

I suspect whatever the error is being caused by, the message probably isn't going to be super useful to anyone other than the VisuStella team, as their code is obfuscated, and the error message is likely going to show a function name with a weird hexcode as it's name rather than the actual name of the function, and the line number on the error won't be useful as all of their code shows up on one line.

I would start by looking at things you've modified in engine already, like the action sequence for the attack skill, or if the crash happens when a specific skill is used, the common event on that skill.
Thanks for the reply. It appears to be a conflict between the MZ sv actor position plugin and the visustella battlecore. Once I remove the position plugin, attacking seems to work correctly.
Try Placing sv actor position plugin between tier 1 and tier 2
EDIT:
Sorry, I forgot to tell you:
Delete or comment out this section
Code:
  // --------------------
  // set weapon animation's position
  // --------------------
  const _Sprite_Weapon_setup = Sprite_Weapon.prototype.setup;
  Sprite_Weapon.prototype.setup = function(weaponImageId) {
    _Sprite_Weapon_setup.call(this, weaponImageId);
    this.setPosition();
  };

  Sprite_Weapon.prototype.setPosition = function() {
    // set X position by actor sprite size
    const actorBitmap = this.parent._mainSprite.bitmap;
    const actorSpriteWidth = actorBitmap ? actorBitmap.width / 9 : 64;
    this.x = -16 - (actorSpriteWidth - 64) / 2;
    // set Y default position
    this.y = 0;
    // change X,Y position by actor's note
    const battler = this.parent._battler;
    if(battler){
      this.x += (Number(battler.actor().meta.SVWeaponRight) || 0);
      this.y -= (Number(battler.actor().meta.SVWeaponHeight) || 0);
    }
  };
Try Placing sv actor position plugin between tier 1 and tier 2
EDIT:
Sorry, I forgot to tell you:
Delete or comment out this section
Code:
  // --------------------
  // set weapon animation's position
  // --------------------
  const _Sprite_Weapon_setup = Sprite_Weapon.prototype.setup;
  Sprite_Weapon.prototype.setup = function(weaponImageId) {
    _Sprite_Weapon_setup.call(this, weaponImageId);
    this.setPosition();
  };

  Sprite_Weapon.prototype.setPosition = function() {
    // set X position by actor sprite size
    const actorBitmap = this.parent._mainSprite.bitmap;
    const actorSpriteWidth = actorBitmap ? actorBitmap.width / 9 : 64;
    this.x = -16 - (actorSpriteWidth - 64) / 2;
    // set Y default position
    this.y = 0;
    // change X,Y position by actor's note
    const battler = this.parent._battler;
    if(battler){
      this.x += (Number(battler.actor().meta.SVWeaponRight) || 0);
      this.y -= (Number(battler.actor().meta.SVWeaponHeight) || 0);
    }
  };
Awesome, yep deleting that section worked.
I also found another workaround, FogoMaxSVBattlerPosition (made for MV) works in MZ without issue.

I am assuming I should use plugins that are made for MZ. Do issues arise later in compiling/releasing the game if some plugins are from say MV?
I'd say(imo) it would depend on the combination of plugins you use when you finally get to that point. I'd even say some combinations of plugins which are all made for MZ may possibly have issues. That's because unless the plugins were written as a cohesive environment, coding direction(difference of) may have an effect.

In general, I'd say if a plugin exists for MZ that offers a feature you're looking for, use that as a first choice as it would most likely have the highest compatibility.
I'd say(imo) it would depend on the combination of plugins you use when you finally get to that point. I'd even say some combinations of plugins which are all made for MZ may possibly have issues. That's because unless the plugins were written as a cohesive environment, coding direction(difference of) may have an effect.

In general, I'd say if a plugin exists for MZ that offers a feature you're looking for, use that as a first choice as it would most likely have the highest compatibility.

Sounds good. Luckily I have most of my main systems ready now. Any additional plugins should be straight from visustella's collection.

Thanks for the help 🙂
Have fun! 🙂

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/crashing-when-allies-attack-enemy-solved.143402/