# Damage Formulas 101

#### ATT_Turan

##### Forewarner of the Black Wind
Edit: removed because I found a more active thread to ask the same question, as this one appears to have been dead a while
Just as a suggestion, there's not much reason to do that. Recent/unread posts show up in the same lists on the site. So unless there's someone who's only working off of notifications from threads they've Followed, we're going to see your post regardless of which specific damage formula thread it's in

#### emelian65

##### Veteran
Theorically, making a check for more than one condition would work with && on it right?

For example:

JavaScript:
``a.mp && a.tp >= 35 ? 75 : 40;``

Could this work if I need the skill to deal extra damage as long as MP and TP are above 35? Or should I need to do something else?

#### ATT_Turan

##### Forewarner of the Black Wind
Theorically, making a check for more than one condition would work with && on it right?
No, that's not correct JavaScript syntax. Each side of the boolean operator must be a complete comparison. See:

So you'd do `a.mp>=35 && a.tp>=35`

#### Fonixed

##### Veteran
I'm not receiving any battle damage with this formula I'm not sure why.
Can this be done or do I need to make two different damage formulas with the same name?
JavaScript:
``if (a.actorId() === 1) { (v[1] + a.atk * 4 - b.def * 2); } else { (a.atk * 4 - b.def * 2); }``

#### Shaz

##### Keeper of the Nuts
@Fonixed, try == instead of ===. What's in variable 1?

#### Fonixed

##### Veteran
@Fonixed, try == instead of ===. What's in variable 1?

I've given Variable 1 the value of 25, it's just a random value that I'm using to see if I can get it working.

Also == and === have the same effect in this case. I can deal damage but not receive any.

Last edited:

#### ATT_Turan

##### Forewarner of the Black Wind
Also == and === have the same effect in this case.
With RPG Maker they always will. Unless you manually set a variable to something weird, they will always be numbers and not need to be a strict comparison.

I can deal damage but not receive any.
Because enemies don't have an actorId() field. When an enemy uses the skill, calling actorId() is undefined and zeros out the entire formula.

#### kn1000a

##### Golden Vampire
How much of these can be applied on VXA? I know MV uses javascript but idk how much I can reference, I could not find a comprehensive "Damage Formula 101" for VXA (Forma wrote one but it was not as in depth with each functionality)

Are these functions here like currentExp() the same in VXA? Would've be so nice if VXA let me uses as much as what is documented here.

#### ATT_Turan

##### Forewarner of the Black Wind
Are these functions here like currentExp() the same in VXA? Would've be so nice if VXA let me uses as much as what is documented here.
No, VX uses Ruby for scripting while MV/Z are coded in JavaScript - two completely different languages.

You can look up the VXAce script call list for functions to use in that engine.

### Latest Profile Posts

Am I the only one that thinks diablo 4's werebear form is atrocious o.0
A boss battle~!
Back from my short, self-imposed timeout with another picture of my collection of Snorlax mascots for my class. Another class starts on Friday.

Threads
131,607
Messages
1,221,528
Members
173,322
Latest member
hchomd