Weapon Damage

(日本語の説明はこちらです)

weaponDamage1

In RPG Maker, weapons can be equipped to actors.
You can also equip them to enemies if you use plugins like Enemy Equips.

Weapons can provide parameter bonuses like extra atk and agi, but you can’t specify a damage value for the weapons themselves.

For example, if you wanted to have the normal attack skill’s damage value to be equal to the amount of damage dealt by the weapon, you would be unable to say this directly.

You could say that the “atk” bonus from the weapon represents how much damage the weapon can do, but if you were to reference the actor’s atk, you would be including any additional atk bonuses that aren’t part of the weapon.

This plugin allows you to define weapon damage formulas, which can be used in your skill formulas if necessary.

By separating the weapon damage from your atk, you have more control over how your want your skills to be set up!

Download

Plugin: download here (right-click, save-as)

Installation

Download the plugin and place it in the “plugins” folder in your project’s “js” folder. Then open your Plugin Manager (F10), double-click an empty row, and select the HIME_WeaponDamage plugin.

Once it is in your list of plugins, turn the plugin on.

Usage

To define a damage formula for you weapons, note-tag them with

<weapon damage>
  FORMULA
</weapon damage>

For example, let’s say you wanted your weapon’s damage to be between 2 and 16.You could write

2 * (Math.randomInt(8) + 1)

Note that we add 1 because randomInt picks a number between 0 and the value you provided.

For those that are familiar, this is equivalent to 2d8.

So if you wanted to write something like 1d6 + 4, you would write

(1 * (Math.randomInt(6) + 1)) + 4

For now, weapon damages are assumed to be simple.

Using Weapon Damage

Weapon damage formulas are not automatically included in your skill damage calculations, because you may not want to consider the weapon.

For example, if you’re casting a spell and you’re holding a sword, would you include the sword damage in the spell damage? Maybe, maybe not.

To use the weapon damage formula, in your skill formula, you can write

a.weaponDamage(b)

Which will return how much damage the attacker’s weapons dealt, based on the formula that you defined earlier. This value includes all weapons, so if the attacker is holding two weapons or three weapons or more, they will all be included in this total, which you can then use as part of the skill.

So let’s say your normal attack was equal to your weapon’s damage.
You would write

a.weaponDamage(b)

But let’s say you wanted to add a bonus for having extra “atk” power, which could represent your physical strength. You might say

a.weaponDamage(b) + a.atk / 10

Which adds 1 point of damage per 10 points in atk.
The weapon itself may provide atk bonus as well, but it is not necessary.

Bare Hands

Now, what happens when you don’t have a weapon? If no weapon is held, weapon damage is assumed to be “bare-hands” damage. Enemies by default are assumed to be bare-handed.

Bare-hands is set up as a weapon in your database. You don’t need to actually hold this in order to use the damage formula, but you could if you wanted to.

In the plugin manager, choose the ID of the weapon that will represent bare-hands, and then set up the weapon damage formulas usual.

weaponDamage2

This damage formula will be used as the weapon damage.

You may also like...

85 Responses

  1. It’s very interesting! If you need help, look here: ARA Agency

  2. It’s very interesting! If you need help, look here: ARA Agency

  3. dobry sklep says:

    Good day! Do you know if they make any plugins to help with SEO?
    I’m trying to get my blog to rank for some
    targeted keywords but I’m not seeing very good success. If you
    know of any please share. Cheers! You can read similar
    text here: Najlepszy sklep

  4. Good day! Do you know if they make any plugins
    to assist with Search Engine Optimization? I’m trying to get my blog to rank for some targeted keywords but
    I’m not seeing very good gains. If you know of any please share.
    Appreciate it! You can read similar blog here: Sklep internetowy

  5. dobry sklep says:

    Wow, fantastic weblog format! How lengthy have you been running a blog for?
    you made blogging look easy. The total look of your website is great,
    let alone the content material! You can see similar here e-commerce

  6. Hi, It has come to our attention that you are using our client’s photographs on your site without a valid licence. We have already posted out all supporting documents to the address of your office. Please confirm once you have received them. In the meantime, we would like to invite you to settle this dispute by making the below payment of £500. Visual Rights Group Ltd, KBC Bank London, IBAN: GB39 KRED 1654 8703, 1135 11, Account Number: 03113511, Sort Code: 16-54-87 Once you have made the payment, please email us with your payment reference number. Please note that a failure to settle at this stage will only accrue greater costs once the matter is referred to court. I thank you for your cooperation and look forward to your reply. Yours sincerely, Visual Rights Group Ltd, Company No. 11747843, Polhill Business Centre, London Road, Polhill, TN14 7AA, Registered Address: 42-44 Clarendon Road, Watford WD17 1JJ

  7. sklep online says:

    Excellent site you’ve got here.. It’s hard to find high quality
    writing like yours these days. I honestly appreciate individuals like you!
    Take care!! I saw similar here: Sklep internetowy

  8. It’s very interesting! If you need help, look here: hitman agency

  9. e-commerce says:

    Hmm is anyone else experiencing problems with the images on this blog loading?

    I’m trying to figure out if its a problem on my end or if it’s the blog.
    Any suggestions would be greatly appreciated.!

  10. sklep online says:

    I’d like to find out more? I’d love to find out more details.

  11. I figure that you’re right about this.

  12. What’s up to all, since I am genuinely eager of reading this web site’s post to be updated on a
    regular basis. It contains good stuff. https://serentico.top

  13. Geo says:

    I just wanted to say this plugin no longer works effectively.
    I have only one plugin turned on (this one) and am simply trying to do the enemies defense in damage (b.def) and the damage I end up doing is fluctuating drastically.
    Don’t bother with this plugin unless it gets updated!!

    • Traveling_Bard says:

      Are you using setting the formula in the weapon and it varies wildly? Or are you setting this up in a weapon & then applying that in a skill? If the latter, do you have variation set to the default 20%? I always forget to remove that when I make new skills.

      Also, what formula are you using? Because if it’s like the example where you have random numbers (mimicking D&D), the variation could be built into your formula. Just trying to help troubleshoot a bit, since I’ve used this plugin for awhile and it’s worked fine for me.

  14. Tsurugi says:

    So, I am using Yanfly’s Item Core and Item Augmentation which adds a “Boost” to an item it is fused with, but I want to try and add that boost into part of the weapon damage formula.

    So the formula I am trying to do is (Dice roll) + (attack stat – 10) * .5 + (Item’s boost)

    So a dagger would do 1-4 damage, while a dagger (+3) would do 4-7 damage.

  15. Jason says:

    I found a compatibility issue with YEP Item Core. If Max Weapons is not set to 0, then the weapon damage in this plugin won’t work. However, it will work correctly during the Battle Test (because that part of Item Core doesn’t run during the test). Also, the Bare Hands damage will work normally regardless of the setting.

  16. D.Arquien says:

    a.weaponDamage(b) don’t work http://prntscr.com/k0ml4a all atks hit 0
    no use weapon base ataque formula for damage help ?

  17. Eric says:

    This is the log I get, not sure what happen

    “TypeError: undefined is not a function
    at Game_Enemy.eval (eval at (file:///C:/Users/EricMan-Yuk/Dropbox/Games/Wings%20of%20Legend/js/plugins/HIME_WeaponDamage.js:160:23), :2:21)
    at Game_Enemy.Game_Battler.evalWeaponDamage (file:///C:/Users/EricMan-Yuk/Dropbox/Games/Wings%20of%20Legend/js/plugins/HIME_WeaponDamage.js:160:12)
    at Game_Enemy.Game_Battler.weaponDamage (file:///C:/Users/EricMan-Yuk/Dropbox/Games/Wings%20of%20Legend/js/plugins/HIME_WeaponDamage.js:169:19)
    at Game_Action.eval (eval at (file:///C:/Users/EricMan-Yuk/Dropbox/Games/Wings%20of%20Legend/js/plugins/YEP_CoreEngine.js:1498:42), :1:3)
    at Game_Action.evalDamageFormula (file:///C:/Users/EricMan-Yuk/Dropbox/Games/Wings%20of%20Legend/js/plugins/YEP_CoreEngine.js:1498:26)
    at Game_Action.makeDamageValue (file:///C:/Users/EricMan-Yuk/Dropbox/Games/Wings%20of%20Legend/js/rpg_objects.js:1672:26)
    at Game_Action.apply (file:///C:/Users/EricMan-Yuk/Dropbox/Games/Wings%20of%20Legend/js/rpg_objects.js:1660:30)
    at Function.BattleManager.invokeNormalAction (file:///C:/Users/EricMan-Yuk/Dropbox/Games/Wings%20of%20Legend/js/rpg_managers.js:2543:18)
    at Function.BattleManager.invokeAction (file:///C:/Users/EricMan-Yuk/Dropbox/Games/Wings%20of%20Legend/js/rpg_managers.js:2534:14)
    at Function.BattleManager.updateAction (file:///C:/Users/EricMan-Yuk/Dropbox/Games/Wings%20of%20Legend/js/rpg_managers.js:2516:14)”

  18. Anonymous says:

    Hime I have have big issue:

    Two-handed Weapons’ Trait Seal Equip slot does not remove an already equipped “Off_Hand” weapon. This is a dual wielding issue.

    This breaks the game in that a two-handed weapon can be equipped in one hand with a one-handed weapon in the other at the same time.

    I even tried using the remove equip slot script in the notes with, without brackets and with and without the $ sign and it did nothing (scripting is out of my element):
    “gameActors.actor(1).removeEquipSlot(1)
    gameActors.actor(1).removeEquipSlot(“Off-Hand”)”

    Is there a way to have an option in a weapon’s notes to remove an equip slot of an already equipped weapon (this case “Off_Hand”)?

    Or some way to get Two-Handed Weapons to remove an off-hand weapon to not break the game? This issue is so serious that I have stopped using R.P.G. Maker MV to pursue other game engines to make a similar game. I am basically more of a designer / artist / everything as Jack-of-all-trades minus a coder / scripter and this is a major bottle neck; everything in my game in R.P.G. Maker MV works fine minus this project breaking bug.

  19. Bishoujo Helper says:

    Skeezix and Nol mentioned this earlier, but I wanted to ping it again because it gets to the heart of why I’ll have to figure out my own way to implement this kind of plugin: rolling multiple dice is not easily supported, and perhaps misunderstood. In the very top image for the plugin, at least as shown now, “2d6+5” in the Description box is supposed to equate to “2 * (Math.randomInt(6) + 1) + 5”, but that’s rolling a single d6 and doubling it, not rolling two dice independently. Later, the Usage example repeats the error, but while you could argue that 2*(1d8) does give the same range as 2d8, it’s not the same distribution of totals, i.e. how would you get a 15 total? “(Math.randomInt(8) + 1) + (Math.randomInt(8) + 1)” is really “is equivalent to 2d8”.

    Anyway, I’m planning on getting this plugin, then seeing if I can create my own overlay (or something, never done it before) to process strings like “2d6+5” and generate the independent die rolls needed. This is for a project converting a scenario from the Bard’s Tale Construction Set, which used weapon damage die rolls and a D&D-like combat system. The need is there, because there’s weapons that do up to “32d100”, and trying to manage 32 “Math.randomInt(100)+1” in a row manually is just ludicrous.

    • Hime says:

      You're right, the screenshot does not accurately represent what the description says. You could write an add-on that will parse damage strings as needed. Alternatively, you might define a helper method d that takes two numbers or something like

      d(2,6) + 5

      Where the first number represents how many rolls, and the second represents the number of sides. And then function d would be something like this (it could probably be written more compactly but I'll just go with a simple example)

      function d(times, sides) {
         var total = 0;
         for (var i = 0; i < times; i++) {
            total += Math.randomInt(sides) + 1
         }
         return total;
      }
      

      Then you could say things like

      d(32, 100)

      Which doesn't look as nice, but at least it would be logically correct.

      • Bishoujo Helper says:

        I’ve come up with some code that could be integrated into your plugin, if that’s OK. This would go just after the “if (res) {” line:

        var diceRegex = /\s*(\d+)[dD](\d+)/m;
        var diceRes = diceRegex.exec(res[1]);
        var numDice, numSides, diceTotal, i;
        while (diceRes) {
        numDice = diceRes[1];
        numSides = diceRes[2];
        diceTotal = 0;
        for (i = 0; i < numDice; i++) {
        diceTotal += Math.floor(Math.random() * numSides) + 1;
        }
        res[1] = res[1].replace(diceRegex, diceTotal.toString());
        diceRes = diceRegex.exec(res[1]);
        }

        but it does raise the question that Forteller (I think) asked: in testing, it looks like this is calculated only once on creation, not every time you use it!
        Which makes any random element in the formula, or dependence on a variable statistic, useless.

      • Bishoujo Helper says:

        This supersedes my 6/14/17 code, and calls a “multiDice(ndice,nsides)” function that I made into a plugin as you suggested.
        This code goes into your plugin at the “if (res) {” line:

        if (res) {
        var diceRegex = /\s*(\d+)[dD](\d+)/m;
        var diceRes = diceRegex.exec(res[1]);
        var numDice, numSides, diceCall;
        while (diceRes) {
        numDice = diceRes[1];
        numSides = diceRes[2];
        diceCall = "multiDice("+numDice.toString()+","+numSides.toString()+")";
        res[1] = res[1].replace(diceRegex, diceCall);
        diceRes = diceRegex.exec(res[1]);
        }
        weapon.damageFormula = res[1];
        }

        So now it generates new random values on each call that way, even with attacks that take multiple swings at the same target in the same round.

        I also fixed what I thought was an error keeping barehanded from collecting the parameter value:

        $.barehandId = Number($.params["Bare-Hands Weapon ID"] || 1);

        In any event, it works now, and I’m able to extract the weapon notetag in a custom Status window.
        Let me know if you want my entire revised file.

  20. Forteller says:

    hmm anyway just have the weapon damage calculated on creation and not dynamically, so that if i make the weapon damage (a.level3+4)(1+a.atk/5*.10), the damage wouldnt scale as i leveled up

  21. PYR games says:

    One of your examples is wrong.

    You wrote
    ‘a.weaponDamage(b) * a.atk / 10’

    and simplified it as adding an extra point of damage per 10 ATK, but really that would add 10% damage per point in ATK, and only if that character had over 10 ATK.

  22. Skeezixs says:

    Just a quick question, if you have 2 * (Math.randomInt(8) + 1) does this work like 1d8 + 1d8 or is it 1d8 * 2?
    Would i need to set it to something like below, or is there another way?
    $gameVariable.variable[10] === 2, if $gameVariable.variable[10] >= 1, (Math.randomInt(8) + 1), $gameVariable.variable[10] — i

    • Nol says:

      it multiplies the 1d8 result by two.
      I added multiple itterations of (Math.randomInt(8) + 1) + (Math.randomInt(8) + 1) to obtain a 2d8

  23. Nol says:

    Hello !
    As everyone before, let me thank you for this plugin, which simplifiies my life a lot !
    The formula works fine, ….

    Except…. that my ennemies use the same as my actor

    If i give a (2 * (Math.randomInt(6) + 1))</weapon damage> Sword to my lone actor, my bat encounter ends up hitting exaclty as hard, when they should do à fixed “a.weaponDamage(b) + (a.atk-10)*0.5”
    (since they have no weapons…)
    Is the a.weaponDamage always using my actor’s ? have i missed something ?

    I might try to set up a second actor, see if it adds ALL the weapons ^^

  24. Anonymous says:

    First off, awesome plugin, ive been looking for something like this for a while now!

    Is it possible to do this?

    EX: Sword attack will be determined by actors atk times 3

    • Hime says:

      Yes. Weapon damage formulas have access to the user and the target. If you look at how the skill damage formula is written, you write

      a.weaponDamage(b)
      

      This means that a is the user, and b is the target. Consequently, a and b are now available to use in the formula. So if you wanted the damage of the weapon to factor in the user’s attack (or anything else that may be related to the user or target). So you could say

      a.atk * 3
      

      And so the weapon damage will be equal to the user’s attack, multiplied by 3.

  25. Dago says:

    I always get 0 value for damage, my setup are copy-pasted from a post from here and it doesnt work, here`s my log;

    SyntaxError: Unexpected token ILLEGAL
    at Game_Actor.Game_Battler.evalWeaponDamage (file:///C:/Users/Administrator/Documents/Games/Projeto/js/plugins/HIME_WeaponDamage.js:160:23)
    at Game_Actor.Game_Battler.weaponDamage (file:///C:/Users/Administrator/Documents/Games/Projeto/js/plugins/HIME_WeaponDamage.js:174:23)
    at Game_Action.eval (eval at (file:///C:/Users/Administrator/Documents/Games/Projeto/js/plugins/mv_damage_formula_debug.js:11:46), :1:3)
    at Game_Action.evalDamageFormula (file:///C:/Users/Administrator/Documents/Games/Projeto/js/plugins/mv_damage_formula_debug.js:11:30)
    at Game_Action.makeDamageValue (file:///C:/Users/Administrator/Documents/Games/Projeto/js/plugins/YEP_DamageCore.js:1218:27)
    at Game_Action.makeDamageValue (file:///C:/Users/Administrator/Documents/Games/Projeto/js/plugins/YEP_X_SelectionControl.js:977:44)
    at Game_Action.makeDamageValue (file:///C:/Users/Administrator/Documents/Games/Projeto/js/plugins/YEP_Debugger.js:426:54)
    at Game_Action.apply (file:///C:/Users/Administrator/Documents/Games/Projeto/js/rpg_objects.js:1656:30)
    at Game_Action.apply (file:///C:/Users/Administrator/Documents/Games/Projeto/js/plugins/YEP_BattleEngineCore.js:3096:34)
    at Game_Action.apply (file:///C:/Users/Administrator/Documents/Games/Projeto/js/plugins/YEP_BattleAICore.js:701:37)

    I deactivated a bunch of scripts, but more errors keep popping up every time i try again.

  26. Kerykeion says:

    I’d like to add weapon damage using YEP Item Upgrade Slots. If I give my base item 5 slots and a flat 5 weapon damage, I’d like to be able to upgrade it 5 times to “Base Item”+5 and add 5 more weapon damage.

    Any help would be appreciated!

    • Hime says:

      You should consult the instructions for yanfly’s plugin to see how to check how many upgrades have been done, and then include that in the weapon damage formula.

  27. jbt1234 says:

    From what I understand of the instructions, would I put this in the weapon tag:
    1 * (Math.randomInt(6) + 1)

    And this in the skill take to add a D&D style proficiency bonus:
    a.weaponDamage(b) + ((a.atk – 10) * 0.5)

    So this would separately add the proficiency bonus to the normal attack skill, rather than on the weapon itself?

  28. AngryAragami says:

    Hi Hime, is there a way to duplicate the effect of this script with your VX Ace scripts? There a number of reasons I want to build my project in VX Ace, but I need weapon specific damage like the script provides.

  29. Tevak says:

    Hi Hime, is there a way to give enemies weapon damage without using the equip slots core and enemy equips plugin?

  30. ODevil says:

    Is it possible to make armor increase weapon damage as well?

    • Hime says:

      Is the bonus based on the weapon checking what you’re wearing?

      • ODevil says:

        No, It would have been a flat increase to damage.
        In this scenario the weapon is a laser gun (dual-wield) and the armor being an energy core that increases the damage of energy damage.
        I’m fairly new to RM so I might not have fully understood what you just said though ._.

        • Hime says:

          You can use a formula to check whether that armor is equipped. How that condition is written will depend on what plugins you might have installed, but assuming you don’t have any special plugins that changes the way equips are handled, you could say

          if (a.armors().contains($dataArmors[14])) {
             110
          }
          else {
             10
          }
          

          This means that if armor 14 is equipped, the weapon will deal 100 damage. Otherwise, it will deal 10 damage.

          What this logic means is having that specific armor equipped will give the weapon a damage bonus.

  31. Podglu says:

    Is there a way to change the Damage Formula of a weapon mid-game, like an item with Damage+1 property on the equipped weapon ?

    • Hime says:

      That would depend on how the bonuses are implemented, and consequently, how you would check what bonuses you have.
      What are you using to add the Damage+1 property?

      • Podglu says:

        First, I thought to use an item with YEP’s Attachable Augments, but i don’t think this would work, so is this possible to use an Item on a character and his equipped weapon have +1 in its weapon damage ? A bit like the Monogrinder in Phantasy Star Online on Gamecube.

        • Hime says:

          Do you mean that each character will have a “weapon bonus” property, and then all weapons that are equipped will have that bonus?
          So if you gave the character an item that gives +2 bonus, and then another item that gives +3 bonus, that character will effectively have +5 bonus to all weapons?

  32. Dragon3025 says:

    I set up the basic attack skill to a.weaponDamage() then I added this in my weapon’s note:

    a.atk * 4 – b.def * 2
    </weapon damage>
    I tried attacking using the skill with the weapon equipped, but the damage was 0. The character has 26 atk total and the enemy has 30 defense. I tried this with just this plugin activated and I still get 0 damage.

    • Dragon3025 says:

      Weird, my note tag cut off, this is what I added in my weapon’s note:

      a.atk * 4 – b.def * 2
      </weapon damage>

      • Dragon3025 says:

        I’d edit my comments if I could. Basically the weapon has:
        (less_than_sign)weapon damage(greater_than_sign)
        a.atk * 4 – b.def * 2
        </weapon damage>

    • Hime says:

      Add this plugin to help debug the issue

      https://gist.github.com/HimeWorks/428d2357c7751f1438da2a760bfa2980

      Open the console (F8) and then execute the skill. See if there’s any messages.

      • Dragon3025 says:

        Okay, I used it and got this log:

        mv_damage_formula_debug.js:15 ReferenceError: b is not defined
        at Game_Actor.eval (eval at (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/plugins/HIME_WeaponDamage.js:160:23), :2:13)
        at Game_Actor.Game_Battler.evalWeaponDamage (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/plugins/HIME_WeaponDamage.js:160:12)
        at Game_Actor.Game_Battler.weaponDamage (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/plugins/HIME_WeaponDamage.js:174:23)
        at Game_Action.eval (eval at (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/plugins/mv_damage_formula_debug.js:11:46), :1:3)
        at Game_Action.evalDamageFormula (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/plugins/mv_damage_formula_debug.js:11:30)
        at Game_Action.makeDamageValue (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/rpg_objects.js:1668:26)
        at Game_Action.apply (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/rpg_objects.js:1656:30)
        at Function.BattleManager.invokeNormalAction (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/rpg_managers.js:2297:18)
        at Function.BattleManager.invokeAction (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/rpg_managers.js:2288:14)
        at Function.BattleManager.updateAction (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/rpg_managers.js:2270:14)

        • Hime says:

          I’ve updated the plugin. Previously, weapon damage formulas didn’t support the b variable.
          I’ve changed it so that you have to say this:
          a.weaponDamage(b)
          And then in your weapon damage formula, b will represent the target specified above.

          • Dragon3025 says:

            The newest update is 1.2? I updated the plugin with the download link on this page, then put a.weaponDamage(b), and still got 0 damage. This is the log I got:

            ReferenceError: b is not defined
            at Game_Actor.eval (eval at (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/plugins/HIME_WeaponDamage.js:160:23), :2:13)
            at Game_Actor.Game_Battler.evalWeaponDamage (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/plugins/HIME_WeaponDamage.js:160:12)
            at Game_Actor.Game_Battler.weaponDamage (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/plugins/HIME_WeaponDamage.js:174:23)
            at Game_Action.eval (eval at (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/plugins/mv_damage_formula_debug.js:11:46), :1:3)
            at Game_Action.evalDamageFormula (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/plugins/mv_damage_formula_debug.js:11:30)
            at Game_Action.makeDamageValue (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/rpg_objects.js:1668:26)
            at Game_Action.apply (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/rpg_objects.js:1656:30)
            at Function.BattleManager.invokeNormalAction (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/rpg_managers.js:2297:18)
            at Function.BattleManager.invokeAction (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/rpg_managers.js:2288:14)
            at Function.BattleManager.updateAction (file:///C:/Users/cntdr/Game%20Making/RPG%20Making/RPG%20MV/Projects/Legends%20of%20Asteria/js/rpg_managers.js:2270:14)

          • Hime says:

            1.3 is the latest version. You may need to clear your cache.

          • Dragon3025 says:

            Here’s a link to a fresh project using the plugin: https://www.dropbox.com/s/o9kw9odyn57ewxl/Weapon%20Damage%20Gives%200.zip?dl=0

          • Dragon3025 says:

            Oh, okay. I have 1.3 and the formula is working now. Thanks.

  33. Garlyle says:

    It would appear that, at current, “Barehanded” is not working as intended. With only your script running, I consistently get 0 damage attacks when barehanded (Attack command formula is, for testing purposes, literally just “a.weaponDamage()”)

    To specify, I can confirm that the weapon that’s supposed to be substituted in is working. If I manually equip the intended barehanded weapon to characters, then the values work out correctly, and damage is dealt.

    However, this weapon is not substituted in correctly, for either enemies or players.

  34. Daari says:

    First of all, great script but im having a small problem.

    Here is my weapon damage:
    1 * (Math.randomInt(4) + 1) + ((a.atk – 10) / 2)

    and here is my skill damage: a.weaponDamage() – b.def

    Somehow my characters always end up doing 0 damage, am I doing something wrong?

    Yes, brackets and everything is included.

    The only scripts im using are Yanflys Battle System and equip core. thanks!

  35. Lightheaven says:

    a.weaponDamage() return 0 for me.

    YEP_ItemCore
    HIME_EquipSlotsCore
    HIME_YanflyItemCoreEquipSlotsCore
    HIME_EnemyEquips
    HIME_WeaponDamage

    • Hime says:

      I believe yanfly’s ItemCore had a feature where note-tags are deleted from all individual equips once they’re created.
      This means that the weapon damage note-tag does not exist on any of your equips.

      Yanfly has introduced a feature in a later update called “Midgame Note Parsing” that you can set in your plugin parameters.
      By default it is turned off, but try turning it on and see if it makes a difference.

  36. Tredecimal says:

    This is /exactly/ what I was looking for my current project! Awesome! XD

    Just a quick question, though. Does this work with armor as well, or only with weapon?
    e.g. Someone creates a “Vanguard” class that has a Skill to deal damage equal to their shield’s DEF, not counting their “pure” DEF

    Thanks before~

  37. Culio says:

    I tried to make it work with Yanfly`s plugins but I couldnt reproduce the weapon attack formula.
    Is it just not compatible or am I missing something?

    Here what`s on my weapon formula tag:

    2 * (Math.randomInt(8) + 1) + ((a.atk – 10) / 2)
    </weapon damage>

  38. Netmonmatt says:

    This is fantastic. The only possible way I can think it could be improved off the top of my head would be if somehow pulled up a different line for normal attacks based on the weapon equipped.
    You know, how in Dragon Quest, it will say “Eight slashes with a Longsword!” or “Eight threw the Boomerang!” I’ve never understood why RPG Maker never supported that sort of thing without huge workarounds, when it likes Dragon Quest so much.
    That’s just me nitpicking though, this is great and a big improvement over the VX Ace version!

  39. Lowell says:

    Will the option to draw damage/formula’s from individual weapons and/or armors be an option in future releases?

    • Hime says:

      What do you mean by “individual weapons”?

      • Lowell says:

        pulling a formula based on the equipped item’s slot like, 0 for weapon, 1 for shield, etc

        • Hime says:

          We had considered the possibility of specifying each weapon, so like first weapon’s damage plus second weapon’s damage, but then you’d have to actually check whether the second weapon exists, and there were some other complications involved like what if you were only striking with one weapon, how would the skill know which weapon was used, and so on.

          So I ended up just having each weapon calculate their damage and then sum it up for the damage formula, assuming when you perform an action, all weapons will be used (this is based on default battle system).

          There was the possibility of using “Attacking Weapon” as part of the damage formula, so the game determines which weapon is currently striking, but that didn’t work out since we didn’t have a way to test it since there weren’t any battle systems where you could choose which weapon to strike with.

Leave a Reply to Tsurugi Cancel reply

Your email address will not be published. Required fields are marked *