RMMV Damage Formula - ideas and help

● ARCHIVED · READ-ONLY
Started by Shaz 1539 posts Page 8 of 77 View original ↗
  1. MikeMakes said:
    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]?
    Is the Fire 1 skill damage separate from the Fire Element rate = 200 condition?
  2. I'm not sure how it's suppose to be done.

    I have the following:

    Enemy Bat w/ Trait = Fire * 200%

    Skill Fire1 w/ Element Fire

    I want to keep the default damage formula [100 + a.mat * 2 - b.mdf * 2] and let the system handle the application of weaknesses / resistance modification of damage itself. What I want to add is:

    If Enemy Fire Element Rate >= 200%

    Apply Atk Buff for 1 turn, Apply Def Buff for 1 turn

    What I don't want to do is to make Fire 1 to Add Atk Buff and Def Buff without the element rate check condition.
  3. MikeMakes said:
    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]?
    b.elementRate(<insert ID of fire element>)>=2?(b.addDebuff(2,1)&&b.addDebuff(4,1)):0;100+(a.mat*2)-(b.mdf*2)I put so that the debuffs are apply if the fire element rate is equal or superior to 200%, then do the damages :)
  4. Just gonna take a wild guess and assume that 100% damage means the stat value of the attack, and 200% means double of that. And 50% means half?
  5. Nuhada said:
    b.elementRate(<insert ID of fire element>)>=2?(b.addDebuff(2,1)&b.addDebuff(4,1)):0;100+(a.mat*2)-(b.mdf*2)
    Thanks a lot, Nuhada! I'm really surprised at how powerful this can be.

    I made a correction in the quote - there was an extra "&" which didn't allow the second Debuff to take effect.

    Also, what is the correct syntax that randomizes the debuffs between certain stats only to be applied so it becomes:

    (b.addDebuff([randomized number from 2 to 4],[# of turns])

    where stats #2, #3, or #4 are possible to be debuffed
  6. I am  trying to make a damage formula that would put actor2 into sleep, but would heal everyone else.

    So the damage formula needed to check if the target was nr2 and then take action.

    vr1 : b.id?(2) b.addState(10) : 150.   Didnt work. Just says didnt do any damage to Actor2  and shows a 0.

    vr2: if b.id?(2); b.addState(10) ; else; 150 ; end Same as above.

    the "b.addState(10)" work just fine on enemys but not allies. 

    Can anyone help me :( ?
  7.   I'm trying to get a skill to change a variable.

    I've looked around, and have found that "v[7] = 3" in the damage formula will set it to 3, but I can't figure out how

     to do anything else. 

    Say, if I want to increase the variable by 3, "v[7] + 3" or "v[7] += 3" don't seem to work.
  8. MikeMakes said:
    Also, what is the correct syntax that randomizes the debuffs between certain stats only to be applied so it becomes:

    (b.addDebuff([randomized number from 2 to 4],[# of turns])

    where stats #2, #3, or #4 are possible to be debuffed
    Use 

    Math.randomInt(3) + 2Math.randomInt(3) will give you either 0, 1, or 2 at random. Adding 2 afterwards will obviously make it vary between 2 and 4.
  9. SgtBusCake said:
    Hello Pumamori,

    Try:

    y = b._actorId === 1 ? 200 : 100; y
    For some reason when I trid this it didnt work for me.... Is there anything that I missed? Do I need to make a variabel for it? I made one (nr6) and the wrote var 6 = b._actorId === 2 ? 200 : 100 ; var 6 and it didnt worked :(  
  10. Iliketea said:
    I am  trying to make a damage formula that would put actor2 into sleep, but would heal everyone else.

    So the damage formula needed to check if the target was nr2 and then take action.

    vr1 : b.id?(2) b.addState(10) : 150.   Didnt work. Just says didnt do any damage to Actor2  and shows a 0.

    vr2: if b.id?(2); b.addState(10) ; else; 150 ; end Same as above.

    the "b.addState(10)" work just fine on enemys but not allies. 

    Can anyone help me :( ?
    Iliketea said:
    For some reason when I trid this it didnt work for me.... Is there anything that I missed? Do I need to make a variabel for it? I made one (nr6) and the wrote var 6 = b._actorId === 2 ? 200 : 100 ; var 6 and it didnt worked :(
    it didn't work beacause "var 6" isn't a good variable name, you have to make a name with no space.

    For your formula, try this:

    y=0;(b._actorId===2?b.addState(10):y=<Insert Heal>);yIt is a bit strange, but this is the only way i found to make it works. Also, you will have a "0" pop when the heal targets the actor 2.

    Mirai Ko said:
      I'm trying to get a skill to change a variable.

    I've looked around, and have found that "v[7] = 3" in the damage formula will set it to 3, but I can't figure out how

     to do anything else. 

    Say, if I want to increase the variable by 3, "v[7] + 3" or "v[7] += 3" don't seem to work.
    You need to use "$gameVariables[n]" when you refer to a game variable in the formula box :)

    TNinja said:
    Just gonna take a wild guess and assume that 100% damage means the stat value of the attack, and 200% means double of that. And 50% means half?
    Yep !
  11. Thank you so much Nuhada! It finally works :D
  12. SpellcraftQuill said:
    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.)
    Doesn't do any damage in what way? Do you mean it does 0's or that the skill when used just does nothing?

    I thought it might be something where a script was helping me out, but I tried 

    var x = 1; var arr = [1]; 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;in the basic thing. The guy with the sword does more damage than the others.
  13. Thank you, luigiman2201. I've always had trouble for random number whether it to put the +2 inside  with the 3 or outside. But that makes sense if you think about the order of operations.
  14. Nuhada said:
    You need to use "$gameVariables[n]" when you refer to a game variable in the formula box :)
    Neither "$gameVariables.setValue(14, ($gameVariables[14] + 1))" nor "gameVariables[14] += 1" increment the variable by 1 :-(
  15. Hey guys! I have a question, and I don't quite know if it's been answered, but how do I set up a skill that damages both the target, AND the user? I have a skill that

    drains the target's MP, but also damages the user's HP. 
  16. Noferatsi said:
    Hey guys! I have a question, and I don't quite know if it's been answered, but how do I set up a skill that damages both the target, AND the user? I have a skill that

    drains the target's MP, but also damages the user's HP. 
    Nuhada covered this a few pages back. You can do something like a.gainHp(-Math.floor((a.atk/10))); at the start of a damage equation if you want it to be based on the user's attack.

    a.gainHp(-Math.floor((a.mhp/10))); is also pretty cool. It does damage based on the attacker's max HP.

    a.gainHp(-Math.floor((a.mhp/10))); a.agi * 9 - b.def * 2worked for me. If you want to do damage to the attacker's HP similar to the defender's lost MP, you could use something like this:

    a.gainHp(-(a.agi * 9 - b.def * 2)); a.agi * 9 - b.def * 2But, replace the equation a.agi * 9 - b.def * 2 w/ the one you want.
  17. Hmmm... morning thought:
    MV naturally doesn't have the capacity for an attack that hits more than one element.

    Is it possible to use the formula box to cheat that?

    Like lets say this: I add Element 10: Multielemental. [using Defaults otherwise; Fire + Water example?]. That's what the skill used.
    b.elementRate(10) = b.elementRate(2) * b.elementRate(5) ; 2*a.mat - b.mdf

    Tried it, didn't work, only yielded no damage [Tried 5 different targets: 1 that was completely neutral (should deal normal magic damage in that case); 1 that was weak to both Fire and Water (should deal 225%); 1 that was weak to 1 and strong to the other (should actually deal 100.5% damage); and one that was Weak to one, completely immune to another (Should Deal zero)....]
     

    Mirai Ko said:
      I'm trying to get a skill to change a variable.

    I've looked around, and have found that "v[7] = 3" in the damage formula will set it to 3, but I can't figure out how

     to do anything else. 

    Say, if I want to increase the variable by 3, "v[7] + 3" or "v[7] += 3" don't seem to work.
    "v[7] = v[7] + 3" ?
  18. AirshipCanon said:
    Hmmm... morning thought:

    MV naturally doesn't have the capacity for an attack that hits more than one element.

    Is it possible to use the formula box to cheat that?

    Like lets say this: I add Element 10: Multielemental. [using Defaults otherwise; Fire + Water example?]. That's what the skill used.

    b.elementRate(10) = b.elementRate(2) * b.elementRate(5) ; 2*a.mat - b.mdf

    Tried it, didn't work, only yielded no damage [Tried 5 different targets: 1 that was completely neutral (should deal normal magic damage in that case); 1 that was weak to both Fire and Water (should deal 225%); 1 that was weak to 1 and strong to the other (should actually deal 100.5% damage); and one that was Weak to one, completely immune to another (Should Deal zero)....]

    "v[7] = v[7] + 3" ?
    Hi Airship,

    That's a pretty cool idea. I made a fire element spell w/ a damage formula of:

    b.elementRate(4)*(100 + a.mat * 2 - b.mdf * 2)Element#4 being thunder. This should make a spell that applies the damage rate of thunder on top of the spell's native fire element. I didn't do extensive testing, but it seems to get the expected damage behaviors (tried weak to both, weak to neither, weak to one and strong to the other).
  19. YouKnowA said:
    Doesn't do any damage in what way? Do you mean it does 0's or that the skill when used just does nothing?

    I thought it might be something where a script was helping me out, but I tried 

    var x = 1; var arr = [1]; 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;in the basic thing. The guy with the sword does more damage than the others.

    My archer with much higher dexterity definitely does a lot of damage, but how do I go about to take defense into consideration for each formula? It does 0 damage when include the b.def in the formulae.  Don't forget enemies have to attack too although making separate skills for that will work.

    In other words 

    var x = 1; var arr = [1]; for (var i = 0, len = arr.length; i < len; i++) {x += a.hasWeapon($dataWeapons[arr]) ? (a.mdf - b.def) : 0}; a.atk-b.def += x;Deals a consistent damage of 0.
  20. SpellcraftQuill said:
    My archer with much higher dexterity definitely does a lot of damage, but how do I go about to take defense into consideration for each formula? It does 0 damage when include the b.def in the formulae.  Don't forget enemies have to attack too although making separate skills for that will work.

    In other words 

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

    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.