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.
Plugin: download here (right-click, save-as)
This plugin is for RPG Maker MV only. Click here for the Ace version!
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.
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
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
And then use this in your effect calculations.
Anything that is defined in the code can be used as an effect.