MV YEP_StatAllocation - AP change every 10 levels

Hey,

YEP_StatAllocation give me with this Standard AP Formula "(level - 1) * 8" for each level up 8 AP Points to put them in my stats.

I try to find a way to get less AP on my first levels and more in mid/late game.

Something like:
Level 1-10 : i get 8 AP
Level 11-20: i get 12 AP
Level 21-30: i get 16 AP
Someone know the right formula? I tried few things but it didnt worked and i didnt find an answer in this forum.

Thanks guys

Greetz
Bump
Looks like you simply want every ten levels to give you 4 AP, plus 4 to start at a base of 8. So that's level/10*4+4.

The only trick is that you want the increase to start at the 1 digit of each decade, so we need to round up.

Math.ceil(level/10)*4+4
Not sure if it will work, but you can try:
var apAdd = 8; if(level > 10) apAdd += 4; if(level > 20) apAdd += 4; apAdd;
Not sure if it will work, but you can try:
You would not want to include a return statement in a line of code that's getting evaluated within a function, it would (best case) make the whole thing not work.

Also, what is the benefit to that over the shorter equation I supplied that supports going up to any level, not just 21?
True. I edited my post to remove the return. Should work now.
My only issue with yours @ATT_Turan was that the op only asked for code up to level 30. If it goes to the 40s or beyond, your code might give more ap than the op asked for. Not a huge deal but just a different route to the goal.
True. I edited my post to remove the return. Should work now.
My only issue with yours @ATT_Turan was that the op only asked for code up to level 30. If it goes to the 40s or beyond, your code might give more ap than the op asked for. Not a huge deal but just a different route to the goal.
It's true that I extrapolated further than the OP wrote, which was a presumption on my part. However, your code still has some flaws. For example, the statement apadd; doesn't actually do anything. I also haven't looked at how that parameter is used in the plugin to see if your method of using multiple statements and a variable instead of just one formula will work in context.

What you wrote would work in RPG Maker's damage formula, but not necessarily in any plugin parameter (and you still wouldn't need that last apadd).

The safer (and more compact) way to express this in a single formula and have it cap at 16 AP from level 21 on would be:
Code:
(level>20 ? 16 : (level>10 ? 12 : 8))
You are very proud of your work. That's great. Thanks for the pointers and examples.

Original thread: https://forums.rpgmakerweb.com/threads/yep_statallocation-ap-change-every-10-levels.139530/