LOWEST DAMAGE INSTEAD OF 0, MAKE IT 1.
Posts
Pages:
1
Hey guys. Sorry in advance if I've put this topic in the wrong place.
I was just wondering, is there a way to make it so the lowest damage you can deal
in battle is 1, instead of "Dealt No Damage"?
e.g. Dragon Quest, with their Metal Slime, they have 999 DEF and MDF. However,
instead of the characters dealing 0 damage, it's either 1 damage or, the Metal Slime "Smoothly Dodged" the attack.
If I'm wrong, sorry. But I hope you know what I mean.
Thanks in advance, Fizzamun.
I was just wondering, is there a way to make it so the lowest damage you can deal
in battle is 1, instead of "Dealt No Damage"?
e.g. Dragon Quest, with their Metal Slime, they have 999 DEF and MDF. However,
instead of the characters dealing 0 damage, it's either 1 damage or, the Metal Slime "Smoothly Dodged" the attack.
If I'm wrong, sorry. But I hope you know what I mean.
Thanks in advance, Fizzamun.
You might just be able to add a +1 to your damage formula then. However, in RM2k3, I can't think of a way to do this without using some fancy plug-in...
If you use a completely wrecked up system on your 2k / 3 game it becomes perfectly fine.
Though I think you'd have to kiss goodbye to the DEF stat, errr >____>
Well, you're gonna solve this but then 39872314982374 other things will come on the package... That may not suit your tastes, err.
Though I think you'd have to kiss goodbye to the DEF stat, errr >____>
Well, you're gonna solve this but then 39872314982374 other things will come on the package... That may not suit your tastes, err.
Please read the whole post, you don't need to make both changes - either will work, but I personally recommend the second one.
For VX Ace, it's a change in the scripting for it...
From what I can see, as I haven't had a lot of experience playing around with VX Ace's scripting engine yet, it should be the make_damage_value function in Game_Battler (starts at line 351 in my copy). This should work...
This change should make it so that the damage value passed to "make_damage" will never be smaller than 1. Again, this should work, but the commenting on VX Ace is pretty terrible, so it's a little difficult to tell what particular segments of code are actually used for on first glance. This should be the right changes, based on the my search in the scripts.
The reason for the need of the change in the script, and not the formula, is due to how the formula evaluates. As the script shows, it alters the amount of damage in value after the formula has already been evaluated, so it can set it to 0 damage after that point - if it gets set to zero (or lower), it needs to be set to 1 before being passed forward.
Actually, the better place MIGHT be in Game_ActionResult, in make_damage on line 65.
Either way works. Be aware that this also sets MP drain's lowest value to 1 as well; if you use the second method, changing
to
will make it apply only to HP damage.
For VX Ace, it's a change in the scripting for it...
From what I can see, as I haven't had a lot of experience playing around with VX Ace's scripting engine yet, it should be the make_damage_value function in Game_Battler (starts at line 351 in my copy). This should work...
def make_damage_value(user, item)
value = item.damage.eval(user, self, $game_variables)
value *= item_element_rate(user, item)
value *= pdr if item.physical?
value *= mdr if item.magical?
value *= rec if item.damage.recover?
value = apply_critical(value) if @result.critical
value = apply_variance(value, item.damage.variance)
value = apply_guard(value)
value = 1 if value == 0
@result.make_damage(value.to_i, item)
end
This change should make it so that the damage value passed to "make_damage" will never be smaller than 1. Again, this should work, but the commenting on VX Ace is pretty terrible, so it's a little difficult to tell what particular segments of code are actually used for on first glance. This should be the right changes, based on the my search in the scripts.
The reason for the need of the change in the script, and not the formula, is due to how the formula evaluates. As the script shows, it alters the amount of damage in value after the formula has already been evaluated, so it can set it to 0 damage after that point - if it gets set to zero (or lower), it needs to be set to 1 before being passed forward.
Actually, the better place MIGHT be in Game_ActionResult, in make_damage on line 65.
def make_damage(value, item)
@critical = false if value == 0
value = 1 if value == 0
@hp_damage = value if item.damage.to_hp?
@mp_damage = value if item.damage.to_mp?
@mp_damage = [@battler.mp, @mp_damage].min
@hp_drain = @hp_damage if item.damage.drain?
@mp_drain = @mp_damage if item.damage.drain?
@hp_drain = [@battler.hp, @hp_drain].min
@success = true if item.damage.to_hp? || @mp_damage != 0
end
Either way works. Be aware that this also sets MP drain's lowest value to 1 as well; if you use the second method, changing
value = 1 if value == 0
value = 1 if value == 0 and item.damage.is_hp?
will make it apply only to HP damage.
I'd have to agree with Shoo. Unless I'm missing something, just tagging +1 on at the end of each formula should guarantee you always deal a 1 damage minimum, and isn't likely to make any significant impact on the damage calculations beyond that.
Because it's still possible, even with the +1 in the formula, to do no damage because of how the script actually calculates damage. You need to have a catch in the actual script to make minimum damage equal to 1. I tested the second way (which is part of why I recommend it) before I put up the initial post, as opposed to the +1 - the +1 just doesn't work.
Even if the +1 did work, you'd have to put it on every skill, as opposed to one (easy) change to the script. And if you later decided to drop the minimum damage back to 0 as opposed to 1, it's one easy deletion as opposed to going through every skill.
Edit: The test was done against a monster with 999 Defense that constantly guards using a Level 1 character with no weapons and 16 Attack, with all the skills tested being physical based. Using just the +1 on the skills, you still get "takes no damage." With the script change, attacks do, minimum, 1 damage.
Even if the +1 did work, you'd have to put it on every skill, as opposed to one (easy) change to the script. And if you later decided to drop the minimum damage back to 0 as opposed to 1, it's one easy deletion as opposed to going through every skill.
Edit: The test was done against a monster with 999 Defense that constantly guards using a Level 1 character with no weapons and 16 Attack, with all the skills tested being physical based. Using just the +1 on the skills, you still get "takes no damage." With the script change, attacks do, minimum, 1 damage.
author=Travio
Because it's still possible, even with the +1 in the formula, to do no damage because of how the script actually calculates damage. You need to have a catch in the actual script to make minimum damage equal to 1. I tested the second way (which is part of why I recommend it) before I put up the initial post.
Even if the +1 did work, you'd have to put it on every skill, as opposed to one (easy) change to the script. And if you later decided to drop the minimum damage back to 0 as opposed to 1, it's one easy deletion as opposed to going through every skill.
I haven't really used VX Ace, so I assumed that you could just easily change the universal damage formula somewhere. If I was definitely wrong about this, then Travio's way is probably better, especially if you have a lot of skills.
How in the formula does this change happen exactly?
One of my projects uses strict damage formulae for a lot of skills ("deal 1000 damage" etc) and it always comes out exactly as intended, but I've never used single digits. For it to ignore a +1 would mean that something in the formula gets changed that affects...only small numbers and nothing higher than...around 50?
Not that I'm arguing the truth of what you're saying, by the way. Just wondering why that's the case, when it doesn't seem consistent, is all.
One of my projects uses strict damage formulae for a lot of skills ("deal 1000 damage" etc) and it always comes out exactly as intended, but I've never used single digits. For it to ignore a +1 would mean that something in the formula gets changed that affects...only small numbers and nothing higher than...around 50?
Not that I'm arguing the truth of what you're saying, by the way. Just wondering why that's the case, when it doesn't seem consistent, is all.
Have you tested it using an enemy that always guards and with variance in place? Because the second you include variance, your number will never remain exactly the same - it will vary up or down from the values you have in place. And without it, an attack will always do the exact same amount of damage to a certain enemy. It makes sense for attacks like you say do an exact amount of damage (and be sure to work on a way around Guard unless you want it to be roughly halved when someone Guards, btw - ignoring defense doesn't take into account Guard as an action), but not for attacks that need to do a range of damage. Between variance and guarding, it can reduce your actual damage to 0, even with a +1 in the formula.
The change to the script catches these cases and lets you keep variance in damage.
The change to the script catches these cases and lets you keep variance in damage.
author=Travio
Have you tested it using an enemy that always guards and with variance in place? Because the second you include variance, your number will never remain exactly the same - it will vary up or down from the values you have in place. And without it, an attack will always do the exact same amount of damage to a certain enemy. It makes sense for attacks like you say do an exact amount of damage (and be sure to work on a way around Guard unless you want it to be roughly halved when someone Guards, btw - ignoring defense doesn't take into account Guard as an action), but not for attacks that need to do a range of damage. Between variance and guarding, it can reduce your actual damage to 0, even with a +1 in the formula.
The change to the script catches these cases and lets you keep variance in damage.
I never even thought about the enemy guarding.
Oh, variance. Right. The strict damage skills I use obviously have variance at 0, so it just never even occurred to me ~.~
author=Travio
Please read the whole post, you don't need to make both changes - either will work, but I personally recommend the second one.For VX Ace, it's a change in the scripting for it...
From what I can see, as I haven't had a lot of experience playing around with VX Ace's scripting engine yet, it should be the make_damage_value function in Game_Battler (starts at line 351 in my copy). This should work...
def make_damage_value(user, item)
value = item.damage.eval(user, self, $game_variables)
value *= item_element_rate(user, item)
value *= pdr if item.physical?
value *= mdr if item.magical?
value *= rec if item.damage.recover?
value = apply_critical(value) if @result.critical
value = apply_variance(value, item.damage.variance)
value = apply_guard(value)
value = 1 if value == 0
@result.make_damage(value.to_i, item)
end
This change should make it so that the damage value passed to "make_damage" will never be smaller than 1. Again, this should work, but the commenting on VX Ace is pretty terrible, so it's a little difficult to tell what particular segments of code are actually used for on first glance. This should be the right changes, based on the my search in the scripts.
The reason for the need of the change in the script, and not the formula, is due to how the formula evaluates. As the script shows, it alters the amount of damage in value after the formula has already been evaluated, so it can set it to 0 damage after that point - if it gets set to zero (or lower), it needs to be set to 1 before being passed forward.
Actually, the better place MIGHT be in Game_ActionResult, in make_damage on line 65.
def make_damage(value, item)
@critical = false if value == 0
value = 1 if value == 0
@hp_damage = value if item.damage.to_hp?
@mp_damage = value if item.damage.to_mp?
@mp_damage = [@battler.mp, @mp_damage].min
@hp_drain = @hp_damage if item.damage.drain?
@mp_drain = @mp_damage if item.damage.drain?
@hp_drain = [@battler.hp, @hp_drain].min
@success = true if item.damage.to_hp? || @mp_damage != 0
end
Either way works. Be aware that this also sets MP drain's lowest value to 1 as well; if you use the second method, changing
value = 1 if value == 0
tovalue = 1 if value == 0 and item.damage.is_hp?
will make it apply only to HP damage.
Thank you very much Travio, the first suggestion you gave, works perfectly!
(The "Game_Battler" one.)
Awww man, I'm so late to the party. If you want to make Metal Cut... It'd have the regular damage algorithm, metal element for if it'll do bonus damage to all other metallic enemies, and it would heal -2 HP to guarantee a hit of two on metal enemies. Evasion is the only way to avoid the damage. It calculates the 2 damage after the entire algorithm for damage is done.
Edit: Almost forgot. In the damage algorithm itself, at the end of the entire algorithm... add a - 1 and it will offset the extra point of damage on any enemy being hit with more than one automatically. Bam.
Edit: Almost forgot. In the damage algorithm itself, at the end of the entire algorithm... add a - 1 and it will offset the extra point of damage on any enemy being hit with more than one automatically. Bam.
Pages:
1

















