How can I make Defense into a percent reduction?

GolvaeGames

Veteran
Veteran
Joined
Dec 15, 2014
Messages
140
Reaction score
85
First Language
English
Primarily Uses
RMMV
I would like to have the damage formula reduce damage by a percent value, which would be the targets defense. Ideally it would be 1 def = 1% reduction. Is this possible?
 

magnaangemon01

Miles Montgomery
Veteran
Joined
Jun 7, 2014
Messages
480
Reaction score
298
First Language
English
Primarily Uses
RMVXA
I don't have my computer in front of me, but I want to say there's a way to change defense in the class tab of your database.
 

rainyday

Veteran
Veteran
Joined
Nov 5, 2019
Messages
77
Reaction score
51
First Language
English
Primarily Uses
RMMV
Say your damage formula is equal to 4 times the user's attack, a.atk * 4. In order to reduce it by defense, you'd put
Code:
(a.atk * 4) * ((100 - b.def)/ 100)
in the formula box.
 

Doktor_Q

I'm not a real doktor, but I am a real Q
Veteran
Joined
Aug 1, 2016
Messages
881
Reaction score
573
First Language
English
Primarily Uses
RMMV
The effect of defense on damage is entirely dependent on the damage formula you write for the skill. So, the default damage formula is
Code:
a.atk * 4 - b.def * 2
which subtracts twice the target's defense from four times the user's attack.

An example formula where your damage is based purely on the user's attack and loses 1% per defense the target has, you'd do a formula more like this
Code:
a.atk * (1.0 - b.def/100)
If you have 50 attack and the enemy has 10 defense, that becomes "50 * (1 - 0.1)", or "50 * 0.9" which means you deal 90% damage.

There's not one singular place that controls the damage formulas, you need to write them for each skill. Another option is to use resistances, like resistance to an element, or physical / magical resistance, instead of giving characters a defense stat. Resistances can be modified as Trait in the list on the right for actors, classes, enemies, equipment, and status effects.
 

magnaangemon01

Miles Montgomery
Veteran
Joined
Jun 7, 2014
Messages
480
Reaction score
298
First Language
English
Primarily Uses
RMVXA
Oops. I was so sleepy I missed the target's defense part so my answer was irrelevant. My apologies.
 

GolvaeGames

Veteran
Veteran
Joined
Dec 15, 2014
Messages
140
Reaction score
85
First Language
English
Primarily Uses
RMMV
Thank you so much, I couldn't figure out the syntax, everything I typed in put out some wonky numbers
 

Latest Threads

Latest Profile Posts

 …So I was looking at a question someone had asked and did some related experimentation. Apparently the Jump… movement route command works like the ultimate through. Including letting you move around outside the confines of the map entirely. o_O
Jump.png
Okay so today I heard the dumbest theory I have heard in a loooooooong while. It's so stupid I just have to share... Appearantly I have learned to draw 'hot chicks' so that 'real men' get physically excited by looking at it and I can then swoop in and 'turn' them.... Wow... Just... Amazing how some brains works...
What the writer wrote: "The curtain is blue."
The readers: "There must be a hidden meaning behind this, perhaps to convey the character emotions ...".
What the writer has in mind: "The curtain is frickin' blue".
Time to share something!
hmZFwQe.png

I made these a while ago for my game. I took reference from various huts in Africa.
Have a great night! :D
I really need to buy a new mouse. Mine's keeps double-clicking and makes me waste A LOT of time eventing

Forum statistics

Threads
115,844
Messages
1,093,365
Members
151,038
Latest member
ClaudeSpeeds
Top