[RMXP] DAMAGE CALCULATION FORMULAS

Posts

Pages: 1
I'm new to RMXP and wanted to create a custom battle formula along the lines of 1 power= 1 damage. Basically want to start from the ground up. I know there are formulas to calculate skill damage but are there any scripts/ workarounds for this problem?

If not, then a simplified explanation of the existing formulas might help.
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
In the default battle system, the basic damage formula for skills is in the Game_Battler 3 script, in the attack_effect function. That function starts at line 42 and continues down to line 97. The relevant part of it which actually contains the damage formula starts at line 49 and continues down to line 71.

There's a separate formula for skills, also in the Game_Battler 3 script. It's in the attack_effect function just below. That function starts at line 98 and continues down to line 204. The relevant part of it which actually contains the damage formula starts at line 127 and continues down to line 156. This function is more complex as it also accounts for healing skills, magical skills, and skills with a "factor" of less than 100% (which changes how much a stat influences a particular skill).

The default damage formula is actually pretty weird with how it treats attack power and strength as two different stats, which influence damage in different ways. I'm not sure I can explain how it works in any useful way. The first thing I usually do when I start a project is replace it with a different formula.

Screwing around with these damage formulas without really knowing what you're doing is actually a great way to figure out how scripting works. If it gets messed up and you can't fix it, you can always change it back by just copying and pasting the entire Game_Battler 3 script from another project.

In the context of these two functions, "self" refers to the character that's taking damage (or healing), and "user" or "attacker" refers to the character that's using the skill. Both functions apply to both enemies and heroes.
Thanks LockeZ, that helped out a bunch. Was able to get the skill damage to desired levels, but now for some reason the basic attack is always a crit hit.
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
The part of the default attack_effect function which controls crits is:

# Critical correction
if rand(100) < 4 * attacker.dex / self.agi
  self.damage = self.damage * 3 / 2
  self.critical = true
end


In plain english this translates to:
Calculate the value: 4 * attacker's dex / target's agi.
That value is the percentage chance to get a critical hit.
If you get a critical hit, it does 150% damage, and the critical hit flag is turned on to let the game know that a crit happened.

What did you change this section of the code to? I can probably tell you where you went wrong if you paste what you did.
I'm not sure what I did but somehow the attacks aren't always doing crit now. Weird thing is I didn't even change anything in the critical correction section. Anyways, doesn't matter now. Thanks for the help though
Pages: 1