RMMV Damage Formula - ideas and help

● ARCHIVED · READ-ONLY
Started by Shaz 1539 posts Page 10 of 77 View original ↗
  1. Hoppy said:
    I need a formula that works with an agility focused character that does damage based off the actor's agility * atk, I tried one but it ended in misses.
    You use a.agi to call the attackers' agility into the damage formula.

    Very basic formula would be: a.agi*a.atk
  2. Professor_Ruffleberg said:
    You use a.agi to call the attackers' agility into the damage formula.

    Very basic formula would be: a.agi*a.atk
    So a variable was wrong thanks.
  3. Is there a way to search this particular thread?  I have a quick question that I'm sure was answered in here, and I'm sure I'll have others...maybe can we have a FAQ in the first post that gives the formulas for all the different commonly asked questions i.e., "how do i make a skill also damage mp/tp", etc.
  4. jonthefox said:
    Is there a way to search this particular thread?  I have a quick question that I'm sure was answered in here, and I'm sure I'll have others...maybe can we have a FAQ in the first post that gives the formulas for all the different commonly asked questions i.e., "how do i make a skill also damage mp/tp", etc.
     When you're viewing a particular thread, if you look at the top of the page there is a search bar and you will see a small gray box in it with the words "This Topic". Typing in the search box and hitting enter will let you search just this thread.
  5. Excellent, thank you!
  6. I have five (possibly six) formulas that I wanted to convert to work in MV, but I don't know how or what to change.

    [(d=((a.atk*0.5-0.25*b.def)*v[11])/100;$game_variables[11]=[v[11]-20,50].max;d;), 999].minThe first code (above this line) was tied to a skill that hit all enemies, but did progressively less damage to each enemy after the first, but only down to half normal damage (iirc; I haven't messed with the code for ages). The damage is regardless capped at 999.

    [((rand(3)) + a.mdf), 100].minThe second code (above this line) was tied to a skill that reduced an enemy's MP based on a random number plus the user's "Level" (which replaces Magic Defense). The damage is capped at 100. EDIT: My Ace .min and .max formulas don't seem to work anymore. What do I have to change them to to get the intended results?

    [(([rand(10), 5].max) + (a.mdf * 0.5 + a.agi * 0.051)), 100].minThe third code was tied to a skill that stole MP from an enemy based on a random number from 5 to 10, plus a formula involving the user's "Level" and Agility, with a cap of 100.

    d=[(a.atk/2-b.def/4), 999].min;a.hp+=[d/2,100].min;dThe fourth code was tied to a skill that works like the basic attack, but restores HP to the user equal to half the damage inflicted (healing capped at 100). The damage is capped at 999.

    $game_variables[8]=a.id;The fifth/final code is more of a debug formula, and is used by some skills and several items; what it does is get the target's Actor ID and store it in a variable (variable 8, in this case). This was done to make some things much easier, and not require a ridiculous number of copies of the same event/branches to perform a few things for the many different actors.

    Lastly:

    d=[(a.atk*0.8-b.def*0.4).to_i, 999].min;a.hp+=[d/4,100].min;dThis sixth code is similar to the above, but does more damage and hits all enemies, and is tied to a TP skill. Again, the damage is capped at 999. The problem is I can't remember what "to_i" does in VX Ace, nor why the formula is set up slightly differently from the previous one. 
  7. YouKnowA said:
    I repro'd it. You're right, it does. My guess is that the enemy's def(s) nullify the attacking stats completely.

    var x = 1; var arr = [1]; for (var i = 0, len = arr.length; i < len; i++) {x += a.hasWeapon($dataWeapons[arr]) ? a.mdf : 0}; 4 * (a.atk += x) - 2 * b.def;or

    var x = 1; var arr = [1]; for (var i = 0, len = arr.length; i < len; i++) {x += a.hasWeapon($dataWeapons[arr]) ? a.mdf : 0}; x += 4 * a.atk; x - 2 * b.def;may produce something closer to the desired effect.

    The first one adds the stat so it gets multiplied (making the attack w/ the favored weapon MUCH stronger). The second one uses a more tame method w/ the weaponed damage being 1 += a.mdf += (4 * a.atk), and then that total - the normal target defense. Let me know if that works for you. 

    I changed the formula up some using the attacker's level (small numbers barely do anything) and I have a 40 STR character dealing less damage with a sword (STR-based) than a 33 DEX character dealing more damage with a bow (DEX-based.) 
  8. Hello Everyone,

    so I want to make skill that is like in the game Breath of Fire IV, one of the astral dragon attack that makes all HP opposed to 1

    I tried Math.max(b.hp) - 1 , it didn't work, it just kill 1 or 2 character

    also I want to create skill that will deflect this attack with another skill, like in Tales Of Eternia in ps1, aurora wall that will deflect the effect of dark aurora sword

    maybe something like, whenever enemy use HP to 1 skill, Hero will use the deflect skill automatic
  9. McDohl said:
    Hello Everyone,

    so I want to make skill that is like in the game Breath of Fire IV, one of the astral dragon attack that makes all HP opposed to 1

    I tried Math.max(b.hp) - 1 , it didn't work, it just kill 1 or 2 character

    also I want to create skill that will deflect this attack with another skill, like in Tales Of Eternia in ps1, aurora wall that will deflect the effect of dark aurora sword

    maybe something like, whenever enemy use HP to 1 skill, Hero will use the deflect skill automatic
    Can't help with the second one, but for a Heartless Angel-type effect, just use 

    b.hp - 1This will always do damage equal to the target's current HP - 1 unless they have any form of resistance/weakness to the skill's element, which I don't know how to fix.
  10. McDohl said:
    Hello Everyone,

    so I want to make skill that is like in the game Breath of Fire IV, one of the astral dragon attack that makes all HP opposed to 1

    I tried Math.max(b.hp) - 1 , it didn't work, it just kill 1 or 2 character

    also I want to create skill that will deflect this attack with another skill, like in Tales Of Eternia in ps1, aurora wall that will deflect the effect of dark aurora sword

    maybe something like, whenever enemy use HP to 1 skill, Hero will use the deflect skill automatic
    For the second part, you could make a skill that applied a state that guarded from the Breath of Fire skill specifically by making it apply a state (you could also make this state passive using plugins).

    So, you have Heartless Angel that reduces all enemies to 1 hp. Then, you could have a state called Guardian Angel that protected from it. Let's say Guardian Angel is state #777 in the database. The formula for Heartless Angel would look like

    x = (b.isStateAffected(777) ? 0 : b.hp - 1); xI think at least, I'm still getting the hang of this as well!
  11. Rigor Mortex said:
    Can't help with the second one, but for a Heartless Angel-type effect, just use 

    b.hp - 1This will always do damage equal to the target's current HP - 1 unless they have any form of resistance/weakness to the skill's element, which I don't know how to fix.
    Thank you for the reply,

    I tried the formula, it still give me random result, first the skill kill all of my character, then next try, it just kill 2 of my character,

    or am I doing it wrong ?.. this is my first time using rpg maker

    basically the skill will not look any resistance element, it just turn all HP opposed to 1 despite lvl opposed is lvl 1 or 99
  12. VHStapes said:
    For the second part, you could make a skill that applied a state that guarded from the Breath of Fire skill specifically by making it apply a state (you could also make this state passive using plugins).

    So, you have Heartless Angel that reduces all enemies to 1 hp. Then, you could have a state called Guardian Angel that protected from it. Let's say Guardian Angel is state #777 in the database. The formula for Heartless Angel would look like

    x = (b.isStateAffected(777) ? 0 : b.hp - 1); xI think at least, I'm still getting the hang of this as well!
    Thank you for the reply,

    Okay, so I create skill for example "Shield" to deflect "Sword"

    in database skill section "Shield" is number 21, and "Sword" is number 20

    in "Sword" formula bar I typed x = (b.isStateAffected(21) ? 0 : b.hp - 1); x

    in "Shield" I didn't type anything in formula bar (well, I have an idea that this magic will have healing element when not encounter the "Sword" skill, still thinking about the formula though)

    I set the Hero to have skill "Shield" in classes section "hero job skill"

    I try battle in Troops section, battle test mode

    I make Hero do skill "Shield" in the beginning it show animation but not giving anything (formula bar is still empty)

    when the boss do the "Sword" skill it still give random result, 1 of character death, 2 remain half HP, 1 remain 10 (all HP Character is 450 and in still lvl 1)

    next try, I didn't make Hero do skill "Shield" in the beginning, and the result, 2 of my character death, 1 remain 10, 1 remain half

    so where is my error ?

    and sorry for the language

    Forgot to mention I use battle core yanfly plugin
  13. McDohl said:
    Thank you for the reply,

    I tried the formula, it still give me random result, first the skill kill all of my character, then next try, it just kill 2 of my character,

    or am I doing it wrong ?.. this is my first time using rpg maker

    basically the skill will not look any resistance element, it just turn all HP opposed to 1 despite lvl opposed is lvl 1 or 99
    Did you set the Variance to 0 for that skill? Once the game calculates the damage formula in the box, it modifies the end result by the Variance percentage. (For example, if the damage formula result is 20 and the Variance is 20, the final damage will be between 16-24 damage.) Without a Variance of 0, it can either do more damage (which obviously kills the character) or less (leaving them with more than 1 HP).
  14. Is it possible to have an attack that only does damage or does more damage if the target is affected by a state.  For example if a formula for an attack that only does damage if a target is poisoned or one that does double damage if its affected by a state.

    Actually is this it?

    b.isStateAffected(x) ? [high damage formula] : [lower damage formula]

    Also is it possible to have a crit apply a an affect to the enemy or myself
  15. lilyWhite said:
    Did you set the Variance to 0 for that skill? Once the game calculates the damage formula in the box, it modifies the end result by the Variance percentage. (For example, if the damage formula result is 20 and the Variance is 20, the final damage will be between 16-24 damage.) Without a Variance of 0, it can either do more damage (which obviously kills the character) or less (leaving them with more than 1 HP).
    That's fix the problem, Thank you good sir
  16. McDohl said:
    Thank you for the reply,

    Okay, so I create skill for example "Shield" to deflect "Sword"

    in database skill section "Shield" is number 21, and "Sword" is number 20

    in "Sword" formula bar I typed x = (b.isStateAffected(21) ? 0 : b.hp - 1); x

    in "Shield" I didn't type anything in formula bar (well, I have an idea that this magic will have healing element when not encounter the "Sword" skill, still thinking about the formula though)

    I set the Hero to have skill "Shield" in classes section "hero job skill"

    I try battle in Troops section, battle test mode

    I make Hero do skill "Shield" in the beginning it show animation but not giving anything (formula bar is still empty)

    when the boss do the "Sword" skill it still give random result, 1 of character death, 2 remain half HP, 1 remain 10 (all HP Character is 450 and in still lvl 1)

    next try, I didn't make Hero do skill "Shield" in the beginning, and the result, 2 of my character death, 1 remain 10, 1 remain half

    so where is my error ?

    and sorry for the language

    Forgot to mention I use battle core yanfly plugin
    The "Shield" has to apply a state, because b.isStateAffected is looking to see if the target ("b") is affected by a state. There is probably a way to do it the way you described, but it would be something like b.isArmorEquipped.

    So, make your "Shield" skill apply "Blocking" state, and put whatever the Blocking state's number is in the b.isStateAffected and it should work.
  17. VHStapes said:
    The "Shield" has to apply a state, because b.isStateAffected is looking to see if the target ("b") is affected by a state. There is probably a way to do it the way you described, but it would be something like b.isArmorEquipped.

    So, make your "Shield" skill apply "Blocking" state, and put whatever the Blocking state's number is in the b.isStateAffected and it should work.
    it works, thank you good sir,

    I'm kinda confuse about it first, but when I read again, I forgot to add state ( :| ) so yes it works when the Hero use "shield" first
  18. Rigor Mortex said:
    I have five (possibly six) formulas that I wanted to convert to work in MV, but I don't know how or what to change.

    [(d=((a.atk*0.5-0.25*b.def)*v[11])/100;$game_variables[11]=[v[11]-20,50].max;d;), 999].minThe first code (above this line) was tied to a skill that hit all enemies, but did progressively less damage to each enemy after the first, but only down to half normal damage (iirc; I haven't messed with the code for ages). The damage is regardless capped at 999.

    [((rand(3)) + a.mdf), 100].minThe second code (above this line) was tied to a skill that reduced an enemy's MP based on a random number plus the user's "Level" (which replaces Magic Defense). The damage is capped at 100. EDIT: My Ace .min and .max formulas don't seem to work anymore. What do I have to change them to to get the intended results?

    [(([rand(10), 5].max) + (a.mdf * 0.5 + a.agi * 0.051)), 100].minThe third code was tied to a skill that stole MP from an enemy based on a random number from 5 to 10, plus a formula involving the user's "Level" and Agility, with a cap of 100.

    d=[(a.atk/2-b.def/4), 999].min;a.hp+=[d/2,100].min;dThe fourth code was tied to a skill that works like the basic attack, but restores HP to the user equal to half the damage inflicted (healing capped at 100). The damage is capped at 999.

    $game_variables[8]=a.id;The fifth/final code is more of a debug formula, and is used by some skills and several items; what it does is get the target's Actor ID and store it in a variable (variable 8, in this case). This was done to make some things much easier, and not require a ridiculous number of copies of the same event/branches to perform a few things for the many different actors.

    Lastly:

    d=[(a.atk*0.8-b.def*0.4).to_i, 999].min;a.hp+=[d/4,100].min;dThis sixth code is similar to the above, but does more damage and hits all enemies, and is tied to a TP skill. Again, the damage is capped at 999. The problem is I can't remember what "to_i" does in VX Ace, nor why the formula is set up slightly differently from the previous one. 
    You may want to look into math.min and math.max. Anruth linked w3schools a while back. It's always useful for helping to math at things. And, my insomnia is your gain. An equation for your first question. Just don't forget the common event to reset your 11th variable to 100 (I think Fomar suggested that to you a while back, and... well... they're still right). Also, the first time it's used in a test battle x will be 0 (becoming 50) so every hit will start at 50% damage. A second casting will get the expected behavior.

    x = $gameVariables.value(11); x = Math.max(x, 50); y = (a.atk*0.5-0.25*b.def)*(x/100); $gameVariables.setValue(11, x - 10); Math.min(y, 999);There's probably a smoother way to write the above, but it worked alright for me.

    SpellcraftQuill said:
    I changed the formula up some using the attacker's level (small numbers barely do anything) and I have a 40 STR character dealing less damage with a sword (STR-based) than a 33 DEX character dealing more damage with a bow (DEX-based.) 
    Is that higher bow-wielder damage output with a bow-favoring skill? Or all attacks and skills?
  19. I'm trying to set this formula in a skill but it always returns me 0 (zero):

    a.atk * (1 - (b.def / (b.def + 100))basically, it uses defense to work similarly to physical reduction. :C

    also what those .min and .max means in formulae? and how to use them?
  20. YouKnowA said:
    There's probably a smoother way to write the above, but it worked alright for me.



    Is that higher bow-wielder damage output with a bow-favoring skill? Or all attacks and skills?
    All attacks and skills. Even if I try to lower bow damage, it's exponential.

    EDIT: I remove the level formula and a lower DEX bow still does more damage than a STR-based sword that would be equal in the amount.

    IE: a 40 DEX Bow is still stronger than a 40 STR Sword.

    var x = 1; var arr = [81]; for (var i = 0, len = arr.length; i < len; i++) {x += a.hasWeapon($dataWeapons[arr]) ? a.level + a.atk + a.mdf - b.def: 0}; x += + a.level + a.atk*2; x - b.def;

    This is my current formula. A bow can do a lot less damage than a sword at first, but at higher levels, a a stronger sword will still deal less damage than a bow.