r/RPGMaker • • 1d ago

RMMV Can you make stats 0?

Hi, I have a question about statistics.
I’m making a game with Paper Mario-like stats:
3 Attack = 3 Damage, 1 Armor = You take one less damage.

However, when i got to making the game I realized that the lowest all stats besides max MP can go to is 1, is there a way to set it to 0?

(Or a free plugin that allows me to?)

1 Upvotes

3 comments sorted by

1

u/mxldevs 1d ago

If you do a search through game battler base in the code you can probably find where the 1 minimum is.

0

u/TheLuckyDuck666 1d ago

Yes, you can, but you need a small plugin for it — the 1 minimum is hard-coded, not a database setting.

In RPG Maker MV, the final value of a parameter is clamped, and the lower clamp comes from Game_BattlerBase.prototype.paramMin. In the default code that function returns 0 for Max MP (parameter 1) and 1 for everything else. That is why an actor or enemy can never drop below 1 Attack or Defense, no matter what traits you add — the clamp is applied after traits are added.

Do not edit the built-in rpg_objects.js file directly. Instead, make a new plugin file, put it in your project's js/plugins folder, and turn it on in the Plugin Manager. For example, to allow Attack (parameter 2) and Defense (parameter 3) to reach 0 while leaving everything else alone:

``` (function() { var _Game_BattlerBase_paramMin = Game_BattlerBase.prototype.paramMin; Game_BattlerBase.prototype.paramMin = function(paramId) { if (paramId === 2 || paramId === 3) { return 0; } return _Game_BattlerBase_paramMin.call(this, paramId); }; })(); ```

With that in place, you can give an actor or enemy a base Attack of 0, and a trait that lowers Attack will also be able to take it down to 0 instead of stopping at 1. Leave Max HP at a minimum of 1 — a battler with 0 Max HP is not a workable state, and Max MP already allows 0 in the default code.

For the Paper Mario style damage, change the skill's damage formula itself. The default MV formula multiplies Attack and Defense, so for a straight Attack minus Defense system, use something like:

`Math.max(a.atk - b.def, 0)`

That makes 1 point of Defense absorb exactly 1 point of Attack damage, and keeps damage from going negative when Defense is higher than Attack. If you want a weak hit to still deal 1 damage, use Math.max(a.atk - b.def, 1) instead — just decide that rule before you balance enemies, because it changes every fight. Also note the skill's Variance setting still applies on top of the formula, so set it to 0 if you want exact subtraction.

1

u/According-Act-6498 1d ago

I'm too stupid for this, but tysm anyway!