Damage formulas producing 0 damage

tumsterfest

Veteran
Veteran
Joined
Aug 11, 2020
Messages
42
Reaction score
4
First Language
English
Primarily Uses
RMMZ
Hi,

I'm having trouble figuring out why a few attacks of mine aren't causing damage:

First one: a.hp + atk - b.def * 2
Second one: a.mat * 5.5 - tp - b.mdf

I'm pretty decent at math, so it's definitely not an issue with that. My suspicion is that my issue has something to do with including two stat values the actor (i.e., an attack that is influenced by both the caster's current HP and his attack power).

Is there something structurally wrong with these formulas? Would using parentheses help?

Thanks!
 

Ahuramazda

Veteran
Veteran
Joined
Nov 9, 2012
Messages
251
Reaction score
116
First Language
English
Primarily Uses
RMMZ
You need to put a. or b. in front of atk (in the 1st) or tp (in the 2nd) so it knows who to pull the data from to make the calc work properly.

First one: a.hp + a.atk - b.def * 2
Second one: a.mat * 5.5 - a.tp - b.mdf
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,530
Reaction score
4,985
First Language
English
Primarily Uses
RMVXA
0 damage (no matter what the battler's current stats are) usually indicates the formula has an error in it. @Ahuramazda identified the errors perfectly, so no need for me to repeat the solution.
 

tumsterfest

Veteran
Veteran
Joined
Aug 11, 2020
Messages
42
Reaction score
4
First Language
English
Primarily Uses
RMMZ
You need to put a. or b. in front of atk (in the 1st) or tp (in the 2nd) so it knows who to pull the data from to make the calc work properly.

First one: a.hp + a.atk - b.def * 2
Second one: a.mat * 5.5 - a.tp - b.mdf
This worked. Thanks!

An offshoot question: I wanted one of these abilities hit 8 times at random. An example would be Cloud's Meteorain ability in Final Fantasy VII, or various other Meteor attacks in the FF series. Is there a workaround to bypass the limit of 4 when you select the "Enemies > Random" target option?
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,198
Reaction score
425
First Language
indonesian
This worked. Thanks!

An offshoot question: I wanted one of these abilities hit 8 times at random. An example would be Cloud's Meteorain ability in Final Fantasy VII, or various other Meteor attacks in the FF series. Is there a workaround to bypass the limit of 4 when you select the "Enemies > Random" target option?
with or without plugins?

if without plugins maybe try linking it to another skill... call common event when using that skill that force action of the actor to use another skill... but it might not exactly what you want though...
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Its been almost 6 months since i've been here last and 5 years before that. the worst part is losing the game you were working on in a cpu fire.

Well time to go at it again.
my game is coming together im so happy
In this day and age, i might switch back to RMXP. I’ve lost faith in all the new plugins.
Wow it's been forever since I last logged in! I STILL want to make a game... I'll start it one day for sure!! It's a dream of mine.
This days I couldn't do anything... My mind is so confused and I couldn't work at all, I only wanted to play video games with my friends and that made all my projects delay a lot. Someone else feels this kind of thing sometimes? :/

Forum statistics

Threads
104,286
Messages
1,005,259
Members
135,796
Latest member
PurplexiaSphinx
Top