Defense debuff not working

Hello i’m using rpg maker mv, currently i’m trying to make a defense debuff that reduces an enemy defense stat by 25%, the problem is, even with my debuff being set to this:


the moves is still doing the same damage, and yes i did made the formula of the move(s) take into action the enemy defense, so i’m very confused why this is happening.

image

Is your skill that deals damage also the one adding the debuff? If so then MV does calculations before the state is applied, so it will only really apply next hit.

Also, when I tested it with all default monsters and actors, with variance set to 0% and Critical Hits off, I did get a damage change of about 14 points. Are you certain there was no change and it wasn’t just damage variance?

Because b.def * 2 is doing the damage reduction, reducing Defense by 25% always provides a damage increase equal to half the enemy’s base defense. If the damage change is small enough, like those 10 points, the standard variance can obfuscate the actual increase in damage.

Yes i am certain, but i managed to fix it well kind of, i changed it so that instead of the debuff reduce the defense of the enemy, it instead make moves that are categorized as physical element deal more damage.
now the debuff is actually working with what i intended (taking more damage from physical moves).

The answer is RPG maker mv doesn’t actually read parentheses, so the game just ignores everything inside

Like i’ve tried with a lot of formula’s to like section things off like that only for them to get zero’d by the engine it’s weird.

But then their issue would be that their attack is always doing 0 damage, not that the damage is the same with or without the state. I copied the damage formula they showed exactly and it worked for me, even.

I see, I found a thread

It seems i was wrong about it

RMMV does not ignore parentheses. This link will describe how they’re treated
JavaScript Operator Precedence

1 Like

Press F12 to open the dev console and input some code. I think it might help if you could directly check what the battler’s defense stat becomes. It doesn’t immediately solve or reveal the bug, but hopefully it provides a lead

image

I am guessing either your defense stats are too low for there to be a noticeable effect or something is interfering with your defense formulas.

Just copy and paste either lines into the console, hit enter to run it, and see what number it returns

$gameTroop._enemies[0].def

$gameActors.actor(1).def

If it gets zeroed by the engine, there’s probably a syntax error, or you did something invalid like dividing by zero.

1 Like

I probably treated the ends like implied multiplication, it’s been a hot minute so I don’t remember