Good day scripters,
I've been working all day on trying to make a few scripts. One is done and posted for another member, a second I'm thinking about for myself. I mention this in this way because both scripts are very similar.
I have everything working, except there is one part that I can't figure out where it is going wrong.
Setup...
attack skill is at the default formula with 0 variance
In my code I have copied the Game_Battler -> def make_damage_value.
renamed it and took out the last four lines.
So it has the first five lines and then I return the value.
Problem...
The issue is that the value returned is not the correct value. The damage to the enemy is 132 but the value I get is 102.
Looking into this I have no idea where it is getting it's information, because it's not properly doing the calculation where
(a.atk * 4 = 140) - (b.def * 2 = 8) == 132
The actor atk is 20, the weapon is 15. calling p(user.atk) gets me 35 so that is correct.
calling p(item.damage.formula) gets me "a.atk * 4 - b.def * 2", so that is also correct.
but then calling p(value) right after
If I run that backwards I get 110 / 4 = 27.5 for the user attack. which kind of implies the weapon value is cut in half.
But if I raise it to 20, then the value is 122. 122 + 8 = 130 / 4 = 32.5 yet user.atk + weapon.atk = 40
Thoughts?
I've been working all day on trying to make a few scripts. One is done and posted for another member, a second I'm thinking about for myself. I mention this in this way because both scripts are very similar.
I have everything working, except there is one part that I can't figure out where it is going wrong.
Setup...
attack skill is at the default formula with 0 variance
In my code I have copied the Game_Battler -> def make_damage_value.
renamed it and took out the last four lines.
So it has the first five lines and then I return the value.
Problem...
The issue is that the value returned is not the correct value. The damage to the enemy is 132 but the value I get is 102.
Looking into this I have no idea where it is getting it's information, because it's not properly doing the calculation where
(a.atk * 4 = 140) - (b.def * 2 = 8) == 132
The actor atk is 20, the weapon is 15. calling p(user.atk) gets me 35 so that is correct.
calling p(item.damage.formula) gets me "a.atk * 4 - b.def * 2", so that is also correct.
but then calling p(value) right after
value = item.damage.eval(user, self, $game_variables) gets me 102.If I run that backwards I get 110 / 4 = 27.5 for the user attack. which kind of implies the weapon value is cut in half.
But if I raise it to 20, then the value is 122. 122 + 8 = 130 / 4 = 32.5 yet user.atk + weapon.atk = 40
Thoughts?