Damage Formula Help?

I've been messing around with damage formulas, both inside the regular damage formula box and inside yanfly's Lunatic Damage.

However, no matter where I write my formula, the damage never works how I want it to. For the sake of simplicity, I set all pdr and mdr to "1", so the damage should be exactly what I put in the formula.

As an example, let's say the formula is:

500

This is the only surefire way I have been able to get the enemy to take 500 damage.

Alternatively, let's say I have:

((100 + ( (100 *( (100 * (2 / 10)) + (100 * (2 / 10)))) / 10)) - ((10) / 3))

This should equal about... 497. However, the enemy will take about 90-100.

This is really confusing, to say the least. The complicated formula I just used is the equivalent of an end-game level character fighting a tutorial level monster.

Needless to say, had I used tutorial level values for the player, the enemy would have taken no damage.

Does anyone have any suggestions? Have I completely missed something? Please let me know.
Are you saying, if you use EXACTLY that formula - no substituting a.atk or anything like that - just the numbers, that you only get 90-100 damage?


I copied and pasted that into the Attack skill formula and it gave exactly 497 damage.


Disable all of your plugins and see if it gives the same result.


Check any states and features that might adjust the damage calculation.


Ensure variance is set to 0 and critical is false.
Disable all of your plugins and see if it gives the same result.

Check any states and features that might adjust the damage calculation.

Ensure variance is set to 0 and critical is false.
Thank you for the quick reply.

I made sure Variance is 0, crit is false.

If by plugin you mean script, I went through each added script and turned them off, and got the same result (90-100).

Edit:

Just to make extra sure, I made an entirely new project and tried it. Had the Attack skill variance set to 0, crit to false, and used the formula

((100 + ( (100 *( (100 * (2 / 10)) + (100 * (2 / 10)))) / 10)) - ((10) / 3))

and fought a basic slime. The slim took the usual 97 damage :/
haha - you know what? I tried it in MV and it worked perfectly. After I realized you're talking about Ace, I tried it in Ace and got the same result as you.


I'll take a look at what's going on there and let you know.
XD Okay, thanks. I thought I was crazy. 
Of course!


I was thinking this the moment I saw your formula, and then discarded it because I thought we were talking about MV.


All of your values there are integers. When you do 2/10 in Ace, you end up with 0, because two integer operands give you an integer result.


((100 + ( (100 *( (100 * (2 / 10)) + (100 * (2 / 10)))) / 10)) - ((10) / 3))


((100 + ( (100 *( (100 * (0)) + (100 * (0)))) / 10)) - (3)


and the rest is easy to work out.


If you want it to do 2/10 = 0.2, then you have to make one of those a float:


2.0 / 10


or


2 / 10.0


If it's a parameter, you can use .to_f to convert it to a float:


a.atk.to_f / 10


will give you a float result


Then you'd want to put the whole thing in brackets and convert it back to an integer at the end:


(((100 + ( (100 *( (100 * (2.0 / 10)) + (100 * (2.0 / 10)))) / 10)) - ((10.0) / 3))).to_i
Thank you so much! This works now. 😀

Original thread: https://forums.rpgmakerweb.com/threads/damage-formula-help.50148/