Formula Effects

formulaEffects1

All items and skills in RPG Maker come with additional “effects”.

Effects include gaining HP, learning a skill, gaining a buff in a parameter, or running a common event.

However, what if you would like a skill to do something that isn’t provided by default?

You could use the damage formula, but what if you would like to create conditions on those effects? You could include those conditions in the formula as well, but the problem here is you may end up with a very complex damage formula.

Instead of using the damage formula for everything, you can create custom effects that support formulas. If you already knew how to write the formula, then you can just move it from the damage formula into this formula effect.

Because a formula effect is just another effect, it supports other plugins that work with effects, such as Effect Conditions, which allows you to determine whether an effect should be executed based on a condition.

Download

Plugin: download here (right-click, save-as)

This plugin is for RPG Maker MV only. Click here for the Ace version!

Installation

Download the plugin and place it in the “plugins” folder in your project’s “js” folder. Then open your Plugin Manager (F10), double-click an empty row, and select the HIME_FormulaEffects plugin.

Once it is in your list of plugins, turn the plugin on.

Usage

To create a formula effect, note-tag items or skills with

<formula effect>
  FORMULA
</formula effect>

Where the FORMULA will be evaluated during skill execution and the behavior is determined by what you write in the formula.

The following formula variables are available

 a - attacker
 b - target
 i - current item or skill
 v - game variables
 s - game switches
 t - game troop
 p - game party

So for example, if you wanted to reduce the target’s HP by 100, you could use the formula

b.gainHp(-100);

You can access the result of the action on the target using

var r = b.result()

With this, you can then check how much HP damage or MP damage was dealt

r.hpDamage
 r.mpDamage

And then use this in your effect calculations.

Anything that is defined in the code can be used as an effect.

You may also like...

61 Responses

  1. I all the time emailed this weblog post page to all my friends,
    for the reason that if like to read it afterward my friends will too.

    Also visit my web blog; vpn special coupon

  2. Omcyli says:

    buy ivermectin pills – buy generic doryx for sale cefaclor 250mg for sale

  3. Do you have a spam problem on this website; I also am a
    blogger, and I was curious about your situation; many of us have created some nice methods and we
    are looking to exchange techniques with other folks, why not shoot me an e-mail if interested.

  4. Sscgec says:

    buy clindamycin tablets – cost cleocin 300mg buy chloromycetin without a prescription

  5. Ocwlhc says:

    buy azithromycin 250mg generic – ofloxacin pills ciprofloxacin 500 mg canada

  6. I know this if off topic but I’m looking into starting my own blog and was curious
    what all is required to get set up? I’m assuming having a blog like yours would cost a
    pretty penny? I’m not very web smart so I’m not 100% certain. Any recommendations or advice would
    be greatly appreciated. Cheers

    My web blog :: vpn coupon code 2024

  7. If you wish for to obtain much from this article then you have to apply such strategies
    to your won weblog.

  8. Excellent site you’ve got here.. It’s hard to find excellent writing like yours these days.
    I seriously appreciate people like you! Take care!!

    My webpage: vpn coupon code 2024

  9. Its like you learn my mind! You appear to understand a lot approximately this,
    such as you wrote the guide in it or something. I believe that you just can do with a few percent to force the
    message house a little bit, but other than that, this is magnificent blog.
    A great read. I will certainly be back.

    Feel free to surf to my page :: vpn special coupon code 2024

  10. Kgflqi says:

    amoxil usa – buy erythromycin 250mg sale buy baycip online

  11. Hey I know this is off topic but I was wondering if
    you knew of any widgets I could add to my
    blog that automatically tweet my newest twitter updates.

    I’ve been looking for a plug-in like this for quite some time and was
    hoping maybe you would have some experience with something
    like this. Please let me know if you run into anything.
    I truly enjoy reading your blog and I look forward to your new updates.

    my webpage: vpn special coupon code 2024

  12. Wow, that’s what I was exploring for, what a data!

    present here at this blog, thanks admin of this web page.

  13. Hello, I enjoy reading through your article post. I like to write a little comment to support you.

    Feel free to surf to my webpage vpn special coupon

  14. Bjmosa says:

    clavulanate brand – order augmentin 375mg generic ciprofloxacin tablet

  15. prijs van clomipramine in Marseille
    clomipramine online apotheek
    koop anafranil in Buenos Aires
    Koop clomipramine online voor snelle verlichting
    clomipramine zonder doktersvoorschrift te bestellen
    Vind de beste aanbiedingen voor clomipramine online in Nederland
    clomipramine vrij verkrijgbaar in Parijs
    clomipramine bestellen zonder recept online
    clomipramine beschikbaar in Nederland
    Krijg anafranil zonder recept geleverd aan huis in Nederland.
    online aankoop van anafranil zonder recept
    Kan ik clomipramine zonder voorschrift krijgen in Colombia?

    clomipramine met of zonder voorschrift in Frankrijk
    clomipramine bestellen online in Maastricht
    Koop clomipramine online en bespaar op uw gezondheidskosten
    verkoopindicatie van anafranil in Quebec
    aankoop van slaappillen clomipramine
    Betrouwbare clomipramine leverancier in Nederland Koop anafranil in Nederland
    clomipramine: de beste keuze voor pijnverlichting Voordelige aankoop van clomipramine online
    kopen clomipramine in Europa
    Ontdek de voordelen van het kopen van clomipramine online in Nederland
    anafranil zonder voorschrift verkrijgbaar in België Bestel
    clomipramine online en krijg het discreet bij u
    thuis bezorgd
    clomipramine te koop in Europa
    anafranil online kopen in Groningen – bespaar tijd en moeite!

    clomipramine kopen bij drogist
    clomipramine bestellen: eenvoudig en betrouwbaar
    anafranil tegen een competitieve prijs
    Bestel anafranil zonder voorschrift en ontvang het snel thuis Veilige website voor anafranil zonder recept
    betrouwbare aankoop van clomipramine in Peru clomipramine kopen met
    snelle levering
    clomipramine kopen in België via internet clomipramine online kopen in Groningen – bespaar tijd en moeite!

    anafranil verkrijgbaar in Nederland
    clomipramine vrij verkrijgbaar in bepaalde landen bestel clomipramine
    clomipramine zonder medisch voorschrift
    anafranil online verkrijgbaar met discrete verpakking
    Veilige online apotheek voor anafranil in Nederland clomipramine bijwerkingen en gebruiksinformatie
    clomipramine zonder medisch voorschrift in Marokko
    Gemakkelijk anafranil bestellen in Almere – geen gedoe meer met apotheken.
    clomipramine online apotheek in Rotterdam clomipramine bestellen zonder
    voorschrift: snel en betrouwbaar
    clomipramine kopen: Veelgestelde vragen
    anafranil kopen in Brussel

  16. Nfyxue says:

    atarax 10mg without prescription – sarafem 40mg cost amitriptyline 25mg pills

  17. Nbaarj says:

    seroquel online – trazodone 100mg us purchase eskalith pill

  18. Uezcrc says:

    buy clomipramine 25mg pill – where can i buy anafranil sinequan 25mg generic

  19. Csimqu says:

    buy clozapine no prescription – order clozaril online purchase pepcid generic

  20. Ejusxj says:

    buy generic zidovudine 300 mg – glycomet 500mg tablet buy zyloprim 300mg sale

  21. Your faith in us is our top priority. Therefore, we conduct our services with full integrity and commitment to your satisfaction.

    Rest easy of recovering your QIWI wallet balance with our specialized assistance.

  22. Xqlyov says:

    cheap glucophage 1000mg – buy septra for sale lincocin 500 mg us

  23. Hyaznh says:

    lasix brand – how to buy prograf buy captopril 25 mg pill

  24. Worried about your QIWI wallet transactions?

    Let us handle the stress in getting back what isrightfully yours.
    Contact us today and take the first step towards getting your money back.

  25. Utmsjp says:

    cheap metronidazole – buy azithromycin without prescription azithromycin 500mg oral

  26. Tucuty says:

    order ampicillin online buy generic amoxil how to get amoxicillin without a prescription

  27. Zefqbf says:

    purchase valtrex – nemasole ca buy acyclovir paypal

  28. Jpxewc says:

    ivermectin 6mg stromectol – ciprofloxacin pill buy sumycin 250mg online cheap

  29. Dsipih says:

    ivermectin 3 mg for humans for sale – co-amoxiclav over the counter sumycin us

  30. Ymaiyw says:

    flagyl medication – buy azithromycin sale azithromycin 500mg cost

  31. Uajlbx says:

    buy ciplox medication – buy ciplox pills for sale erythromycin 250mg drug

  32. IsmaelGop says:

    Pretty portion of content. I simply stumbled upon your website and in accession capital to assert that I acquire in fact loved account your blog posts. Any way I’ll be subscribing on your augment or even I fulfillment you get admission to constantly quickly.

    http://alt1.toolbarqueries.google.com.sv/url?q=https://didvirtualnumbers.com/de/

  33. Whqjlr says:

    buy ciprofloxacin without prescription – augmentin 625mg oral where to buy clavulanate without a prescription

  34. Xwkbvb says:

    cost baycip – order amoxiclav online cheap generic augmentin 625mg

  35. Qpaebm says:

    buy lipitor 10mg sale buy atorvastatin 40mg pills atorvastatin 20mg ca

  36. Earnestjet says:

    3d, 3д панель на стену Алматы — отделочный материал для фасадов. Структура материала фактурная, внешний вид полностью копирует деревянную доску.

  37. Shanesoodo says:

    For latest news you have to visit world wide web and on world-wide-web I found this web site as a most excellent site for most recent updates.
    bcgame apk

  38. IsmaelGop says:

    Hey! Do you use Twitter? I’d like to follow you if that would be ok. I’m absolutely enjoying your blog and look forward to new updates.
    bcasino sister sites

  39. Foberttaf says:

    Hi there it’s me, I am also visiting this website on a regular basis, this website is in fact good and the visitors are really sharing pleasant thoughts.
    safest australian online casino

  40. Lewisthult says:

    What’s up i am kavin, its my first occasion to commenting anyplace, when i read this paragraph i thought i could also create comment due to this sensible article.
    https://tinyurl.com/SquirtCamweb

  41. SDichaelShery says:

    Pastillas Cialis Para QuГ© Sirve
    (Moderator)
    Cialis 5 mg prezzo tadalafil 5 mg prezzo cialis 5 mg prezzo

  42. Desbrina says:

    Is there a way when using this for something to only apply to an enemy.
    I’m trying to use the following, which works when you defeat an enemy, but when an Elly is defeated it errors due to the b.enemyId() not existing for an actor

    if(b.hp == 0) {
    $gameVariables.setValue(5, b.enemyId());
    $gameSwitches.setValue(3, true);
    }
    </formula effect>

  43. jangee says:

    This is an informative content. I appreciate you allowing me to comment and learn. You will undoubtedly learn more if you sign up for an online course! College of Contract Management is a college institution wherein you can enroll online courses suitable for you and your needs.

  44. Paulo Bender says:

    By checking if b.result’s hpdamage != 0, and then using b.gainstate, I will be able to make skills that only apply their effects if they properly hit, right? Do I need to make a change check (e.g.: for a “poison fang” that deals damage and has a 30% chance of poisoning) or is there any way to use the trait percentage?

    Anyways, incredible work, as always! My most sincere congratulations.

  45. D.Arquien says:

    have link for direct download script ? copy and paste have error

  46. Ano says:

    Can it be used to change Action Times +? Like if the skill is used the attacker gains another turn.

  47. Serpenter says:

    I was wondering if I could use this to make a skill leave an enemy with 1 point of health if it would normally kill it?

  48. Anonymous says:

    Nevermind on calling events, got it to work, great work here!

  49. Anonymous says:

    Is there a way to call a common event?

  50. Sundricat says:

    Using script functions, how would I subtract the value of Variable 42 from the value of Variable 41?

    • Hime says:

      $gameVariables.setValue(42, $gameVariables.value(42) – $gameVariables.value(41));

      Which takes the value of variable 42, subtract value of variable 41, and then put the result into variable 42.

  51. Sundricat says:

    How would I set up the formula effect to make a spell drain 25% of the Users Max MP when cast?

  52. Izmeiah says:

    I have a newbie kind of question. Would it be possible to have this affect a creature(s) such that if their hp is < – x%, that they are affected by a state, such as death?

    • Hime says:

      Yes. You can a condition to check whether the target (b) HP is less than a certain percent, and then add the specified state.
      if (b.hp < b.mhp * 0.10) {
      b.addState(1)
      }

      So you’re checking whether the target’s current HP is less than 10% of their max HP.
      If so, you would add the death state.

      • Izmeiah says:

        Thank you so much for your fast response! I see what I was doing wrong when I was trying to implement this formula.

  53. Sundricat says:

    Is it possible for the formula effect to target the user?

    • Hime says:

      Yes. You can use the variable a in your formulas, similar to the damage formulas.
      It assumes the “attacker” is the user of course.

      • Sundricat says:

        How would I set up the formula effect so that 25% of the total damage dealt is dealt back to the user as recoil?

        • Hime says:

          The total damage can be accessed via b.result().hpDamage.
          Note that you are accessing the action results for the target, not the user.

          So now you just need to use

          a.gainHp(-b.result().hpDamage * 0.25)

          To inflict 25% of damage to the user.

  54. Michael says:

    Thank you so much, this is a really helpful script!

Leave a Reply

Your email address will not be published. Required fields are marked *