RMMV Damage Formula - ideas and help

● ARCHIVED · READ-ONLY
Started by Shaz 1539 posts Page 12 of 77 View original ↗
  1. dayhjawk said:
    How would one go around to setting up a basic attack, that does more damage based on how much HP the user has lost? 
    You could add in something like atk * (1 - (a.hp/a.mhp)) to get that effect. It deals damage based on a percentage of their current health over their max health. Alternatively, if you wanted to do something like deal 2 damage per each HP lost, you would do 2 * (a.mhp - a.hp). 

    RogdagoR said:
    VHStapes, on 01 Nov 2015 - 2:17 PM, said:

    VHStapes said:
    EDIT: New question!

    How can I target a different character in the party, besides a or b, without it being actor specific? Let's say I want a skill that deals damage and heals every party member except the caster for an amount equal to the damage dealt? So...

    x = (a.tk - b.def); ALL_OTHER_PARTY_MEMBERS.gainHp(x); x

    What should ALL_OTHER_PARTY_MEMBERS be replaced with?
    I'm trying to do some skill that is quite the same of your, did you figured out how to heal/buff all party members? I didn't find a reply in here about this, or maybe i'm blind lol.

    I'm looking to do 2 "limit" skills that deals aoe damage to enemy, one as bonus heal the party and remove debuffs, and the other give bonus damage of 1 element....

    Someone know how to apply heal/buff to entire party? I just need an example so i can figure out other kind of similar "limit" skill
    I've been trying to figure out the command for doing this, as well. My only difference is that I would want it to heal the entire party instead of every OTHER member, but I figure the way to do it would be similar. Any ideas?
  2. PlatypusOfDoom said:
    You could add in something like atk * (1 - (a.hp/a.mhp)) to get that effect. It deals damage based on a percentage of their current health over their max health. Alternatively, if you wanted to do something like deal 2 damage per each HP lost, you would do 2 * (a.mhp - a.hp). 
    So I would do something like this for the formula?

    a.atk * (1 - (a.hp/a.mhp)) - b.def * 2
  3. If I'm right, I think it would need a for loop to target all the actors. I just don't know what the code would be exactly.

    Something like

    for(var i = 0; i < $gameParty.members.length(); i++) { $gameParty.members(i).hp + x; $gameParty.members(i).removeBuff };You might want to replace:

    $gameParty.member(i)withBattleManager.actor(i)Of course you'd need some code in there for the actual damage and healing calculations.

    Also, I wouldn't expect to plug this in and have it work as I am a Javascript n00b, but I'm sure someone can clean it up from here.

    (So many edits, I shall not double post!)
  4. I might have missed it, but is there a way to make sure attacks do at least 1 point of damage? Having NULL pop up when the party outlevels enemies is kinda sloppy looking. :c

    edit: Nevermind! I got it!
  5. I'm trying to make a skill that adds to the actor's atk value based on your party's gold, then removes gold equal to the amount it added. So far I've got it adding damage correctly, but it doesn't remove the gold. In fact, when I include any attempt at removing gold, it deals exactly 0 damage every time. Any ideas?

    Code:
    x = a.atk + ($gameParty.gold() / 100); x - b.def; x; $gameParty.gainGold(-x)
  6. @VHStapes, damage must be the last thing in the formula
  7. How do I make a damage formula that scales off of the enemies missing health?

    I'm trying to copy Riven's Wind Slash skill from League of Legends.

    XX26Xe0.png
  8. Musashi said:
    @VHStapes, damage must be the last thing in the formula
    Wow I swear I tried it that way, but that fixed it! Thanks
  9. PlatypusOfDoom said:
    I've been trying to figure out the command for doing this, as well. My only difference is that I would want it to heal the entire party instead of every OTHER member, but I figure the way to do it would be similar. Any ideas?
    VHStapes said:
    If I'm right, I think it would need a for loop to target all the actors. I just don't know what the code would be exactly.


    Something like


    for(var i = 0; i < $gameParty.members.length(); i++) { $gameParty.members(i).hp + x; $gameParty.members(i).removeBuff };


    You might want to replace:


    $gameParty.member(i)


    with


    BattleManager.actor(i)


    Of course you'd need some code in there for the actual damage and healing calculations.


    Also, I wouldn't expect to plug this in and have it work as I am a Javascript n00b, but I'm sure someone can clean it up from here.
     
    I was wondering if there is a command for "call" one other skill, i mean i cast my aoe, it resolve the damage and then call the aoe heal spell, is it doable?
  10. Silenity said:
    How do I make a damage formula that scales off of the enemies missing health?

    I'm trying to copy Riven's Wind Slash skill from League of Legends.

    XX26Xe0.png
    If you want to make exactly this skill (exept for the level of the skill), it should look at something like this:

    y=(1-Math.max((b.hp/b.mhp),0.25));r=120+(a.atk*0.6);r=Math.round(r*(2.67*y+1));rWith the y as the % of target's missing health with a cap for the 75%, first part r as the minimum physical damages increased by the atk of the user (or the AD in lol), and second part r as the multiplication of the target's missing health percentage.
  11. Nuhada said:
    If you want to make exactly this skill (exept for the level of the skill), it should look at something like this:

    y=(1-Math.max((b.hp/b.mhp),0.25));r=120+(a.atk*0.6);r=Math.round(r*(2.67*y+1));rWith the y as the % of target's missing health with a cap for the 75%, first part r as the minimum physical damages increased by the atk of the user (or the AD in lol), and second part r as the multiplication of the target's missing health percentage.
    Thanks! Do you think you could help me with another one?

    I'm trying to recreate Garen's Decisive Strike from League of Legends. I find that LoL has a lot of interesting skills that I can pull ideas from. >_<

    I'm trying to have the skill remove negative states from Garen while also adding a speed buff to him. On top of that I'm trying to make the skill add a silence state to the enemy.

    a.add_state(13); 30 + a.atk + (a.atk * .4)
    This is what I currently have but it seems to do no damage. I can inflict the silence fine but need help with removing negative states as well as adding the speed state.

    e6rckwS.png
  12. Silenity said:
    a.add_state(13); 30 + a.atk + (a.atk * .4)
    Use a.addState
  13. ksjp17 said:
    a = the user of the skill

    b = the target of the skill (enemy - bear in mind that this is from the point of view of the user.  So an 'enemy' of the Demon Lord is your hero.)

    * = multiplication sign.  

    the main stats use the normal abbreviation.  So

    a.atk * 4 - b.def * 2

    means that you have the attack value of the user multiplied by 4, from which you deduct (the minus sign) the defence of the target, times 2.  The resulting number is how much damage is inflicted.

    There are other things, but if you are a complete newbie, I think those are the main things to remember.  Once you've worked that out, it is simpler to follow what is going on.
    If i was to use this formula when creating skills the higher lvled the skill is the higher i would make the atk number say from a.atk * 4 - b.def * 2 to something like a.atk * 6 - b.def * 3 to make that a stronger atk?
  14. Silenity said:
    Thanks! Do you think you could help me with another one?

    I'm trying to recreate Garen's Decisive Strike from League of Legends. I find that LoL has a lot of interesting skills that I can pull ideas from. >_<

    I'm trying to have the skill remove negative states from Garen while also adding a speed buff to him. On top of that I'm trying to make the skill add a silence state to the enemy.

    a.add_state(13); 30 + a.atk + (a.atk * .4)This is what I currently have but it seems to do no damage. I can inflict the silence fine but need help with removing negative states as well as adding the speed state.

    e6rckwS.png
    For adding the state, do as he said:

    luigiman2201 said:
    Use a.addState
    To remove hexes, just put "a.removeState(x)" or all the states you want to remove, and for the buff, put "a.addBuff(6,y)" with y as the number of turns the buff stay. (6 is for the agi buff).
  15. Hey guys,

    I'm trying to create a skill which will inflict state X at a 50% chance rate, ONLY when the enemy's darkness element rate is X.  Any help?
  16. jgleazy said:
    Hey guys,

    I'm trying to create a skill which will inflict state X at a 50% chance rate, ONLY when the enemy's darkness element rate is X.  Any help?
    b.elementRate(Y)>X?Math.random()>0.5?a.addState(Z):0:0;with

    Y: ID of darkness element

    X: Darkness element rate (with 1=100%, 2=200%, 0.5=50%, etc...)

    Z: Id of state you want to add

    :)
  17. Professor_Ruffleberg said:
    I'm trying to have a skill with a guaranteed critical. In VX ACE you could use: b.result.critical = true

    This doesn't work in MV and I can't work out why.
    I finally figured this one out. :D For those of you wondering how to do this, try:

    b.result().critical = true 

    northseeker said:
    Also is it possible to have a crit apply a an affect to the enemy or myself
    With that in mind, you could do something like: 

    if (b.result().critical) {a.addState(x); y} else {y}Here you would replace x with your state ID and y with your base damage formula. Also, a.addState(x) would add a state to the user, whereas you could do b.addState(x) to add a state to the victim in the case of a crit.

    Note that I just tested this with Yanfly's new Damage Core plugin and that plugin seems to prevent this from working, probably because it changes the order that damage is calculated.
  18. PlatypusOfDoom said:
    I finally figured this one out. :D For those of you wondering how to do this, try:

    b.result().critical = true 



    With that in mind, you could do something like: 

    if (b.result().critical) {a.addState(x); y} else {y}Here you would replace x with your state ID and y with your base damage formula. Also, a.addState(x) would add a state to the user, whereas you could do b.addState(x) to add a state to the victim in the case of a crit.

    Note that I just tested this with Yanfly's new Damage Core plugin and that plugin seems to prevent this from working, probably because it changes the order that damage is calculated.
    The below has been working for me splendidly for testing purposes (or something close):

    if (b.result().critical) {a.addState(x); y} else {y}I think for the other b.result().critical = true, the game will display the graphical effects of a critical hit, but does not seem force critical damage. I don't have any plugins enabled at the moment.
  19. Nuhada said:
    b.elementRate(Y)>X?Math.random()>0.5?a.addState(Z):0:0;with

    Y: ID of darkness element

    X: Darkness element rate (with 1=100%, 2=200%, 0.5=50%, etc...)

    Z: Id of state you want to add

    :)
    You are the bomb thank you! :)  
  20. Hey I dont know if it the right place to ask this, sorry in advance if it's not.

    So I'm using small number in my game, ex: starting stat are around 30hp, 10 atk,10 def and so on.

    But the default formula (a.atk*4 - b.def*2) make battle mostly once side for the fastest side.

    So I tried takimg out the multiplier but the defence become way to strong for most battle.

    So you guys/girls have any suggestion of what I could use ?

    Thanks in advances.