• Topic Archived
You're browsing the GameFAQs Message Boards as a guest. Sign Up for free (or Log In if you already have an account) to be able to post messages, change how messages are displayed, and view media in posts.
  1. Boards
  2. RPG Maker XP
  3. Could I have help editing the damage formula?

User Info: Lord ZhouYu

Lord ZhouYu
9 years ago#1
In Game_Battler 3, it reads as follows:

if hit_result == true
# Calculate basic damage
atk = [attacker.atk - self.pdef / 2, 0].max
self.damage = atk + (20 * attacker.str) / 20

But I want it to be more like this:

if hit_result == true
# Calculate basic damage
atk = [attacker.str + attacker.atk, 0].max
self.damage = atk + (20 * attacker.str) / 20

Basically, dealing damage about equal to the attacker's strength plus the attack of their equipped weapon. I made the modifications, ran a test battle, and it seemed to work: that's about the damage allies and enemies dealt to each other. Hero had Str15 and a weapon with an attack of 3, and he did about 17-19 damage.

However, after saving that, I tried another test battle-without having changed anything-and they're back up to the 30s in damage.
Sylph: JamesrugliaxAidrianna, PSNID: Jamesruglia
If you know that Jesus Christ is your personal Lord and Savior, put this in your signature.

User Info: Dawn_Wanderer

Dawn_Wanderer
9 years ago#2
You must have closed out the Script Editor wrong or forgot to save progress. I've had a project not "save" the script I had edited. Had to go back, re-edit and then save again.

If that doesn't work, save and close the project, and re-open it.
When you tour outside the U.S., Freezepop says to tell people you're from "near Canada."

User Info: Lord ZhouYu

Lord ZhouYu
9 years ago#3
I tried closing it out and re-opening it. The script still shows the change I made, but it's still incorrectly determining the damage-and changes I make have no effect. Hero has a strength of 15 and a weapon with an attack of 3.

atk = [attacker.str + attacker.atk, 0].max
self.damage = atk + (20 * attacker.str) / 20

At first this caused about 17-19 damage, then went to 29-33. No matter what changes I make to either line, those results don't change.
Sylph: JamesrugliaxAidrianna, PSNID: Jamesruglia
If you know that Jesus Christ is your personal Lord and Savior, put this in your signature.

User Info: Crystalgate

Crystalgate
9 years ago#4
Let's try adding the numbers to those formulas.

atk = [attacker.str + attacker.atk, 0].max = [15 + 3, 0].max = 18
self.damage = atk + (20 * attacker.str) / 20 = 18 + (20 * 15) / 20 = 31

29-33 damage sounds about right, it shouldn't ever had been 17-19. Also, the default formula would have produced a much lower result, 5 or so if the enemy has no Physical Defense. That you say they are back to the 30s is strange since that shouldn't have been the number to begin with.

Have you added any scripts? I have seen at least one case where a script obsoleted whatever is in Game_Battler 3. The fact that no changes does anything makes it rather likely.

BTW, are you sure you don't want the Physical Defense of the enemy influence anything? With the changes you made only the stats of the attacker matters.

User Info: Lord ZhouYu

Lord ZhouYu
9 years ago#5
Thank you for your suggestions, I think I figured it all out:

The numbers you gave were correct. I figured the 30s was the default without going through the math because those are the numbers I came up with when I tried to replace the script with the unmodified version. That, and the reason no changes I made seemed to affect anything, and the reason I got the 15s I was looking for(and that the default system would've given me after all) but got 30s after saving it, is because:

Apparently, modifications to the script don't take effect in Test Battle until you save the project.

Once I figured that out, it all came together. Thank you again!

I don't want to factor defense into the equation because I don't want characters to have a "Defense" stat; this is more like Dungeons & Dragons, or early Ultima games.
Sylph: JamesrugliaxAidrianna, PSNID: Jamesruglia
If you know that Jesus Christ is your personal Lord and Savior, put this in your signature.
  1. Boards
  2. RPG Maker XP
  3. Could I have help editing the damage formula?
  • Topic Archived