RMMV Damage Formula - ideas and help

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

  1. luigiman2201

    luigiman2201 Villager Member

    Messages:
    16
    Likes Received:
    2
    First Language:
    English
    You can use a.gainHp and b.gainHp for that. (a is the user, b is the target)

    Basically, input the damage formula, but divide it by 2 at the end.

    For example, let's say the formula for calculating the amount healed is 75% of the user magic attack.

    Then the formula would be

    a.gainHp((a.mat * 0,75) / 2);b.gainHp(a.mat * 0,75)In the case of the simple example you've given the formula would be

    a.gainHp((10) / 2);b.gainHp(10)Let me know if there's anything you don't understand, or if something didn't work right.
     
  2. CyndaBytes

    CyndaBytes Creator and Destroyer of Worlds Veteran

    Messages:
    89
    Likes Received:
    41
    Location:
    Ade, Hell
    First Language:
    Italian
    Hi guys, I'm trying to create a combat system that calculates the fighting level ( it's over 9000!!! XD) and fatigue.
    There is a way to make this formula shorter?

    Code:
    a.atk * 4 + {[a.level + (a.hp/10) + (a.mp/10) + a.tp + a.atk + a.def + a.agi + a.mat + a.mdf + a.luk]/9} - b.def * 2 + {[b.level + (b.hp/10) + (b.mp/10) + b.tp + b.atk + b.def + b.agi + b.mat + b.mdf + b.luk]/9}
     
    Last edited by a moderator: Nov 20, 2015
  3. okugi

    okugi Villager Member

    Messages:
    28
    Likes Received:
    6
    First Language:
    English
    A couple things.

    -It looks like you're taking the average of all stats, including level, but dividing by 9, vice the 10 parameters you listed in each section.

    -Without  plug ins, this formula won't work for combat, as enemies don't have levels or tp.  This would work for skills that are targeting other party members though.

    -In general, I don't think this formula will accomplish what you want, as written.  Currently, you're adding both the attacker and defenders stats to the final damage, instead of doing a comparison.  Let's try grouping the attacker and defenders portions,  

    (a.atk * 4 + ((a.hp/10 + a.mp/10 + a.atk + a.def + a.agi + a.mat + a.mdf + a.luk)/8)) - (b.def * 2 + ((b.hp/10 + b.mp/10 + b.atk + b.def + b.agi + b.mat + b.mdf + b.luk)/8))

    Or you could use it as a fraction to modify the a.atk-b.def portion:

    (a.atk*4-b.def*2)*(((a.hp/10+a.mp/10+a.atk+a.def+a.agi+a.mat+a.mdf+a.luk)/8)/((b.hp/10+b.mp/10+b.atk+b.def+b.agi+b.mat+b.mdf+b.luk)8))

    I think the second one would serve your purpose better, as it creates a direct comparison between the attacker and defender, and modifies the damage based on that outcome.

    Run both through your favorite spreadsheet to see which numbers you like better.  Hope that helps somewhat.
     
    Last edited by a moderator: Nov 20, 2015
  4. lohenien

    lohenien Veteran Veteran

    Messages:
    153
    Likes Received:
    7
    First Language:
    english
    My game's combat style is anime focused. To represent power levels I'm using mp as a multiplier as such: ((a.atk +a.agi) * (3+ (1+(a.maxmp / 500 ))) having mp equal to 500 is like being super saiyan one, 1000 mp would be super saiyan 2 etc. Most enemies and characters will have between 100-300 mp until the mid game then some characters and enemies will get boosts to take their damage to the next level. I dont know if something like that will help, but it is easier / shorter.
     
  5. Silenity

    Silenity Veteran Veteran

    Messages:
    647
    Likes Received:
    239
    Location:
    Oregon
    First Language:
    English
    Primarily Uses:
    RMMV
    So currently I have this in my attack formula:

    b.isStateAffected(4,5,6,8,9,10,26) ? (a.atk) - (b.def / 4) : (a.atk / 2) - (b.def / 4)
    I'm trying to make it so you deal increased damage if affected with one of those states.

    However, it only seems to be applying on the first state (4) which is poison in my case.

    What am I doing wrong?
     
  6. VHStapes

    VHStapes Game Designer Veteran

    Messages:
    57
    Likes Received:
    7
    Location:
    Vashon, Wa
    First Language:
    English
    You need to use "||" (which means "or") instead of "," between each number. So something like b.isStateAffected(4 || 5 || 6) would work, I think.
     
  7. dayhjawk

    dayhjawk Veteran Veteran

    Messages:
    107
    Likes Received:
    12
    First Language:
    English
    I'm not even sure if this is possible:

    I am wanting to setup a skill that does more damage if target is at full health.

    then again, if he's above a certain %.
     
  8. Smelipanda

    Smelipanda Veteran Veteran

    Messages:
    40
    Likes Received:
    35
    Location:
    Wisconsin
    First Language:
    English
    b.hp == b.mhp ? A: (b.hp/b.mhp > .40 ? B : b.hp/b.mhp > .35 ? C : b.hp/b.mhp > .30 ? D : b.hp/b.mhp > .25 ? E : F )

    A being the Damage if they are at full health

    B being the Damage above 40% but below/equal full health

    C being the Damage above 35% but below/equal 40%

    D being the Damage above 30% but below/equal 35%

    E being the Damage above 25% but below/equal 30%

    F being the Damage below/equal 25%

    im fairly new to this so there may be eaiser or more effective ways to do it, but it appears to produce the results you are looking for :) .
     
    Last edited by a moderator: Nov 22, 2015
  9. dayhjawk

    dayhjawk Veteran Veteran

    Messages:
    107
    Likes Received:
    12
    First Language:
    English
    full hp, 25%, 30%. 35%, 40%

    there different ranks
     
  10. MakeAndCreate

    MakeAndCreate Veteran Veteran

    Messages:
    39
    Likes Received:
    3
    First Language:
    English
    I'm trying to work on a skill that becomes a finishing move when the enemy is below 25% health and adds an exhaustion state to the user, but only does a fix damage otherwise.  For some reason I can't get the formula to work

    b.mhp/4 > b.hp ? a.addState(11); 9999999999999 : 50

    What am I doing wrong?  
     
    Last edited by a moderator: Nov 23, 2015
  11. Smelipanda

    Smelipanda Veteran Veteran

    Messages:
    40
    Likes Received:
    35
    Location:
    Wisconsin
    First Language:
    English
    I saw a couple of posts here but wasnt abler to get a solid answer (or maybe im a complete dunce and just missed it). is there a way to affect the crit rate for 1 attack and 1 attack only? idk if you would need a script, or use the damage formula to do it or?
     
  12. skyshadow235

    skyshadow235 Villager Member

    Messages:
    21
    Likes Received:
    1
    First Language:
    English
    is it possible to use a formula that calculates the user's base attack without equipment, but while he/she is equipped with a weapon?
     
  13. Smelipanda

    Smelipanda Veteran Veteran

    Messages:
    40
    Likes Received:
    35
    Location:
    Wisconsin
    First Language:
    English
    This would likely need a script written for it. I dont think there is any easy way to get the attack bonus from a weapon and subtract it from the total.
     
  14. Myst Desdemona

    Myst Desdemona The Snark Knight Veteran

    Messages:
    69
    Likes Received:
    14
    Location:
    Sweden
    First Language:
    English/Swedish
    I'm not sure if this was answered before in this thread since I last checked over a week ago, so my apologies if it was already answered.

    I'm trying to make it that if a consumable is used on one specific actor, it would have a different effect (in this example heal more) I remember it vaguely from vx being something like this

    if b.id == 1; 200; else; 100; end;

    How can I transition this to MV?

    Thanks in advance.
     
  15. BloodletterQ

    BloodletterQ Chaotic Neutral Assassin Veteran

    Messages:
    1,449
    Likes Received:
    1,047
    Location:
    My head's in the clouds at least...
    First Language:
    English
    Primarily Uses:
    N/A
    Wondering if I would need a plug-in that replicates doubling from Fire Emblem where having a higher stat than the stat of an enemy enables an extra attack or if that can be included within a formula.
     
    Last edited by a moderator: Nov 30, 2015
  16. gotnovicks

    gotnovicks Veteran Veteran

    Messages:
    76
    Likes Received:
    9
    First Language:
    Portuguese
    Primarily Uses:
    N/A
    Does v[id] still works on formula box? like v[50]+=1 add 1 to variable 50.

    If dont, how do I make it through $gameVariables in formula box? because $gameVariables.setValue(id,value) overwrite the value, not add >:
     
    Last edited by a moderator: Nov 30, 2015
  17. Sol Rising

    Sol Rising Veteran Veteran

    Messages:
    162
    Likes Received:
    21
    First Language:
    English
    I'm not sure if I need a plugin or if this can be done via formulas. I'm trying to come up with a attack that deals damage to the target but has a x% chance to apply a stat effect on the user. Any help would be greatly appreciated
     
  18. BloodletterQ

    BloodletterQ Chaotic Neutral Assassin Veteran

    Messages:
    1,449
    Likes Received:
    1,047
    Location:
    My head's in the clouds at least...
    First Language:
    English
    Primarily Uses:
    N/A
    Also, how do I make a skill that casts another random skill?
     
  19. TheGamedawg

    TheGamedawg Veteran Veteran

    Messages:
    350
    Likes Received:
    132
    Location:
    United States
    First Language:
    English
    I'm having a little bit of trouble finding a damage formula that works for my game.  Basically what I have is a game without a level up system.  Characters and enemies have an attack/defense stat that is anywhere from 1-31, unless augmented by equips.  Additionally, all of these characters have a health stat from 100-200.  Bosses have far more, but that's because they're bosses.

    I'm having trouble getting a good damage formula for this.  I want the average attack, 15 attack to 15 defense to do around 20 damage or so.  And at most 31 attack to 1 defense to do around 100.  I'm having trouble finding a formula that gets this working though.  Everything I try simply does too much damage.
     
  20. Nuhada

    Nuhada Villager Member

    Messages:
    27
    Likes Received:
    14
    First Language:
    French
    You can set something like "x = $gameVariable.value(id); $gameVariables.setValue(id,x + value)"

    Maybe there is something like $gameVariables.addValue(id,value), but i didn't test.

    This has been answered before, you should check out old pages before asking.

    Just use "(Math.random()>X)?(a.addState(Y));damages", with X between 0 and 1 for the chance (0=0%, 0.5=50%, 1=100%), and Y as the ID of the stat.

    It's just my opinion but i'll put something like (a.atk*3 - b.def*1.5)+5, with a minimum damages of 1. This is not a crazy formula but it makes the job x)
     
    TheGamedawg likes this.

Share This Page