MV Experience and Stat Formulas

Hey folks!

I'm having a bit of trouble getting a formula to work with Yanflys Enemy Level.

I'm using a custom note tag parameter but it doesn't seem to be working.

I think I'm using the wrong call for actor level in the formula.

Any and all help is appreciated.

Thanks!

Here is the formula I am using:

Code:
<Custom Parameter exp Formula>

(base * ((base * rate) + level)) * (1 / (($gameParty.actor().level - enemy.level) + 1()

</Custom Parameter exp Formula>

I'm pretty sure the $gameParty.actor() is incorrect.
For the party level, it depends a bit on what you're trying to do...
  • Highest level of all actors in the party:
    JavaScript:
    (base * (base * rate + level)) / ($gameParty.highestLevel() - level)
  • Average (mean) level of all actors in party:
    Spoiler: Long formula
    JavaScript:
    (base * (base * rate + level)) / (Math.round($gameParty.members().reduce(function(a, c) { return a + c }, 0) / $gameParty.members().length) - level)
  • Something else?
I've assumed you mean the same thing by level and enemy.level. I've also tidied up the brackets a bit. 🙏
Thank you!

I will test this out tonight when I get home from work.
So I tried it out and it errored out with double value non-finite.
Would it be possible to adjust the formula to each individual actors level?

Here is the current formula that I am using. But its kicking out the wrong values.

Code:
(base * ((base * rate) + level)) * (1 / (($gameParty.averageLevelBattleMembers() - level) +1))
Oh, I didn't notice Yanfly's plugin offered a function for the average level. Good to know! 🙏

I think the "non-finite" error might have been due to a division by zero, e.g. average level = enemy level. One way to avoid that is using Math.max to apply a minimum value (yes, max for min). Maybe try this:
JavaScript:
base * (base * rate + level) / Math.max(1 + $gameParty.averageLevelBattleMembers() - level, 1)
I.e. "...divided by 1 + average party level - enemy level, or 1, whichever is largest". This should also prevent division by a negative number (not sure how Yanfly's plugin handles negative exp values, probably best not to find out). Hope it works! 🙂
Thank you =)

That worked great, now I just need to change it to give each actor individual experience based on their levels lol.

Original thread: https://forums.rpgmakerweb.com/threads/experience-and-stat-formulas.129800/