[MV] Attack formula isn't functioning correctly YEP enemy levels

Discussion in 'Javascript/Plugin Support' started by dude13579, Jul 20, 2019.

  1. dude13579

    dude13579 Villager Member

    Messages:
    6
    Likes Received:
    0
    First Language:
    english
    For some reason, I cannot get the enemies to deal damage corresponding to how much Hp they have. At a high level, they will have massive HP, but do mediocre damage. base * (1+(Math.pow(1.2,1+(level)))) < thats the formula I have for every stat for the enemy, and it works fine for HP, but not for damage. Is something overriding it? I even tried setting the formula to just, "base*500" and it didnt work. Here is my plugin list

    upload_2019-7-19_10-7-18.png
     
    #1
  2. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,026
    Likes Received:
    637
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    I think it's because base isn't defined in the damage formula. Also, you're not specifying whose level to reference, the user or the target. You could easily replace base with some basic damage formula, e.g.
    Code:
    (a.atk * 4 - b.def * 2) * (1 + Math.pow(1.2, 1 + a.level))
    May want to round it to the nearest integer, too, or you might get some weird display issues (lots of decimal places):
    Code:
    Math.round((a.atk * 4 - b.def * 2) * (1 + Math.pow(1.2, 1 + a.level)))
     
    #2
  3. dude13579

    dude13579 Villager Member

    Messages:
    6
    Likes Received:
    0
    First Language:
    english
    Im fairly certain the plugin specifies the variable base and level beforehand, according to the enemy's level and base stats. I dont think its calculating damage, but rather calculating the target's attack stat
     
    #3
  4. caethyril

    caethyril ^_^ Veteran

    Messages:
    1,026
    Likes Received:
    637
    Location:
    UK
    First Language:
    English
    Primarily Uses:
    RMMV
    For the enemy stats plugin: yes.

    For the skill damage formula set via the Skills tab in the database (which yields the base value fed into step one of Damage Core): no.

    If you mean "damage" in some other context, you'll need to explain what context that is.

    Incidentally, I just noticed your Yanfly plugins are not in the recommended order, e.g. Equip Core should load after Battle Engine Core. This may result in unexpected plugin behaviour; click+drag plugins in the Plugin Manager to reorder the list. You can view the recommended order here: http://www.yanfly.moe/wiki/Yanfly_Engine_Plugins :kaophew:

    Also:
    You seem uncertain what the base value should be? That doesn't seem right. You're the dev...where do you expect the value to come from? :kaoswt2:
     
    #4

Share This Page