RMMV Damage Formula - ideas and help

● ARCHIVED · READ-ONLY
Started by Shaz 1539 posts Page 24 of 77 View original ↗
  1. zerobeat032 said:
    hey! found a site with what I think is EVERY known thing we can use to make formulas... question is am I allowed to link another rpg maker site? 



    Feel free. As long as it helps everyone else and harms no one. //rmwforums.s3.amazonaws.com/emoticons/default_smile.gif
  2. zerobeat032 said:
    Alright cool! here's the link everyone... https://rpgmakermv.co/threads/damage-formulas-101-mv-edition.2172/


    This has examples and I'm pretty sure it list most, if not all, the things we can plugin into a formula. 



    Yes, thank you! There are actually more to these, depending on the plugin you use. Some programmer actually tell you, and you can check with them. Yanfly, for example, usually list down towards the end of the plugin help file. One example is row size from Row Formation plug in.


    Thanks again for sharing! I hope others find it useful too. //rmwforums.s3.amazonaws.com/emoticons/default_smile.gif


    - Riff
  3. Can I make a skill that only harms the user if it fails, like Invigorate from Bravely Default?
  4. Hello again to all of you :D


    I need a little help here


    b.isStateAffected(18) ? ((1 - (b.mp / b.mmp)) * 200) + 100 + a.mat * 4 - b.def * 3; b.gainMp(-1 * b.mmp) : ((1 - (b.mp / b.mmp)) * 200) + 100 + a.mat * 4 - b.def * 3


    First and foremost the skill does more damage the less Mp the enemy has, that is easy and already taken care of, however I need  a little help, if the enemy is affected in this case by state 18 the enemy should also lose all of their Mp, it isn't working however and it returns a aneourmous 0, does anyone know why?


    thank you all for your help.in advance
  5. emelian65 said:
    Hello again to all of you :D


    I need a little help here



    b.isStateAffected(18) ? ((1 - (b.mp / b.mmp)) * 200) + 100 + a.mat * 4 - b.def * 3; b.gainMp(-1 * b.mmp) : ((1 - (b.mp / b.mmp)) * 200) + 100 + a.mat * 4 - b.def * 3


    First and foremost the skill does more damage the less Mp the enemy has, that is easy and already taken care of, however I need  a little help, if the enemy is affected in this case by state 18 the enemy should also lose all of their Mp, it isn't working however and it returns a aneourmous 0, does anyone know why?


    thank you all for your help.in advance



    Hello! You can try this:


    c = ((1 - (b.mp / b.mmp)) * 200) + 100 + a.mat * 4 - b.def * 3; b.isStateAffected(18) ? b.gainMp(-1 * b.mmp); c : c


    - Riff
  6. Riff said:
    Hello! You can try this:


    c = ((1 - (b.mp / b.mmp)) * 200) + 100 + a.mat * 4 - b.def * 3; b.isStateAffected(18) ? b.gainMp(-1 * b.mmp); c : c


    - Riff



    I don't get it sometimes works, sometimes it does reduces the foe Mp to 0, sometimes it doesn't, also it still doesn't do any damage... it returns only 0
  7. emelian65 said:
    I don't get it sometimes works, sometimes it does reduces the foe Mp to 0, sometimes it doesn't, also it still doesn't do any damage... it returns only 0



    That is definitely odd. I dont see the problem with the formula. I hope someone will come by and take a look. >.<
  8. I have a problem and the answer is one of three:


    - I don't know how to calculate a log correctly; or


    - RMMV doesn't know how to do it; or


    - I'm inputing the formula wrong (this is probably the case).


    This is the damage formula for a regular attack (20% variance):


    Math.log(a.atk * 2, b.def + 1) * 10


    So, I run the test battle...


    Hero Attack is 11 (this includes equipment), Defense is 13 (including equipment); Enemy Attack is 13; Defense is 9.


    If I'm not mistaken, the Hero should cause around 13.4 points of damage (10.7 to 16.1)... and the engine shows 28 or 29...


    Where's the error here? And how to correct this?
  9. How would I input these in RMMV?


    An attack that drains the user's Max HP with each use.
    $game_actors[a.id].add_param(0,-25);(a.level+a.mp)/5*(a.mat/3)


    An ability that makes a call to a common event to pull various bits of information based on the target.


    v[1]=b.name;v[2]=b.hp;v[3]=b.mhp;v[4]=b.mp;v[5]=b.mmp;v[6]=b.enemy_id;0


    And an ability that stores the Id of the user to use in conjunction with a common event to perform various effects depending on who used the ability.


    v[7]=a.id;1+((v[9]-v[10]/2)(50+a.mat*3-b.mdf*2))
  10. Fermmoylle said:
    I have a problem and the answer is one of three:


    - I don't know how to calculate a log correctly; or


    - RMMV doesn't know how to do it; or


    - I'm inputing the formula wrong (this is probably the case).


    This is the damage formula for a regular attack (20% variance):



    Math.log(a.atk * 2, b.def + 1) * 10


    So, I run the test battle...


    Hero Attack is 11 (this includes equipment), Defense is 13 (including equipment); Enemy Attack is 13; Defense is 9.


    If I'm not mistaken, the Hero should cause around 13.4 points of damage (10.7 to 16.1)... and the engine shows 28 or 29...


    Where's the error here? And how to correct this?

    Try this and see if it changes anything for you.

    Code:
    Math.log10(a.atk * 2, b.def + 1) * 10
  11. Slimelord said:
    Try this and see if it changes anything for you.



    Math.log10(a.atk * 2, b.def + 1) * 10

    I've found another way, using natural log and a few other aditions. Thanks for your help anyway. :)
  12. Ok i've been experimenting a bit with the damage formula and i have no idea why it isn't working.


    What i want to get for my game is be able to define some additional parameters for my actors and enemies, to be used in damage calculation etc..


    So i've read in the help file, that specific notetags are automaticly read into a meta-field. To test this out i've given the first actor the following notetag:


    <foo:bar>


    According to the help file


    actor.meta.foo === 'bar'


    should be true.


    And so i adaptet the damage formula for the attack skill:


    var c =0; if(a.meta.foo === 'bar') {c=200;} a.atk * 4 - b.def * 2 + c;


    The idea is, actor1 should hit harder, everybody else should hit like normal. But in fact everybody does 0 damage or misses. So i guess there is some kind of error in the formula, but i don't see it.
  13. MagicMagor said:
    Ok i've been experimenting a bit with the damage formula and i have no idea why it isn't working.


    What i want to get for my game is be able to define some additional parameters for my actors and enemies, to be used in damage calculation etc..


    So i've read in the help file, that specific notetags are automaticly read into a meta-field. To test this out i've given the first actor the following notetag:



    <foo:bar>


    According to the help file



    actor.meta.foo === 'bar'


    should be true.


    And so i adaptet the damage formula for the attack skill:



    var c =0; if(a.meta.foo === 'bar') {c=200;} a.atk * 4 - b.def * 2 + c;


    The idea is, actor1 should hit harder, everybody else should hit like normal. But in fact everybody does 0 damage or misses. So i guess there is some kind of error in the formula, but i don't see it.



    That's interesting. Have you tried putting a space aftee the if? Like:

    Code:
    var c = 0; if (a.meta.foo === 'bar') {c = 200;} a.atk * 4 - b.def * 2 + c;
  14. Yes, hello. I have a question about how MV calculates critical hits. Is there a way to determine when a critical hit is struck? (for my own nefarious purposes).
  15. Jeysonmcfly said:
    Yes, hello. I have a question about how MV calculates critical hits. Is there a way to determine when a critical hit is struck? (for my own nefarious purposes).



    By default, it's simple - Attacker's Critical Rate - Defender's Critical Evasion.


    There are few other plugins out there that adjust this.
  16. Riff said:
    By default, it's simple - Attacker's Critical Rate - Defender's Critical Evasion.


    There are few other plugins out there that adjust this.

    Right, I get that, but is there a way to determine exactly when the critical hit happens? like.. result.critical() or something like that....? People in Yanfly's plugin thread don't know the answer I guess, and no one's answered for at least 24 hours in the Action Battler Plugin thread about this... is it not possible?
  17. That's interesting. Have you tried putting a space aftee the if? Like:



    Just tried that, without success. With console.log i managed to see that everything before the if gets executed correctly, but neither the if-case nor the stuff afterwards are executed.


    Edit: Ok after a bit of tinkering i found the reason. JS throws a TypeError because meta is undefined, even in case of the first actor. So it seems i either wrote that notetag wrong or there is something else to be done before that data is written into the meta-field.
  18. Guess I will take this problem I'm having to the plugin suggestion thread, since it doesn't seem that anyone knows how to determine when a critical attack will be precisely dealt.
  19. Hello, I just started learning battle formulas and I have a question about self buffing after an attack. I am using this https://rpgmakermv.co/threads/damage-formulas-101-mv-edition.2172/ to figure out the commands.


    I have a skill that hits the enemy and then applies an attack buff to the user for 3 turns, would something like this work using parameter IDs:


    a.addBuff(2, 3); 100 + a.atk - b.def


    or would this work, since I don't want to buff the user before the damage:


    100 + a.atk - b.def; a.addBuff(2, 3)


    Thank you.