RMMV Damage Formula - ideas and help

Discussion in 'RPG Maker MV' started by Shaz, Oct 25, 2015.

  1. Amuseum

    Amuseum Veteran Veteran

    Messages:
    71
    Likes Received:
    66
    Location:
    San Francisco
    First Language:
    English Chinese
    Primarily Uses:
    RMXP
    try actor.states().length or actor.allIcons().length
     
    #81
    Korokage likes this.
  2. Liak

    Liak Veteran Veteran

    Messages:
    1,789
    Likes Received:
    269
    Location:
    Germany
    First Language:
    German
    Thank you! :) I'll try that.

    My question about turn number also hasn't been answered yet,
     
    #82
  3. Cel

    Cel Veteran Veteran

    Messages:
    88
    Likes Received:
    56
    First Language:
    Swedish
    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.
     
    #83
  4. Milennin

    Milennin "With a bang and a boom!" Veteran

    Messages:
    2,197
    Likes Received:
    1,255
    Location:
    Fiore
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks, that works the way I need it to. :D
     
    #84
  5. tremblinglight

    tremblinglight Villager Member

    Messages:
    5
    Likes Received:
    0
    Location:
    Canada
    First Language:
    English
     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.)
     
    #85
  6. Nuhada

    Nuhada Villager Member

    Messages:
    27
    Likes Received:
    14
    First Language:
    French
    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
    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
     
    Last edited by a moderator: Oct 29, 2015
    #86
    tremblinglight likes this.
  7. TheGamedawg

    TheGamedawg Veteran Veteran

    Messages:
    350
    Likes Received:
    132
    Location:
    United States
    First Language:
    English
    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?
     
    Last edited by a moderator: Oct 29, 2015
    #87
  8. SgtBusCake

    SgtBusCake Villager Member

    Messages:
    15
    Likes Received:
    7
    Location:
    East Coast
    First Language:
    English
    (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.
     
    #88
    Fernyfer775 and tremblinglight like this.
  9. tremblinglight

    tremblinglight Villager Member

    Messages:
    5
    Likes Received:
    0
    Location:
    Canada
    First Language:
    English
     Thank you!!!! You're the best, seriously. I'm going to spend all evening playing around with the equations now...
     
    #89
  10. tremblinglight

    tremblinglight Villager Member

    Messages:
    5
    Likes Received:
    0
    Location:
    Canada
    First Language:
    English
     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.
     
    #90
  11. Korokage

    Korokage Veteran Veteran

    Messages:
    56
    Likes Received:
    9
    First Language:
    English
    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).
     
    #91
  12. Pumamori

    Pumamori Veteran Veteran

    Messages:
    109
    Likes Received:
    21
    First Language:
    German
    Primarily Uses:
    RMMV
    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?
     
    #92
  13. Korokage

    Korokage Veteran Veteran

    Messages:
    56
    Likes Received:
    9
    First Language:
    English
    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.
     
    #93
  14. Shaz

    Shaz Veteran Veteran

    Messages:
    37,718
    Likes Received:
    11,426
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    try b._id
     
    #94
  15. Grimoire LD

    Grimoire LD Veteran Veteran

    Messages:
    39
    Likes Received:
    8
    First Language:
    English
    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.
     
    #95
  16. Korokage

    Korokage Veteran Veteran

    Messages:
    56
    Likes Received:
    9
    First Language:
    English
    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.
     
    Last edited by a moderator: Oct 29, 2015
    #96
  17. Pumamori

    Pumamori Veteran Veteran

    Messages:
    109
    Likes Received:
    21
    First Language:
    German
    Primarily Uses:
    RMMV
    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:
     
    #97
  18. SgtBusCake

    SgtBusCake Villager Member

    Messages:
    15
    Likes Received:
    7
    Location:
    East Coast
    First Language:
    English
    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
     
    #98
  19. SgtBusCake

    SgtBusCake Villager Member

    Messages:
    15
    Likes Received:
    7
    Location:
    East Coast
    First Language:
    English
    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.
     
    Last edited by a moderator: Oct 29, 2015
    #99
    Liak likes this.
  20. BloodletterQ

    BloodletterQ Chaotic Neutral Assassin Veteran

    Messages:
    1,453
    Likes Received:
    1,051
    Location:
    My head's in the clouds at least...
    First Language:
    English
    Primarily Uses:
    N/A
    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?
     

Share This Page