RMMV Damage Formula - ideas and help

● ARCHIVED · READ-ONLY
Started by Shaz 1539 posts Page 5 of 77 View original ↗
  1. Korokage said:
    Just quoting this since I don't think that first question got answered and I'm curious about the answer as well.
    try actor.states().length or actor.allIcons().length
  2. Thank you! :) I'll try that.

    My question about turn number also hasn't been answered yet,
  3. SgtBusCake said:
    Hello Cel,

    I've not looked into the code behind the scenes on this, but I found that I was able to get away with inflicting 0 damage and still apply the ailments by adjusting the end of the formula. The 0 still appears and if it is not present, the poison will land, but will not actually deal damage at the end of each turn.

    (b.isStateAffected(34) ? b.addState(34) : b.isStateAffected(33) ? b.addState(34) : b.isStateAffected(32) ? b.addState(33) : b.isStateAffected(31) ? b.addState(32) : b.addState(31)); 0At first, I was a bit confused with the poisons stacking when yours were not. Then I figured you may have added a Trait in the State Resist of the lower tier of poison and that seemed to do the trick for me.
    Thing is, I can apply the states without damage, but if I do something in the engine seems to bug up and the enemy simply starts skipping its turns instead of having the states affect it. Even with a simple copy-paste of the poison state it'll act like a permanent freeze unless the state applying formula also deals some damage. I've tried this with all scripts turned off, some on and some off and so on. Same result. As long as there's an actual damage part it works fine. Without it it doesn't. The one thing I haven't tried is writing up a formula that returns 0 instead of just writing 0.

    And yes, State 32 resists state 33 which in turn resists state 32 and so on. Though it's not really relevant to the problem I ran into that's how I made them not stack rather than adding the state removals directly into the formula box.
  4. SgtBusCake said:
    Still learning at how all of this works and I'm certain there is a better way than what I threw together.

    In the meantime, I think this may simulate the effect of swapping HP and MP with the formula you provided.

    Try:

    Code:
    c = b.hp; d = b.mp; b.gainHp(-b.hp+1); b.gainMp(-b.mp); b.gainMp(Math.round(c * 0.5 - b.level)); b.gainHp(Math.round(d * 1.33 + b.level)); 0
    If I'm not mistaken, if a caster continually casts this HP Conversion spell on a target, the target will gradually lose both HP and MP, due to the MP being halved with each iteration.
    Thanks, that works the way I need it to. :D
  5.  Hi, guys. So I'm really new to MV (last version of RPG Maker I used was 2000 when it was new). I'm trying to gain a grasp of the syntax for this equation stuff so I'm trying to start off light/easy.

     I want to have an attack that deals damage to both the enemy and myself. I tried the following:

     a.atk * 4 - b.def * 2; a.gainHp(-7)

     ...I think this deals a ton of damage to my hero though because nothing is done to the opponent and the hero just collapses. What I would like to do is use the default equation against the enemy, then do a small amount of damage to the hero. I tried a bunch of other stuff and this is the closest I've gotten to doing that. How would I go about doing this?

     (Thanks in advance for any help btw.)
  6. Calicer said:
    I have 2 questions:

    1. I was wondering is there a way to add debuffs or buffs in the formula box now

    2. Can I have an if/else statement checking the value of a random integer

    Any help is appreciated, thanks :)
    1: Buffs / Debuffs: a.addBuff(x, y) / b.addDebuff(x, y)

    with x: 0 = mhp,

    1 = mmp,

    2 = atk,

    3 = def,

    4 = mat,

    5 = mdf,

    6 = agi,

    7 = luck,

    and y = numbers of turn.

    2: I think you can make

    if((Math.random()>x)) { formula };Wich take a random int between 0 and 1 (in fact, 0.999 but not exactly 1) and apply condition if the random number is more than x.

    And yeah, you can mix both, so that ther is a radom chance to buff a stat when attack x)

    (Math.random()>0.5)?(a.addBuff(3,4));damages
    tremblinglight said:
     Hi, guys. So I'm really new to MV (last version of RPG Maker I used was 2000 when it was new). I'm trying to gain a grasp of the syntax for this equation stuff so I'm trying to start off light/easy.

     I want to have an attack that deals damage to both the enemy and myself. I tried the following:

     a.atk * 4 - b.def * 2; a.gainHp(-7)

     ...I think this deals a ton of damage to my hero though because nothing is done to the opponent and the hero just collapses. What I would like to do is use the default equation against the enemy, then do a small amount of damage to the hero. I tried a bunch of other stuff and this is the closest I've gotten to doing that. How would I go about doing this?

     (Thanks in advance for any help btw.)
    I'm not sure but i think it don't work because you need to put the damage made to the enemy at the end of the formula, so :

    Code:
    a.gainHp(-7); a.atk * 4 - b.def * 2
  7. Shaz said:
    Guys, please don't say "it was like ... in Ace, so try that" - MV does NOT use the same language, class or method names, so chances are it's NOT going to work and will just fill up the thread with incorrect answers.  If you don't know, please don't answer, and just let it wait until someone can come along who does know, or can look it up.  Thanks :)

    Having said that, if you HAVE a formula that works in Ace and want to know what to do in MV to achieve the same thing, by all means copy and paste it here (code tags will help with the formatting).  If you use the Quick button, go ahead and use it in Ace, then paste in the formula that it gives you.  Then we've got something definite to work with.
    I'm sorry, but is there any particular reason why the "quick damage" button from VX isn't in MV?  It seems that a lot of people want it and one solution for all of this confusion I've seen was literally "use it in Ace, then paste in the formula that it gives you", so they cannot be that different from each other.  So why isn't the same feature in MV?  I find it's exclusion very curious and it overall adds an unnecessary step to do the exact same thing that was a simple button click in VX Ace.  Is it planned to be added later or something?
  8. tremblinglight said:
    Hi, guys. So I'm really new to MV (last version of RPG Maker I used was 2000 when it was new). I'm trying to gain a grasp of the syntax for this equation stuff so I'm trying to start off light/easy.

    I want to have an attack that deals damage to both the enemy and myself. I tried the following:

    a.atk * 4 - b.def * 2; a.gainHp(-7)

    ...I think this deals a ton of damage to my hero though because nothing is done to the opponent and the hero just collapses. What I would like to do is use the default equation against the enemy, then do a small amount of damage to the hero. I tried a bunch of other stuff and this is the closest I've gotten to doing that. How would I go about doing this?

    (Thanks in advance for any help btw.)
    (Replying from phone and without being able to test.)

    Hi Trembling Light,

    To verify, this ability is targeting the enemy and the damage type is set to HP Damage?

    The game seems to want things like isStateAffected or gainHp before the damage calculation.

    One thing I would like to try is the following:

    c = a.atk * 4 - b.def * 2; a.gainHp(Math.round(-c / 10)); c

    What this should do is calculated roughly how much damage you will do in advance, then deal damage to the caster. In this case, 10% of whatever damage you dealt. After the self damage, the formula *should* do c damage.
  9. Nuhada said:
    I'm not sure but i think it don't work because you need to put the damage made to the enemy at the end of the formula, so :

    a.gainHp(-7); a.atk * 4 - b.def * 2
     Thank you!!!! You're the best, seriously. I'm going to spend all evening playing around with the equations now...
  10. SgtBusCake said:
    (Replying from phone and without being able to test.)

    Hi Trembling Light,

    To verify, this ability is targeting the enemy and the damage type is set to HP Damage?

    The game seems to want things like isStateAffected or gainHp before the damage calculation.

    One thing I would like to try is the following:

    c = a.atk * 4 - b.def * 2; a.gainHp(Math.round(-c / 10)); c

    What this should do is calculated roughly how much damage you will do in advance, then deal damage to the caster. In this case, 10% of whatever damage you dealt. After the self damage, the formula *should* do c damage.
     Woah! That is a very good solution!! I'm really more of an artist so I'm much newer to all of this code... But, I'm absolutely loving that this is all exposed on attacks. I can't wait to learn as much about it as I can... Sorry for the double post btw lol.
  11. Amuseum said:
    try actor.states().length or actor.allIcons().length
    Interesting. I'm not sure if it'll work with the way that I was planning on using it, but I'll see if it will work out. Just in case, I'll just ask if there's a way to get the number of states off of an enemy, since I'm trying to make a skill that works like the Traumatize attack (from Final Fantasy Tactics A2).
  12. I tried everything that I could think off, could it be that 

    b.idis no longer a thing now? I want to check if the skill hits a certain actor for example. Also, would I use && instead of and?
  13. Korokage said:
    Interesting. I'm not sure if it'll work with the way that I was planning on using it, but I'll see if it will work out. Just in case, I'll just ask if there's a way to get the number of states off of an enemy, since I'm trying to make a skill that works like the Traumatize attack (from Final Fantasy Tactics A2).
    Just quoting myself to share that I tried out the solution and after realizing that I was being a dum-dum about the syntax found that it works perfectly. Kudos to Amuseum.
  14. Pumamori said:
    I tried everything that I could think off, could it be that 

    b.idis no longer a thing now? I want to check if the skill hits a certain actor for example. Also, would I use && instead of and?
    try b._id
  15. Hrmm... I've been trying a basic formula here...

    a.addState(15) : a.atk * 4 - b.def * 2

    but it doesn't function. It makes the skill do 0 damage and doesn't apply the state. The syntax was taken directly from here, but it still doesn't work.
  16. Quick question to try another way of doing the skill I'm making for a future project: when using b.isStateAffected() how many state ids can I put in there? Basically I'm asking if b.isStateAffected(4, 5, 6) is a valid example.
  17. Shaz said:
    try b._id
    var y = b._id === 1 ? 200 : 100; y

    I tried it that way, changed nothing. It always returns 100, no matter if the target is actor 2 or not. D:
  18. Grimoire LD said:
    Hrmm... I've been trying a basic formula here...

    a.addState(15) : a.atk * 4 - b.def * 2

    but it doesn't function. It makes the skill do 0 damage and doesn't apply the state. The syntax was taken directly from here, but it still doesn't work.
    I think the syntax taken may have been part of a larger formula. Change the : to a ; and that should do the trick.

    a.addState(15); a.atk * 4 - b.def * 2
  19. Liak said:
    Thank you! :) I'll try that.

    My question about turn number also hasn't been answered yet,
    Hi Liak,

    To get the turn number, try: $gameTroop.turnCount()

    I tried it in an HP Damage attack with the formula:

    $gameTroop.turnCount() * 100The damage it dealt was 100, 200, 300, 400, etc. I've only tried this in the Test Battle, so I do not know if this will reset at the end of battle in a real game... yet.
  20. So, let's say we're using skills that use one stat while the normal attack of another weapon uses another stat. (IE bows and dexterity) Is there a way to make the skill use dexterity instead of strength?