ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,821
Reaction score
6,637
First Language
English
Primarily Uses
RMMV
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 :wink:
 

emelian65

Veteran
Veteran
Joined
Sep 13, 2015
Messages
221
Reaction score
68
First Language
Spanish
Primarily Uses
RMMV
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
Veteran
Joined
Jul 2, 2014
Messages
8,821
Reaction score
6,637
First Language
English
Primarily Uses
RMMV
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
Veteran
Joined
Mar 24, 2023
Messages
31
Reaction score
13
First Language
Eglish
Primarily Uses
RMMV
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
Global Mod
Joined
Mar 2, 2012
Messages
46,006
Reaction score
16,819
First Language
English
Primarily Uses
RMMV
@Fonixed, try == instead of ===. What's in variable 1?
 

Fonixed

Veteran
Veteran
Joined
Mar 24, 2023
Messages
31
Reaction score
13
First Language
Eglish
Primarily Uses
RMMV
@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
Veteran
Joined
Jul 2, 2014
Messages
8,821
Reaction score
6,637
First Language
English
Primarily Uses
RMMV
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
Veteran
Joined
Dec 21, 2017
Messages
61
Reaction score
4
First Language
English
Primarily Uses
RMVXA
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
Veteran
Joined
Jul 2, 2014
Messages
8,821
Reaction score
6,637
First Language
English
Primarily Uses
RMMV
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 Threads

Latest Profile Posts

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

Forum statistics

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