Thanks. Modified it for smaller numbers.
RMMV Damage Formula - ideas and help
RPG Maker MV SupportIs there an easy way to express 0.5 < a.atk/b.def < 2.5 or would i have to make nested if/else statements?
Math.min(Math.max((a.atk/b.def),0.5),2.5)
It's actually "$gameVariables.value(n)" (using parentheses rather than square brackets) to reference the value of a game variable, in case anyone else has been trying to figure this out.
I feel like I'm doing this right but I'm not getting the right results, so maybe you guy can help!
I'm trying to make a fairly simple skill that deals HP damage, then returns the damage dealt to the user's MP. The problem right now is that it is dealing 0 damage every time no matter the stats.
Here's my skill:
var x = (a.mat - b.mdf); a.gainMP(x); x
So what am I missing? Thanks in advance!
I'm trying to make a fairly simple skill that deals HP damage, then returns the damage dealt to the user's MP. The problem right now is that it is dealing 0 damage every time no matter the stats.
Here's my skill:
var x = (a.mat - b.mdf); a.gainMP(x); x
So what am I missing? Thanks in advance!
Sweet! Glad I could help.
I'm gonna' guess the mdf is cancelling out the mat. But, someone more skilled than me might have a better explanation.
var x = (2 * a.mat) - b.mdf; a.gainMp(x); xTry this equation. In the dropdown below the damage formula, I had to turn the variance to 0% to make it behave a little more like how I would expect it to work.
I think you should just not use the "var" at the beginning, and also it's gainMp and not gainMP (note the upper case) so:
Code:
x=(a.mat-b.mdf); a.gainMp(x); x
Thanks for the replies.
It wasn't the stats, and it works with or without the var... it was actually the capitalization that was killing it. Oops!!! Such a newbie mistake! Haha. Anyway, it works perfectly now!
Thanks again!
EDIT: New question!
How can I target a different character in the party, besides a or b, without it being actor specific? Let's say I want a skill that deals damage and heals every party member except the caster for an amount equal to the damage dealt? So...
x = (a.tk - b.def); ALL_OTHER_PARTY_MEMBERS.gainHp(x); x
What should ALL_OTHER_PARTY_MEMBERS be replaced with?
It wasn't the stats, and it works with or without the var... it was actually the capitalization that was killing it. Oops!!! Such a newbie mistake! Haha. Anyway, it works perfectly now!
Thanks again!
EDIT: New question!
How can I target a different character in the party, besides a or b, without it being actor specific? Let's say I want a skill that deals damage and heals every party member except the caster for an amount equal to the damage dealt? So...
x = (a.tk - b.def); ALL_OTHER_PARTY_MEMBERS.gainHp(x); x
What should ALL_OTHER_PARTY_MEMBERS be replaced with?
How would I make the user take more damage with the first formula?
I believe you would change
a.gainHp(-Math.floor((a.mhp/10)))to
a.gainHp(-Math.floor((a.mhp/5)))Or something like that. Essentially, divide by less, and it'll deal more damage.
I just got around to testing it out and you actually need to call this:
$gameVariables.value(n)not this:
Code:
$gameVariable[n]
So far, it seems that in order to add to a variable in the damage formula you can use
why v[n] += 10 won't work by itself, while v[n] = 10 does.
Which feels like a round about way of doing it, but I can't for the life of me understand
why v[n] += 10 won't work by itself, while v[n] = 10 does.
I'm trying to have a skill with a guaranteed critical. In VX ACE you could use: b.result.critical = true
This doesn't work in MV and I can't work out why.
This doesn't work in MV and I can't work out why.
I use a.atk * 2 - b.def
My actors start off at about 60 HP though and gain it at a rate of 10 and below/ per level
My actors start off at about 60 HP though and gain it at a rate of 10 and below/ per level
From what I had of: b.elementRate(<insert ID of fire element>)>=2?(b.addDebuff(2,1)):0;100+(a.mat*2)-(b.mdf*2)
Is there a syntax to put multiple conditions in a formula that goes like this:
if Element Rate of Fire = 100%, add debuff, then do damage
if Element Rate of Fire > 100%, add state, then do damage
Is there a syntax to put multiple conditions in a formula that goes like this:
if Element Rate of Fire = 100%, add debuff, then do damage
if Element Rate of Fire > 100%, add state, then do damage
Just put things like if/elseif/else, wich is by syntax (condition)?(do)🙁elseif)?do:doelse; where the (condition) and the (elseif) are the conditions you want.
By following your exemple that makes:
r=<formula>;(b.elementRate(1)>1)?(b.addDebuff(x,x))🙁b.elementRate(1)==1)?(b.addState(x)):0;rNote: I'm not so sure about the "==1", never used it in a formula so it may be "=1" or even "===1"
Thank you again, Nuhada!
I confirmed that it is: "==1"
Also, there are some unneeded parentheses, so it's:
r=<formula>;b.elementRate(1)>1?(b.addDebuff(x,x)):b.elementRate(1)==1?(b.addState(x)):0;r
I confirmed that it is: "==1"
Also, there are some unneeded parentheses, so it's:
r=<formula>;b.elementRate(1)>1?(b.addDebuff(x,x)):b.elementRate(1)==1?(b.addState(x)):0;r
Just wanted to point out for learning's sake, the == and === are for testing equality (in the formula given, b.elementRate(1) is equal to 1).
It is not = because that'd be trying to assign the value on the right to the function output on the left and syntactically that doesn't make sense.
== and === are pretty much identical for the purposes we're using them for here in the damage formula thread, but it's best to be consistent with your use of them.
I know I'm a little late to the party, but using the stock health values and whatnot, I use this formula for magic skills that are meant to do a little better than normal attacks.
Code:
a.atk * b.def * 0.2
I need a formula that works with an agility focused character that does damage based off the actor's agility * atk, I tried one but it ended in misses.
Original thread: https://forums.rpgmakerweb.com/threads/rmmv-damage-formula-ideas-and-help.47099/