RMMV Damage Formula - ideas and help

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

  1. Petrus906

    Petrus906 Villager Member

    Messages:
    6
    Likes Received:
    2
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Nope. I just wrote wrongly on my post, sorry. Probably because I'm used to saying "status"
     
  2. jetboost

    jetboost Veteran Veteran

    Messages:
    84
    Likes Received:
    26
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    In that case have you set up the formula to do HP damage? If 0 pops up I guess you have.
    And in that case it would be easier If you could upkoed a screenshot of your skill.

    I don't know if the issue lies with an plugin you use, most plugins also need some sort of comand to actually do something.

    Also your skill adds an state if it passes the check and if not should deal damage but in case it passes the check, the skill would have no numerical value to work with as it should do damage.

    But in case it isn't set-up to do damage then when it fails the check it has an number but not a method to do something with it.
     
  3. Petrus906

    Petrus906 Villager Member

    Messages:
    6
    Likes Received:
    2
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Here is the skill, so yeah I do have it set to Damage Hp (I guessed because i wanted for it to do damage in case the condition is not met).
    I don't have a plugin in mind specifically for this,, but I am using moatly Yanfly's for battle stuff. TargetCore, DamageCore, SelectionControl, ActionSequence, BuffsStatescore..
     

    Attached Files:

  4. jetboost

    jetboost Veteran Veteran

    Messages:
    84
    Likes Received:
    26
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    This worked for me.
    Code:
    b.isStateAffected(5)? b.addState(6) : value= 1000 - b.luk; 
     
  5. Petrus906

    Petrus906 Villager Member

    Messages:
    6
    Likes Received:
    2
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Welp, that worked for me... on an empty project :p
    On the main one my ghost still can't be killed o_O pretty sure it's something about plugins, but I have no clue Haha. I figured it have been because of his passive state, but changing that also didn't work.
     
  6. jetboost

    jetboost Veteran Veteran

    Messages:
    84
    Likes Received:
    26
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    Just to be clear, the way the skill is set-up it will only deal damage when it isn't affected by your undead state.
    If you want the skill to do damage regardless put this in the skill's notebox.

    Code:
    <damage formula>
    value= 1000 - b.luk;
    if(b.isStateAffected(14)){ b.addState(6);}
    </damage formula>
     
  7. Petrus906

    Petrus906 Villager Member

    Messages:
    6
    Likes Received:
    2
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    dayum that actually worked Haha, thank you so much, really.

    Actually I didn't want the undead enemy to receive damage, so I just put up the skill to be of two elements (holy + a made up one) and the ghost to be immune to that one. Probably not the best solution but it worked...

    Again, thank you for the help (*^ー^)
     
  8. Silenity

    Silenity Veteran Veteran

    Messages:
    647
    Likes Received:
    239
    Location:
    Oregon
    First Language:
    English
    Primarily Uses:
    RMMV
    Heyo.
    Tryna make a damage formula where the luck stat plays as bonus damage.

    So your luck is from 0-100 and you have that as a percentage to land a bonus damage and then a roll on your luck as actual bonus damage.
    Hard to explain so will show example.

    Harold has 25 Luck.
    Harold's attack has a 25% chance to add bonus damage.
    The bonus damage would be a random number from 0-25.

    At 100 Luck you have 100% chance to add bonus damage and the bonus would be random from 0-100.

    Hope that makes sense.
     
  9. Rigor Mortex

    Rigor Mortex Mankind's Mirror Veteran

    Messages:
    58
    Likes Received:
    3
    Location:
    Dark World
    First Language:
    English
    A few questions, all pertaining to what data can be used in formulas.
    1. How do you reference a unit's total bonus to Defense from equipped armor? My searches haven't given me results, and the Help file for MV didn't provide any answers, either.
    2. Is it possible to reference a unit's stat, accounting for any (de)buffs, but ignoring changes to the stat as a result of equipment? e.g. Carl has 40 STR, a weapon that grants 50 STR, and body armor that grants another 10 STR, and a 25% buff to STR. Normally this would equal 137 (40+50+10 = 110 * 1.25 = 125), but I'd like to be able to reference the original 50 STR with the buff (40 * 1.25 = 50).
    3. Likewise, is it possible to reference a unit's stat, accounting for any (de)buffs, but ignoring changes to the stat as a result of ONLY a weapon (or other type of equipment)?
     
  10. jetboost

    jetboost Veteran Veteran

    Messages:
    84
    Likes Received:
    26
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    Your second explanation is a lot easier to understand no worries.
    Code:
    if(Math.randomInt(100)+1<=a.luk){value=value+Math.randomInt(a.luk);}
    
    1. I don't believe there is. You can however make a function call like that yourself
    Code:
    a= function(x){var i;var base = $gameActors.actor(x)._equips; for(i=0;i<base.length;i++){
    switch(base._equips[i]._dataClass){case"armor":$dataArmors[base[i]._itemId].params ;break;case "weapon":$dataWeapons[base[i]._itemId].params break;}}}
    I have made a start for you but the moment you get "[base._itemId].params" here you will be inside the array that stores the parameter values of your equipment, I just don't know exactly which parameter is what.

    2. No the engine is quite lacking in adjusting the buff/debuff department, though there are plugins that offer some more options(Yanfly had some I believe not sure).
    And it is likely also possible to script your (de)buffs into it yourself.

    3. pretty much the same answer as 2.
     
    Silenity likes this.
  11. TurquoiseDragoon

    TurquoiseDragoon Villager Member

    Messages:
    10
    Likes Received:
    3
    Location:
    Fort Worth, Texas
    First Language:
    English
    Primarily Uses:
    RMMV
    my regular attack formula is as follows:

    (((a.atk * a.atk) / 36) - ((b.def * b.def) /72) / 2)
    with a variance of 5%

    so say you're low level and your atk stat was 32 and your target's def stat was 18;

    32 * 32 = 1024
    1024 / 36 = 28
    28 is your base damage
    18 * 18 = 324
    324 / 72 = 4
    4 is the resistance
    28 - 4 = 24
    24 / 2 = 12
    12 is your total damage

    this is just low stat example, but I've found it's a very easy formula to balance your game with in terms of stats and difficulty curves in your game

    so for a high stat example
    1250 * 1250 = 1562500
    1562500 / 36 = 43403
    43403 is your base damage
    560 * 560 = 313600
    313600 / 72 = 4355
    4355 is the resistance
    43403 - 4355 = 19524
    39048 / 2 =
    19524 is your total damage

    So it works for very high stats as well if you want your game to have very high numbers at the end of your character's level/stat progression.
     
  12. Oddball

    Oddball Veteran Veteran

    Messages:
    1,293
    Likes Received:
    271
    First Language:
    English
    Can you add multipule states to the user through formula's, or can you only add one? Is there a way to randomly add a state to the user in a damage formula? Can you add a state and remove a sperate one in the same formula?
     
  13. jetboost

    jetboost Veteran Veteran

    Messages:
    84
    Likes Received:
    26
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    That is all possible though i'm not sure if it is in default rpgMakerMV.
    I use the "Yanfly damage core"plugin with which it is possible to do what you describe like this:
    Code:
    <damage formula>
    var idA = 1; var idB = 2;
    a.addState(idA);
    a.removeState(idB);
    </damage formula>
    And
    Code:
    var idA = [1,2,3,4]; var random =Math.randomInt(idA.length);
    a.addState(idA[random]);
    
     
  14. Oddball

    Oddball Veteran Veteran

    Messages:
    1,293
    Likes Received:
    271
    First Language:
    English
    I can add states through damage formula's to the user without any plugins. I'm just wondering if you can add multipule states
     
  15. jetboost

    jetboost Veteran Veteran

    Messages:
    84
    Likes Received:
    26
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    That’s true.
    I don’t know for certain how you would do it without plugins it’s been to long, would have to go and test it myself.

    But couldn’t you just add/remove states by adding it to the effects of the skill?

    And Math.randomInt() ought to work as well.
     
  16. Oddball

    Oddball Veteran Veteran

    Messages:
    1,293
    Likes Received:
    271
    First Language:
    English
    In the skill, it only adds states to the target. If you want the skill to do damage to the target and add multipule...no any states to the user, effects of the skill won't cut it
     
  17. jetboost

    jetboost Veteran Veteran

    Messages:
    84
    Likes Received:
    26
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    Currently at work so I can’t help at the moment.

    But you can still use the plugin.
    Or do you wish to have an project without plugins?
     
  18. Oddball

    Oddball Veteran Veteran

    Messages:
    1,293
    Likes Received:
    271
    First Language:
    English
    Only using plugins that do stuff i can't in the editor. Using victor sants ATB plugin, and a proximity one
     
  19. TurquoiseDragoon

    TurquoiseDragoon Villager Member

    Messages:
    10
    Likes Received:
    3
    Location:
    Fort Worth, Texas
    First Language:
    English
    Primarily Uses:
    RMMV
    In the effects, it will add as many states as you enter as long as they are high enough percent(ie 100%)
    And just add your damage formula in the formula space.

    You can deal damage and deal states like that just fine, if that is what you are wanting to do.
     
  20. TurquoiseDragoon

    TurquoiseDragoon Villager Member

    Messages:
    10
    Likes Received:
    3
    Location:
    Fort Worth, Texas
    First Language:
    English
    Primarily Uses:
    RMMV
    Also you could add a common event to add a state during the skill, under skill effects/traits as well so that the user of the skill could have a state added once the skill is used.

    so if you use a skill like, say a limit break and you want a state that seals magic as a drawback for using the limit break

    just add a common event that does just that under the effect/traits box of the skill
    and in the same area, just add the states you want the user's target to be afflicted with.
     

Share This Page