What is the parameter(s) for No Damage to come out?

● ARCHIVED · READ-ONLY
Started by BoluBolu 6 posts View original ↗
  1. Oh well, I think I ask this here because I can't figure out why No Damage is happened and how it can come out, I mean what is the parameter?

    There are many things about damage value that calculated before the final value is determined, there's success or not the attack, there also for miss or not the attack, there also if enemy evade the attack or not, but what with No Damage? Did it just pop out because :
    1. The attack is a success
    2. It's a hp.damage type,
    3. But the damage value result is not more than 0 because the formula of skill resulting in value < 0 or == 0 ?
    4. But if it's < 0 the eval method will give 0 damage(you know, because that max method inside), so No Damage will occured?
    5. The enemy not evading.

    But if that's the case how can someone explain this ?

    Spoiler
    As you can see, Eric per hit damage does more than 900 damage, but with a rare ocassion the No Damage poped-up, I can ensure that it's not an evade thing because for evade I set the if result.damage.evade
    Here;s some my popup method:

    Spoiler
    And the window battle log which is by default (well I missed the screenshot) is coded by Enterbrain also give No Damage message.
    So what's happened here?
    I don't ask for "Always deal 1 hp damage" or anything like that, because I have solved this in formula section, but what I want to know is why this No Damage is occured when Eric Attack is far more greater than the slime defense, and the attack is not a missed attack and it should be a success attack, and the slime is not evading because if it evaded the attack it should return EVADE popup(the EVADE_PHRASE is in the bottom). I don't use conditional elsif.
    @damage = FAILURE_PHRASE if !target.result.success @damage = MISS_PHRASE if target.result.missed if item.damage.to_hp? && target.result.hp_damage == 0 @damage = NO_DAMAGE_PHRASE # <= This the one end @damage = EVADE_PHRASE if target.result.evaded

    Okay the question is what is the paramater for the "No Damage" will occured by DEFAULT ? That is the final question..
    Thanks everybody.. :) . Peace.

    EDIT: Sorry if wrong post place..
     
  2. There is a HIT percentage chance.  I don't know if this is independent of the EVA chance.  All I know is I see "HIT + 90%" in class definitions.  So, maybe if Eric's HIT + is set to, say, 80%, there is a 1 in 5 chance he misses.
  3. Well I think that would be categorized as miss and not a no damage, but thanks for the reply =)
    I will research more about this.
  4. There was a similar topic a few days ago where this problem occurred because of concurrent definitions within two scripts.

    When you are sure you use the standard damage calculation you could try this test script I wrote for the said case. It should create a printout of the results of several methods involved in the default damage calculation process whenever an attack deals no damage for any reason:

    Spoiler
    Code:
    if trueONLY_PRINT_ZERO_DAMAGE = true  # <- Change this value to <false> if a zero-damage                               # attack is not printed!CONSOLE_OUTPUT = false         # Print on console <true> or as a box <false># --------------------------------------------------# Don't do changes below this line unless you know what you are doing# --------------------------------------------------# Method redefinition check: (Not trustworthy)results = Array.new%w( item_apply item_test item_hit item_eva item_cri item_element_rate pdr mdrmake_damage_value rec apply_critical apply_variance apply_guard execute_damage ) \.each do |name|  regex = /def #{name}\W/  hits = $RGSS_SCRIPTS.select { |set| regex === set[3] }  if hits.length > 2 or (hits.length > 1 and name != "item_apply")    results.push([name, hits.map { |set| "[%03d:%s]" %    [$RGSS_SCRIPTS.index(set), set[1] || "NO VALID NAME"] }])  endendunless results.empty?  send(CONSOLE_OUTPUT ? :print : :msgbox,  "Some Methods may have been defined multiple times:\n" +  results.map { |name, scripts| "#{name} : #{scripts.join(", ")}" }.join("\n"))end# Test:$item_test_array = nil$testmethod_cnt = 0class Module   def log_method_result_test(method)    method_alias = :"$ALIASFORDAMAGETEST__#{$testmethod_cnt += 1}__"    alias_method(method_alias, method)    define_method(method) do |*args|      result = send(method_alias, *args)      if $item_test_array != nil        $item_test_array.push([self, method, result])      end      return result    end  endendclass RPG::UsableItem   log_method_result_test(:physical?)  log_method_result_test(:magical?)endclass RPG::UsableItem::Damage   log_method_result_test(:eval)  log_method_result_test(:recover?)endclass Game_Battler   alias_method(:item_apply_ILC_test, :item_apply)  def item_apply(user, item)    $item_test_array = Array.new    old_hp, old_mp = hp, mp    item_apply_ILC_test(user, item)    # --- Evaluate:    if (@result.hp_damage == 0 and @result.mp_damage == 0) or    not ONLY_PRINT_ZERO_DAMAGE      send(CONSOLE_OUTPUT ? :print : :msgbox,      "===============================\n" \      "#{user.name} uses #{item.name} on #{self.name}\n" \      "causing damage for #{@result.hp_damage} HP and #{@result.mp_damage} MP:\n"\      "(HP: #{old_hp} -> #{hp},  MP: #{old_mp} -> #{mp})\n" \      "-------------------------------\n" \      "Item Test: #{find_test_result(self, :item_test)},  " \      "Hit Rate: #{find_test_result(self, :item_hit)},  " \      "Evasion Rate: #{find_test_result(self, :item_eva)}\n" \      "Used: #{@result.used}\n" \      "Missed: #{@result.missed}\n" \      "Evaded: #{@result.evaded}\n" \      "#{@result.hit? ? "SUCCESS" : "FAILURE" }\n" \      "-------------------------------\n" \      "Formula Result: #{find_test_result(item.damage, :eval)}\n" \      "Element Rate: #{find_test_result(self, :item_element_rate)}\n" \      "Physical Rate: #{find_test_result(item, :physical?)} " \        "-> #{find_test_result(self, :pdr)}\n" \      "Magical Rate: #{find_test_result(item, :magical?)} " \        "-> #{find_test_result(self, :mdr)}\n" \      "Recovery Rate: #{find_test_result(item.damage, :recover?)} " \        "-> #{find_test_result(self, :rec)}\n" \      "Damage after critical: #{find_test_result(self, :apply_critical)}\n"\      "Damage after variance: #{find_test_result(self, :apply_variance)}\n"\      "Damage after guard: #{find_test_result(self, :apply_guard)}\n" \      "===============================\n\n")    end    $item_test_array = nil  end   def find_test_result(source, method)    res = $item_test_array.select { |set| set[0, 2] == [source, method] }    return res.collect { |set| set[2] }  end   log_method_result_test(:item_test)  log_method_result_test(:item_hit)  log_method_result_test(:item_eva)  log_method_result_test(:item_cri)  log_method_result_test(:item_element_rate)  log_method_result_test(:pdr)  log_method_result_test(:mdr)  log_method_result_test(:rec)  log_method_result_test(:apply_critical)  log_method_result_test(:apply_variance)  log_method_result_test(:apply_guard)endend
    Since the script was set up for testing purposes you should remove it afterwards. When an attack deals no damage although the result of guard application was 1 or above it should most likely because of another script (or a recovery effect that is just as high as the damage done).
     
  5. Okay I have found the problem, It turns out that I've doing silly things..

    I set the EVADE_PHRASE into "No Damage" wew, I'm sorry for all of this, for everyone too. Especially to Fen. And sorry for making you make that script, but thanks, that's a nice script =)
    Now here's what I meanwew:

    It was me debugging this script some time ago and I forgot to correcting this section.

    So basically all this time that slime is evading, how come I not realized this? Geez..
    Okay, for mods, please this thread can be closed. Thank you very much :) .
  6. Just to clarify: The script was made before this thread, I just reposted it here.
    However, it's good to hear you were able to solve the problem. :)