RMMV Damage Formula - ideas and help

● ARCHIVED · READ-ONLY
Started by Shaz 1539 posts Page 3 of 77 View original ↗
  1. Liak said:
    I have 3 questions.

    2. How do you do "if" branches, is there are short version? In Ruby, it was "condition ? yes : no". What's the equivalent?
    I have an answer to one of these thanks to Shaz!

    a.atk * (b.isStateAffected(13) ? 3.25 : 2) - b.def

    or 

    b.isStateAffected(13) ? r = a.atk * 3.25: r = a.atk * 2 ; r - b.def
  2. Nice, thank you. :) So it's actually the same.
  3. JosephSeraph said:
    The default formula cuts it if you keep the numbers low. But I'd use a simple a.atk - b.def. Remember to keep your def values roughly half than atk.

    Still, I hate directly subtractive formulae.
    Oddly, I've found the default formulas to be kinda of blah for games that use lower numbers. The default a4 - d2 doesn't really cooperate with me in a game where I want a Level 1 character to do 10-20 damage. The difference of 1 or 2 ATK will decide whether or not your character is balanced or exceedingly broken.

    My favorite low-number formula to use is:

    (a.atk * 0.5 - b.def *0.25) + a.[stat]This will give you much more leeway in stat balancing. Instead of that 1-2 ATK being the difference between life and death, you now have about 6-10 points of ATK to work with in tiering significant power differences.

    The a.[stat] part is optional. Replace [stat] with a stat that you're not using and is invisible to the player. If you're not using Luck for anything else, for example, make it invisible and use that. I give higher tiers of enemies incrementally more Luck to keep the difficulty curve progressive.

    EDIT: I think I misunderstood the point you were trying to make, but I hope this advice helps users who want to make an RPG with low numbers. :)
  4. How do you make a stat invisible, anyway? Is there a way to completely hide stats from the status/equipment screens?
  5. whitesphere said:
    There is no need for the to_i function.  That is Ruby specific.  In fact, Javascript treats all numbers (except array indexes) as floating point.  Try:

    c=b.hp;d=b.mp;b.hp=d*1.33+b.level;b.mp=c*0.5-b.level;0
    I see.

    I copied over yours, but it still gives me the no effect message. :(
  6. .
  7. Heyo everyone!

    This may be the most stupid of noob questions... but I used to do this whole "certain attacks give you x amount of MP back" thing in almost all my games with VX ace. I wanted to use a system like that for my first MV game too, but what worked in ace doesn't seem to work anymore in MV.

    i used to do:

    a.mp+=10; attack formula

    now it just doesn't give me MP. the attack calculates just fine though.

    i'm using a whole bunch of the yanfly plugins that came with the dlc, if that matters somehow.

    would really appreciate it if someone would be kind enough to help me out :)

    ps: sorry for bad english. not my native tongue :(
  8. a.gainMp(10)
  9. Shaz said:
    a.gainMp(10)
    thanks a lot! so simple... now i feel even more stupid :D
  10. Ishiirou said:
    Does anyone have a decent damage formula that doesn't involve addition / subtraction (they don't scale and there are magic number combinations when damage is 0 even at high lvls when it should be much higher) and don't use flat damage values instead of power values for spells?
    Like the one I suggested on the previous page?  Or is there something off about that one, so far as you can tell?
  11. Can someone help me translate ((a.atk / 2 ) **1.8) - ((b.def / 2 ) **1.8) to MV? It does not seem to work. Sure i could write (a.atk / 2) * (a.atk / 2) but that takes up to much room. 
  12. I think its unfortunate that MV doesn't have an easy quick calculator for damage it would be way easier for less advanced users i mean i'm not an RPG maker newb but it is hard to calculate damage like that in my opinion.
  13. Tobbx said:
    Can someone help me translate ((a.atk / 2 ) **1.8) - ((b.def / 2 ) **1.8) to MV? It does not seem to work. Sure i could write (a.atk / 2) * (a.atk / 2) but that takes up to much room. 
    (a.atk / 2) ** 1.8

    translates to

    Math.pow(a.atk/2, 1.8)
  14. One thing I noticed is that the Formula field still goes directly through a eval().

    This has some not-so-intended consequences that can be used as features, but they do cause some bugs in some specific situations.

    One such bug is that characters set to Auto-Battle go through their entire skill list at the beginning of each turn, and they do run the eval() in each skill. Normally, this would only return a number (the result of the damage formula). But if you type a command in the formula field.... this command actually gets executed at the beginning of every turn.

    So, if you have a formula that begins with:

    a.gainMp(20);You may notice that characters set to Auto-Battle (who have access to this skill) will gain 20 MP at the beginning of every turn, even if they never actually use this skills.

    This doesn't seem to affected Confused characters, nor Enemies. So it appears to be safe to use as long as you don't use Auto-Battle.
  15. I have a question.

    I'm trying to make an attack that has an increased crit rate.  I see that I can add a state as part of the attack, using the a.addstate command, is there a similar command that can be used to affect crit rate, without making a stat to reference it to?
  16. Liak said:
    I have 3 questions.

    1. How do you get the number of states on someone?

    2. How do you do "if" branches, is there are short version? In Ruby, it was "condition ? yes : no". What's the equivalent?

    3. Is there a way to get the turn number?
    Can anyone help me with 1 and 3? :(
  17. Milennin said:
    I see.

    I copied over yours, but it still gives me the no effect message. :(
    Quoted formula was: c=b.hp;d=b.mp;b.hp=d*1.33+b.level;b.mp=c*0.5-b.level;0

    Are you sure nothing is changing? You're probably getting the "no effect" message because the last value in the damage box is zero, which means the function (which is what this really is) is returning a value of zero to the calling code. Even though the hp and mp value have been changed, the calling function sees 'damage == 0' and thinks nothing happened.

    At least, that's my first instinct on seeing that code.
  18. okugi said:
    I have a question.

    I'm trying to make an attack that has an increased crit rate.  I see that I can add a state as part of the attack, using the a.addstate command, is there a similar command that can be used to affect crit rate, without making a stat to reference it to?
    the only relevant code for checking crit rate is in rpg_object.js:

    Game_Action.prototype.apply runs this line:

    result.critical = (Math.random() < this.itemCri(target));so this is the function being called:

    Game_Action.prototype.itemCri = function(target) {    return this.item().damage.critical ? this.subject().cri * (1 - target.cev) : 0;};So you can try directly increasing the attacker's "cri".

    Code:
        // CRItical rate    cri: { get: function() { return this.xparam(2); }, configurable: true },
  19. Mouser said:
    Quoted formula was: c=b.hp;d=b.mp;b.hp=d*1.33+b.level;b.mp=c*0.5-b.level;0

    Are you sure nothing is changing? You're probably getting the "no effect" message because the last value in the damage box is zero, which means the function (which is what this really is) is returning a value of zero to the calling code. Even though the hp and mp value have been changed, the calling function sees 'damage == 0' and thinks nothing happened.

    At least, that's my first instinct on seeing that code.
    No, I've tried it out, and it does nothing at all. :(
  20. Wait, you can use Javascript within the damage formula calculator? So if I wanted to place an if statement that doubled the amount of damage dealt if the actors HP was below a certain point, I could do that?