RMMV Damage Formula - ideas and help

● ARCHIVED · READ-ONLY
Started by Shaz 1539 posts Page 31 of 77 View original ↗
  1. Senshu said:
    Hey guys, I need a little help with my damage formula. I'm not sure what's wrong, but maybe a veteran could see it? XD;;

    (500*(level/100)+(a.mat*100))-(b.def*30)

    The reason for the high multipliers is because in my game stats are low, but health and MP still reach around 10k at endgame, so i'm trying to even that out.

    Any help at all would be appreciated!

    It should either be a.level or a.lvl not level.


    Anything that references the attacker's stats should have an a. at the beginning, and b. for the defender.


    Note that enemies don't have levels, so that formula just flat out won't work for an enemy attack.
  2. Roderick said:
    It should either be a.level or a.lvl not level.


    Anything that references the attacker's stats should have an a. at the beginning, and b. for the defender.


    Note that enemies don't have levels, so that formula just flat out won't work for an enemy attack.

    Derp, well that's a dumb mistake, sorry and thank you. Getting back into the swing of things, and i'll keep in mind to give enemies a separate list of moves. Thanks again!
  3. Gubump said:
    How would I make a skill that does damage based on how much MP you had before using it, but drains all of your MP? In other words, how do I make my skills calculate their damage before spending their required resources instead of after?

    You can't do that in the damage formula. I'm pretty sure you need to use plugins. I did something similar with TP, if nobody else can answer before I get home, I'll post what I did later. 
  4. kovak said:
    Guys, i wanted a skill to have a min damage cap, so it would never deal less damage than the chosen value.

    Which one should i use, Math.max(x) or Math.min(x)?

    As already answered, Math.max() returns the highest on its list, and Math.min() returns the lowest. A similar useful function that would prevent you from using both in one formula is:


    (damage formula here).clamp(x,y)


    x any y can be formulas or variables, if necessary. The value will be calculated based on the formula you entered, but will never be less than x or greater than y.


    Edit: sorry about the double post. I can't figure out how to add a new quote to a post I'm editing while I'm on my phone. >_<
  5. Roderick said:
    You can't do that in the damage formula. I'm pretty sure you need to use plugins. I did something similar with TP, if nobody else can answer before I get home, I'll post what I did later. 

    oh so it's impossible with a formula, guess this was posted in the wrong thing then lol


    still, was hopeful i could maybe find a way to do it with a formula to make things somewhat simpler lol


    still, i would like to know how this is possible, cause im running out of move ideas on my last char, but a dual atk that does 1 of each, physical and magical, would be great to have, i look forward to your response ^^
  6. Jojozityjo said:
    oh so it's impossible with a formula, guess this was posted in the wrong thing then lol


    still, was hopeful i could maybe find a way to do it with a formula to make things somewhat simpler lol


    still, i would like to know how this is possible, cause im running out of move ideas on my last char, but a dual atk that does 1 of each, physical and magical, would be great to have, i look forward to your response ^^



    Um, he said that in response to mine, not in response to yours...
  7. oh, damn, it looked similar to my question, sorry, that's dyslexia at work there x.x
  8. Gubump said:
    Um, he said that in response to mine, not in response to yours...

    And then he promptly forgot about it, and didn't write anything up when he got home from work. Sorry.


    I just remembered an amazing guide I found a while ago, which might even be worth asking @Shaz to add to the OP. It can be found here: https://rpgmakermv.co/threads/damage-formulas-101-mv-edition.2172/


    Sadly, it wasn't able to provide a simple solution. When I tried the formula (a.mp);(a.setMp(0)) it dealt 0 damage. I think it was running everything at once, then animating, then recalculating the damage, because a.mp and a.setMp(0) both worked individually. So we're going to have to go back to the plugin method.


    First, set your attack to have NO MP cost, and use a.mp somewhere in your damage formula. For example (a.mat * a.mp)


    Second, get Yanfly's Skill Core. If you aren't already using Yanfly plugins, remember to get his core engine plugin; the Skill Core won't work without it.


    If you've read over the description of Skill Core, you might be tempted to use a <Custom MP Cost>  tags. Don't. The cost is deducted before the skill is used, meaning you'll always have 0 mp when damage is calculated.


    Instead, do the following:


    <After Eval>


    user.setMp(0);


    </After Eval>


    The game will NOT show a cost for this skill. You should either include something in the skill description that states that all MP will be consumed, or use the <Custom Cost Display> note tag to give a custom cost.
  9. Is there a way to make a skill to give EXP through a formula?
     
  10. kovak said:
    Is there a way to make a skill to give EXP through a formula?
     

    Check the link I posted above.


    One of the parameters is "gainExp(x)". As with any other function, you need to preface it with a. or b. to designate user or target.


    I haven't tested it, but the formula a.gainExp(-100);b.gainExp(100) should create an ability that deducts 100 XP from the user and gives it to the target.
  11. @Roderick


    Can i use it like this?

    EX: a.gainExp(6); a.atk - b.def
  12. kovak said:
    @Roderick


    Can i use it like this?

    EX: a.gainExp(6); a.atk - b.def

    I haven't played with advanced damage formulas much, so I'm not sure, but that looks like it should work.
  13. I've tested here and it was fine, felt like in tactics games after using FFT's EXP formula + Stactic EXP

    a.gainExp(10 + (a.level - b.level) * 2); 


    It makes worth facing bosses and not so rewarding when facing weak enemies, on the other hand it's nice and cozy considering Stactic EXP's customizations.
  14. Guys, let's say i wanna make a skill to deal damage * actor's level.


    The issue is that i want it to have a limit to after some levels to not keep increasing the damage.


    ex: insert entire formula * a.level and if level is higher than 10 it stops to count at 10.


    I wanted it to be able to emulate dice rolls as well, but i think it might have other applications too.
  15. kovak said:
    Guys, let's say i wanna make a skill to deal damage * actor's level.


    The issue is that i want it to have a limit to after some levels to not keep increasing the damage.


    ex: insert entire formula * a.level and if level is higher than 10 it stops to count at 10.


    I wanted it to be able to emulate dice rolls as well, but i think it might have other applications too.



    You could do this:


    (entire formula) * Math.min(a.level, 10);


    As for dice roll, can you give a bit more info on how you want it to work?


    - Riff
  16. i was using Math.randomInt(x) + 1 to get a random value equivalent to the number of faces the dice would have (4, 6, 10, 12) and then it would get multiplied by the level of the actor.
    So the formula would be like this:
    Math.randomInt(x) + 1 * a.level


    But i wanted a cap to not make skills to scale too much, this would be applied to weapon damage as well.

    Something pretty D20 :v

     
  17. kovak said:
    i was using Math.randomInt(x) + 1 to get a random value equivalent to the number of faces the dice would have (4, 6, 10, 12) and then it would get multiplied by the level of the actor.
    So the formula would be like this:
    Math.randomInt(x) + 1 * a.level


    But i wanted a cap to not make skills to scale too much, this would be applied to weapon damage as well.

    Something pretty D20 :v

     



    You can always cap anything with a Math.min(x, y) function.
  18. For some reason the first boss does 19 health versus the 499 health the main character has when it uses magic attacks. I want the boss' attacks to screw up the player. Let's say at a random number between 100 and 200... The player character's defense is 149. Is there a formula where I can do this?
  19. @Mega Man Volnutt: For such a specific case, we need to see the data on both the enemy, the actor and the skill used - there is always a reason for any number, and we need to find out why before any formula can work.


    However, I suggest doing that in a new topic in MV support as that is more than a simple question of a formula.
  20. @Mega Man Volnutt 


    If you don't want to store data you can use Math.randomInt(x) to get random values and specify a minimum number you want.


    On this case the monster's atk needs to be close to the actors defense and then test till it pleases you.



    Math.randomInt((200),100) + a.atk - b.def