RMMV Damage Formula - ideas and help

● ARCHIVED · READ-ONLY
Started by Shaz 1539 posts Page 7 of 77 View original ↗
  1. SpellcraftQuill said:
    So, let's say we're using skills that use one stat while the normal attack of another weapon uses another stat. (IE bows and dexterity) Is there a way to make the skill use dexterity instead of strength?
    Hello Spellcraft Quill,

    I'm coming up to a plug-in called WeaponSkill by Sasuke Kannuzuki that seems to be part of the Kadokawa zip file of the pre-order. Once it was enabled in my test game, I went to the Weapons database and put the following text into the Notes field:

    <skill_id:5>I didn't see a dexterity stat, but for experimentation sake, I took a magic wand that has a basic magic attack instead of a physical attack.

    Under the Skill, the fifth skill I have is still labeled as Attack, but it has all the properties one might find with a magic attack such as a formula of:

    Code:
    a.mat * 4 - b.mdf * 2
  2. SgtBusCake said:
    Hello Spellcraft Quill,

    I'm coming up to a plug-in called WeaponSkill by Sasuke Kannuzuki that seems to be part of the Kadokawa zip file of the pre-order. Once it was enabled in my test game, I went to the Weapons database and put the following text into the Notes field:

    <skill_id:5>I didn't see a dexterity stat, but for experimentation sake, I took a magic wand that has a basic magic attack instead of a physical attack.

    Under the Skill, the fifth skill I have is still labeled as Attack, but it has all the properties one might find with a magic attack such as a formula of:

    a.mat * 4 - b.mdf * 2
    I know about that part, but that just changes a normal attack. What I am thinking about is using a skill (Double Slash) normally is based off of attack and hits twice. Using Double Slash with a bow should use another stat instead. (I changed magic defense to a dexterity stat.)
  3. I've spent the last 5 hours trying to make some of my formulas work, and now decided I should ask for some help, haha. I'm someone who really learns by examples. Could anyone try to translate some of these more complex formulas from Ace to MV? I have some very complex effects in my games.

    d=a.mat * 4.3 - b.mdf * 1.3;for s in [71,72,73];if b.state?(s);d*=1.2;end;end;d

    a.add_state(150);if Input.trigger_count:)C) == 1;a.atk*3-b.def*2;else;(a.atk*3-b.def*2)*1.25;end

    (input.trigger_count:)C) is for an Ace script and obviously doesn't work, but what would this be if it did?)

    And if anyone wants to try to take a crack at either of these overwhelming ones (same thing with the input.trigger_count:)C), it of course doesn't work in MV without the same script ported over, but I'm trying to decipher how I would do these effects if it was). These were done in Yanfly's Lunatic Damage, but now with the formula box as large as it is, they seem to be easily able to fit in the box without a plugin:

    $game_variables[309]=0; if Input.trigger_count:)C) == 1; $game_variables[309]=1; if $game_variables[174]==0; then self.animation_id = 288; else; if $game_variables[174]==1; then self.animation_id = 383; else; if $game_variables[174]==2; then self.animation_id = 287; else; end end end end
    Code:
    $game_variables[205]=0;      if Input.trigger_count(:C) == 1; $game_variables[204]=1        if $game_variables[206]>0;      self.animation_id = 377;$game_variables[205]=1;$game_variables[206]-=1;else;end    else      if $game_variables[204]==1        if $game_variables[206]>0;        self.animation_id = 377;$game_variables[205]=1;$game_variables[206]-=1;else;end      else      end      end
    I know some of these are a little over-the-top, but seeing them translated would help me do all of the other ones like it in my games, haha! Any advice is appreciated!
  4. SpellcraftQuill said:
    I know about that part, but that just changes a normal attack. What I am thinking about is using a skill (Double Slash) normally is based off of attack and hits twice. Using Double Slash with a bow should use another stat instead. (I changed magic defense to a dexterity stat.)
    Heya SCQ,

    This might point you in the right direction:

    var x = 1; var arr = [25, 26, 27, 28, 29, 30]; for (var i = 0, len = arr.length; i < len; i++) {x += a.hasWeapon($dataWeapons[arr]) ? (a.atk + a.agi + a.mat) : 0}; a.atk += x;This uses a.atk+a.agi+a.mat+a.atk for weapon IDs 25-30, but just a.atk for other weapons. 

    Of course, it's super ugly. If anyone has a cleaner way of doing it, that'd be pretty rad.
  5. It might be better to look in the script for this one, but how can I make it so the least amount of damage an attack can ever do it 1 as suppose to 0?
  6. TheGamedawg said:
    It might be better to look in the script for this one, but how can I make it so the least amount of damage an attack can ever do it 1 as suppose to 0?
    Hi Gdawg,

    Whitesphere has an example of how to do this on page 2 of this thread. The example they provided was Math.max( (4*a.atk - 2*b.def), 5). On the previous page, Anruth dropped a link to w3schools. It can help with some mathy things. 

    (Just reread what I wrote. Totally trying to be helpful, and not curt nor snarky. :D )
  7. @YouKnowA: I think something like this may work for the scenario that SCQ described (at least I think it is from the test cases I've run.) I haven't found a way with the base game to pull the wtypeId of the actor's equipped weapon. Thank you for this

    @SpellcraftQuill: Is your Dexterity stat used for anything other than damage? And do you have a stat that opposes Dexterity like the way that Defense opposes Attack?
     
  8. SgtBusCake said:
    @YouKnowA: I think something like this may work for the scenario that SCQ described (at least I think it is from the test cases I've run.) I haven't found a way with the base game to pull the wtypeId of the actor's equipped weapon. Thank you for this

    @SpellcraftQuill: Is your Dexterity stat used for anything other than damage? And do you have a stat that opposes Dexterity like the way that Defense opposes Attack?
    Well I hope Yanfly has a battle parameter formula or something similar. I will then have dexterity be the hit rate and go towards critical chance. Defense also guards against dexterity weapons.
  9. Is there a way to make formulas inside a plugin and do a shortcut on the skill formula?
     
    Like in Ace l was writing in a script
     

    Spoiler
    def User_MoreMPLessDMG_50(a, B)
    d = ((a.mp/(a.mmp/0.50.to_f))+1)
    d.to_f # Deal Damage
    end
     
    And everytime l wrote "b.User_MoreMPLessDMG_50" in a skill, ((a.mp/(a.mmp/0.50.to_f))+1) was calculated inside
  10. I have a quick question.

    I want to make skills that do recoil damage to the user based on the damage done, like Take Down and Double-Edge in Pokémon.

    The problem is that now that the recoil damage is calculated with two decimals.

    Is there a way to round these numbers?

    Here's the formula i use if it helps.

    a.gainHp(-(((2 * a.luk + 10) / 250) * (a.atk / b.def) * 90 + 2) / 4);((2 * a.luk + 10) / 250) * (a.atk / b.def) * 90 + 2
  11. luigiman2201 said:
    I have a quick question.

    I want to make skills that do recoil damage to the user based on the damage done, like Take Down and Double-Edge in Pokémon.

    The problem is that now that the recoil damage is calculated with two decimals.

    Is there a way to round these numbers?

    Here's the formula i use if it helps.

    a.gainHp(-(((2 * a.luk + 10) / 250) * (a.atk / b.def) * 90 + 2) / 4);((2 * a.luk + 10) / 250) * (a.atk / b.def) * 90 + 2
    Math.round().

    So

    Math.round(a.gainHp(-(((2 * a.luk + 10) / 250) * (a.atk / b.def) * 90 + 2) / 4));((2 * a.luk + 10) / 250) * (a.atk / b.def) * 90 + 2You can also use Math.floor() or Math.ceil().

    For more info about maths, you can red this page: http://www.w3schools.com/js/js_math.asp 

    You can use it all in the formula box :)
  12. Nuhada said:
    Math.round().

    So

    Math.round(a.gainHp(-(((2 * a.luk + 10) / 250) * (a.atk / b.def) * 90 + 2) / 4));((2 * a.luk + 10) / 250) * (a.atk / b.def) * 90 + 2You can also use Math.floor() or Math.ceil().

    For more info about maths, you can red this page: http://www.w3schools.com/js/js_math.asp 

    You can use it all in the formula box :)
    Thanks a lot, I was able to figure it out with your help, though it only worked after I put Math.floor behind the first minus sign

    Like this

    a.gainHp(-Math.floor((((2 * a.luk + 10) / 250) * (a.atk / b.def) * 90 + 2) / 4));((2 * a.luk + 10) / 250) * (a.atk / b.def) * 90 + 2Once again, thanks. Now I can make this recoil thing work.
  13. I still don't know how to refer to game variables. :/
  14. hey, sorry if this question seems really simple but...

    I want a dmg formula that adds a state on the condition of an enemy parameter.  would this be how to do it?  I'm going for "if target's defense is less than 50, add state 10 and do the standard damage formula.  otherwise, just do the standard damage formula"

    b.def < 50 ? b.addState(10); a.atk*4 - b.def*2 : a.atk*4 - b.def*2
  15. Liak said:
    I still don't know how to refer to game variables. :/
    I'm at work so I don't have RPGMMV in front of me to test this but I do have the engine's .js files on my phone. Looking at rpg_managers.js it looks like you should be able to just call $gameVariables[n] where n is the index of the variable you want.
  16. I'm trying to make an attack also add a state to the caster but all I'm getting is zero damage and no state applied.

    a.addstate(11); 100 + a.mat *2 - b.mdf * 2
    What exactly am I doing wrong?
  17. CrimsonKirie said:
    I'm trying to make an attack also add a state to the caster but all I'm getting is zero damage and no state applied.

    What exactly am I doing wrong?
    Use a.addState

    Notice the S instead of s
  18. thank you so much Cel
  19. I came from RMXP, so I'm completely new with the Formula box. Can I do the following:

    If Enemy's Fire Element Rate = 200%, add both atk and def debuffs for 1 turn each, in addition to Fire 1 Skill's damage of [100 + a.mat * 2 - b.mdf * 2]?
  20. YouKnowA said:
    Heya SCQ,

    This might point you in the right direction:

    var x = 1; var arr = [25, 26, 27, 28, 29, 30]; for (var i = 0, len = arr.length; i < len; i++) {x += a.hasWeapon($dataWeapons[arr]) ? (a.atk + a.agi + a.mat) : 0}; a.atk += x;This uses a.atk+a.agi+a.mat+a.atk for weapon IDs 25-30, but just a.atk for other weapons. 

    Of course, it's super ugly. If anyone has a cleaner way of doing it, that'd be pretty rad.

    Doesn't do damage.

    In case anybody else is wondering, it's supposed to be with weapons that use another stat for its basic attack which could be done with a plug-in that comes with the software, but also the same weapon could be used in other skills that otherwise are similar to normal attacks (Double Strike for example.)