MZ Change the EVA, HIT, and CRI formulae - Interact with VisuStella

Hi,

For the game I'm working on, I used a parameters system similar to a post I found here :
https://forums.rpgmakerweb.com/index.php?threads/caethyrils-mz-plugins.125657/post-1337021

The idea is to replace the calculation of the base parameters MAT, MDF and LUK to become a % chance to Hit, Evade and Crit chance.

Céthyrille has provided a plugin solution that I'm currently using:

Spoiler
Code:
/*:
 * @target MZ
 * @plugindesc Change the EVA, HIT, and CRI formulae.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/posts/1337081
 * @help Free to use and/or modify for any project, no credit required.
 */
;void (alias => {
  Game_BattlerBase.prototype.xparam = function(xparamId) {
    // Get original value
    const res = alias.apply(this, arguments);
    // Add extra based on param ID
    switch (xparamId) {
      case 0:   // HIT
        return res + this.mat / 100;
      case 1:   // EVA
        return res + this.mdf / 100;
      case 2:   // CRI
        return res + this.luk / 100;
      default:
        return res;
    }
  };
})(Game_BattlerBase.prototype.xparam);

This formula suits me perfectly, but since I installed VisuStella core (and the other VisuStella basic plugins), the interaction of Hit chance and Evade has become strange. Every time an attack misses, it's translated into a dodge (in the log, and in the animation). Even with 0% chance of evade, the animation and log remain that of evade.

By deactivating all my other plugins except Céthyrille's plugin, hits that miss seem to miss normally. But just when I activate VisuStella Core, the bug occurs.

How can I fix this?
Could VisuStella Core allow me to modify the base parameters like with Céthyrille's plugin?
I absolutely want to keep the base parameters, I'm not interested in custom parameters. I have too many other plugins that interact with base parameters.

I just need VisuStella and the Céthyrille plugin to interact normally so that a miss becomes a miss and not an evade.
Or another solution to change base parameters formula like Céthyrille's plugin.

Thanks a lot in advance for your help.
VisuStella Core Engine lets you define param formulae through its parameters, e.g.
X Parameters

JS: Formula: - Formula used to determine the total value all 10 X parameters: - HIT, EVA, CRI, CEV, MEV, MRF, CNT, HRG, MRG, TRG.
  • Plugin Manager -> Parameter Settings -> X Parameters - JS: Formula.
The default code in that plugin parameter (at least in my old version of the plugin) is:
JavaScript:
// Determine the variables used in this calculation.
let xparamId = arguments[0];
let base = this.traitsSum(Game_BattlerBase.TRAIT_XPARAM, xparamId);
let plus = this.xparamPlus(xparamId);
let paramRate = this.xparamRate(xparamId);
let flatBonus = this.xparamFlatBonus(xparamId);

// Formula to determine total parameter value.
let value = (base + plus) * paramRate + flatBonus;

// Final value
return value;
Before // Final value, you could add some more lines, e.g.
JavaScript:
if (xparamId === 0) {  // HIT
  value += this.mat / 100;
}
if (xparamId === 1) {  // EVA
  value += this.mdf / 100;
}
VisuStella Core Engine lets you define param formulae through its parameters, e.g.
​
  • Plugin Manager -> Parameter Settings -> X Parameters - JS: Formula.
The default code in that plugin parameter (at least in my old version of the plugin) is:
JavaScript:
// Determine the variables used in this calculation.
let xparamId = arguments[0];
let base = this.traitsSum(Game_BattlerBase.TRAIT_XPARAM, xparamId);
let plus = this.xparamPlus(xparamId);
let paramRate = this.xparamRate(xparamId);
let flatBonus = this.xparamFlatBonus(xparamId);

// Formula to determine total parameter value.
let value = (base + plus) * paramRate + flatBonus;

// Final value
return value;
Before // Final value, you could add some more lines, e.g.
JavaScript:
if (xparamId === 0) {  // HIT
  value += this.mat / 100;
}
if (xparamId === 1) {  // EVA
  value += this.mdf / 100;
}
Great, this info allows me to enter these custom formulas in Visustella (and thus deactivate your little plugin). And it worked, keeping the formulas and values, I hit and crit with MAT value and LUK value. But but but but...

...after testing again, the misses still launch the evade animation and the evade message in the log. It's as if a visustellacore setting considered every miss as an evade.
(I tested with only the visustellacore plugin, and it did the bug).

It's important for players to know the difference between miss and evade, as they need to be able to see the improvements in their hit rate and evasion rate with their equipment.

Any idea which visustella setting could do this?

Edit :
I don't know if it's possible, but you could also link the parameters mat, mdf and luck to the exparameter hit rate, evade rate and crit chance. To gain +1% per 1 point.

Could this be done?
...after testing again, the misses still launch the evade animation and the evade message in the log. It's as if a visustellacore setting considered every miss as an evade.
(I tested with only the visustellacore plugin, and it did the bug).
VisuStella Core Engine has this plugin parameter that is on by default:
  • Quality of Life Settings -> Player Benefit - Accuracy Formula
Try turning it off?

I think it also deliberately enables the "evade" motion for misses, but that shouldn't show a battle log message:
Version 1.06: September 27, 2020
  • Bug Fixes!
    • Battler evasion pose can now occur if there is a miss. These were made separate in RPG Maker MZ and misses didn't enable the evasion pose. Fix made by Olivia.
I'm not sure if there's a way to turn that off, if it is a problem. Someone more familiar with VisuStella's plugins might have some idea.
VisuStella Core Engine has this plugin parameter that is on by default:
  • Quality of Life Settings -> Player Benefit - Accuracy Formula
Try turning it off?

I think it also deliberately enables the "evade" motion for misses, but that shouldn't show a battle log message:

I'm not sure if there's a way to turn that off, if it is a problem. Someone more familiar with VisuStella's plugins might have some idea.
So it's funny, because I had deactivated it initially, but I reactivated it to see and... There are no more messages in the log for the evade (even the player/ennemy dodge the attack), but the evade animation still runs.

In short, false or true doesn't change the basic problem, which is that the difference between missing an attack and dodging an attack (which would be a hit) isn't clear.

So the problem remains... 🙁

Does anyone have an idea to help me?

Original thread: https://forums.rpgmakerweb.com/threads/change-the-eva-hit-and-cri-formulae-interact-with-visustella.168568/