MV YEP - Param Control Plugin. Math Questions

I feel like these plugins are very well known but just incase, they are designed for you to change how your parameters work in general. You can input your own formulas.

So there are a few things I would like.

1: I would want the Defense stat to reduce physical damage taken by 0.16% per point. (Or close to that)

The current formula inside the plugin is like this

(base + plus) * rate + flat

If I add something like

(user.def / 1000)

Then PDR would increase with more DEF, and...that means my physical damage increases right? So I need it to decrease it with more def? Or Have I misunderstood the stat? If so, what would the formula be?

2: I want the Luck stat to have more of an effect on status effects.

This is the formula in the plugin...

Math.max(1.0 + (user.luk - target.luk) * 0.1, 0.0)

I'm not even gonna pretend I know what the hell this means. But I would like a similar effect as above, 0.16% per point if that's possible.
  1. Correct, PDR is the damage rate, so you'd want to decrease it with increasing DEF. 0.16% is the same as 0.16 / 100, i.e. 0.0016. So maybe something like this:

    (base + plus) * rate + flat - user.def * 0.0016

  2. That formula starts at 1 = 100%, then increases/decreases by 0.1 = 10% per point of difference in LUK. E.g. if the user has 10 LUK and the target has 15 LUK, the effect will be 0.5 = 50%, i.e. half normal chance. If the user has 20 LUK and the target has 12 LUK, it would be 1.8 = 180%. The Math.max thing is just a lower bound, so the result is always positive or zero.

    Note that without plugins, it would be 0.001 = 0.1% per point of LUK difference, rather than 1%. Which is more suitable depends on the stat range for your game.

    Not sure exactly what you want here. To increase the effect you could just increase the 0.1 multiplier, but as noted it's already pretty large compared to normal. 0.16% per point would be 0.0016, as above.

    You could add DEF in here using a similar approach, e.g.

    Math.max(1.0 + (user.luk - target.luk) * 0.1 + (user.def - target.def) * 0.0016, 0.0)
    I.e. the usual value, plus an extra factor based on the difference between the DEF of the user and target.
    [Edit: sorry, misread your post.]
  1. Correct, PDR is the damage rate, so you'd want to decrease it with increasing DEF. 0.16% is the same as 0.16 / 100, i.e. 0.0016. So maybe something like this:

    (base + plus) * rate + flat - user.def * 0.0016


Worked like a charm (Once I rearranged half my plugins, two of them apparently wasn't working xD)

  1. That formula starts at 1 = 100%, then increases/decreases by 0.1 = 10% per point of difference in LUK. E.g. if the user has 10 LUK and the target has 15 LUK, the effect will be 0.5 = 50%, i.e. half normal chance. If the user has 20 LUK and the target has 12 LUK, it would be 1.8 = 180%. The Math.max thing is just a lower bound, so the result is always positive or zero.

    Note that without plugins, it would be 0.001 = 0.1% per point of LUK difference, rather than 1%. Which is more suitable depends on the stat range for your game.

    Not sure exactly what you want here. To increase the effect you could just increase the 0.1 multiplier, but as noted it's already pretty large compared to normal. 0.16% per point would be 0.0016, as above.

    You could add DEF in here using a similar approach, e.g.

    Math.max(1.0 + (user.luk - target.luk) * 0.1 + (user.def - target.def) * 0.0016, 0.0)

    I.e. the usual value, plus an extra factor based on the difference between the DEF of the user and target.
    [Edit: sorry, misread your post.]

I basically just wanted by characters with higher luck to have higher chance of succeeding in causing debuffs and status effects. I didn't realize that this plugin changes the default xD

Might be fine as is then, just need to test it 😛

Thanks for the help!
Great, you're welcome!

Actually, I just checked my (old) copy of YEP_BaseParamControl and its default LUK Effect Rate formula seems to be the default, 0.1% per point of LUK difference. Maybe you changed the value at some point but forgot about it? 😅

And yea, to avoid strange problems, always make sure your Yanfly plugins load in the recommended order, listed here:
There are community-made plugins to help figure out the correct order, too, e.g.

Happy RPG Making~ 😂
Great, you're welcome!

Actually, I just checked my (old) copy of YEP_BaseParamControl and its default LUK Effect Rate formula seems to be the default, 0.1% per point of LUK difference. Maybe you changed the value at some point but forgot about it? 😅

This all made me rethink how I want it to work anyway tbh 😛 I like to see the chances of something and the whole ''my stat'' in comparison to the enemy stat seems like a pain 😛

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/yep-param-control-plugin-math-questions.155701/