Stop experience gain at max level?

Hey guys, I'm creating a chapter based game where each chapter the level cap for all actors increases. The idea is so the player cannot grind levels to beat the optional challenging content in the chapter, and it will be easier to balance knowing his level, skills acquired and access to equipment.

The problem - actors continue to gain exp after they reach the max level and once the player eventually proceed to the next chapter and the level cap increases - the actor suddenly gains multiple levels from the stored experience, maybe even reaching the cap again.

I thought about creating a parallel common event that checks the actor level and if he reaches certain level it sets his SP-parameter EXP to 0%, but it will be quite chunky event because it has to check for chapter # and set a new cap for each one.
And now imagine that with 20 actors and 6-7 chapters.

Won't having so many parallel events be too demanding on the game's memory?

Am I on the right track?

Perhaps some of you guys can think of a more elegant solution.
You could secretly demote everyone a level, then give them the level back before the start of each chapter.
Lol, I saw your first reply to this post about setting the level cap from a Js file and I tested it, it worked but it didn't solve my problem. The answer was just two scroll-downs away! Sorry for creating an extra thread.


You could secretly demote everyone a level, then give them the level back before the start of each chapter.
I tested this, and it's almost perfect in two commands. change level: Entire party - 1> set variable: level cap 30. (increased from 20) For some reason giving them back a level put them to level 21.
the problem - it changes the level even for actors that are not at the level cap, you have to tie a variable to their level and check if it's at the current level cap before the "change level" command hit's them. It works but you have to do some extra work for the lower level cases.

Anyway, thank you guys for the answers, cheers!
Instead of making an event for the whole party, you could just test the actors, which in a lot of cases is just four actors. If their level = (whatever the max level is for the chapter they are leaving), THEN change their level -1, then change their level +1. Four tests in one event before you go to the next chapter.

For later chapters, just change the level to whatever you are using for that chapter. No reason to write a lot of code.
I tested this, and it's almost perfect in two commands.
The problem with what @pawsplay suggested is it literally does not address the question you actually asked - how can you stop the actors from gaining experience when they're at your max level?

It provides a workaround for making them not start the next area at too high a level, but it does nothing for the issue of seeing the experience gain after battles and in the menu.

If you don't actually care about that and you just want to make sure their level is correct when you start the next area, then you can do that - personally I think it's easier to drop in the plugin code I already provided and no further effort is required 😉

But whatever best suits your purposes.
The problem with what @pawsplay suggested is it literally does not address the question you actually asked - how can you stop the actors from gaining experience when they're at your max level?

I don't see why that's a problem. The stated problem is characters gaining multiple levels when a new cap is set. My suggestion makes sure their XP is not above what is needed for their current level. Also, if you simply stop gaining XP, the characters will be at some probably small, but arbitrary, number of XP above the minimum for their level; my suggestion simply caps them at a specific value. I'd rather have consistency.

For complete consistency, the ideal would probably be to set a maximum number of XP, rather than a maximum level. You would then not have to adjust anything; actors won't be a small, arbitrary number of XP into the next level; the player can see that they are no longer accumulating XP after a certain number. Triggering a "stop gaining XP" behavior seems like a kludge to me.
I don't see why that's a problem.
It has to do with a polished UX in your game. If the player sees their actors getting experience in one part of the game then suddenly those actors no longer have those experience points, that's janky.

For complete consistency, the ideal would probably be to set a maximum number of XP, rather than a maximum level.
For the majority of people that is the same thing. Most people don't have different experience curves between classes; if the OP did and needed help adjusting the code for that, it's easily done.

You would then not have to adjust anything; actors won't be a small, arbitrary number of XP into the next level
I don't know what you're talking about. Where did "a small, arbitrary number of XP" come from anywhere in this thread?
I don't see why that's a problem.
Seriously? I would think my game is glitchy if my characters earn experience at one point, then suddenly stop. That's poor UI, as well as fairly poor UX. There are times when patch jobs work perfectly well, but why haphazardly patch when a simple, elegant solution exists?
I don't know what you're talking about. Where did "a small, arbitrary number of XP" come from anywhere in this thread?

Let's say it takes 80,000 XP to reach level 6. You have 79,900 XP. If the next thing you defeat gives you 100 experience, you now have 80,000 XP and stop gaining XP. If it gives you 1,500 XP, you now have 80,140 XP and stop gaining XP. It may be inconsequential, but to me that's so unaesthetic I would never do it.

Seriously? I would think my game is glitchy if my characters earn experience at one point, then suddenly stop. That's poor UI, as well as fairly poor UX. There are times when patch jobs work perfectly well, but why haphazardly patch when a simple, elegant solution exists?

Agreed! 😉 If you can't get a specific XP cap in an elegant fashion, I would definitely prefer my suggestion over the idea of trying to stop XP gain when you reach a certain level. Seriously. XP and level should be in sync.
Let's say it takes 80,000 XP to reach level 6. You have 79,900 XP. If the next thing you defeat gives you 100 experience, you now have 80,000 XP and stop gaining XP. If it gives you 1,500 XP, you now have 80,140 XP and stop gaining XP. It may be inconsequential, but to me that's so unaesthetic I would never do it.
No, you don't. Have you even looked at or tried the code I provided? That is not how it works, and I don't know why you think it does.

If you can't get a specific XP cap in an elegant fashion, I would definitely prefer my suggestion over the idea of trying to stop XP gain when you reach a certain level.
Who said you can't get a specific XP cap? That was not what the OP asked for, so it hasn't been addressed - if you have your own mechanic you seem fixated on, you should make a separate plugin request thread for it.
I was responding to

I thought about creating a parallel common event that checks the actor level and if he reaches certain level it sets his SP-parameter EXP to 0%, but it will be quite chunky event because it has to check for chapter # and set a new cap for each one.

I didn't say anything was wrong with your code. I was just addressing "the problem," the OP. I was translating the OP's request from a general request to something that is precise in computer logic.

I don't think we are disagreeing. I just glanced at your code, and it appears to set an XP cap, that cap being set to what is sufficient for the current level. I suggested one solution for "the problem," you suggested another; your code seems to be what I said was the ideal solution. So, hats off to you. If you think I said something else, I apologize for being unclear.

I always like to present event options, when feasible, in addition to scripted ones. The reason being I think it's worthwhile understanding the game behavior, then applying scripted solutions if that is more elegant. Not everyone reads code well.
I always like to present event options, when feasible, in addition to scripted ones. The reason being I think it's worthwhile understanding the game behavior, then applying scripted solutions if that is more elegant. Not everyone reads code well.
I understand the engine plenty fine, and understand how limited it is if you only use event commands (i.e. the limited set of functions the devs decide to make UI buttons for). Scripting gives you access to all the code and lets you add your own.

Because RPG Maker is a template-based engine, everything is already designed a certain way to be plug and play and beginner-friendly. This includes how level ups work. If you want to break away from the template you have to overwrite the hard-coded function with a plugin like ATT_Turan did.
Because RPG Maker is a template-based engine, everything is already designed a certain way to be plug and play and beginner-friendly. This includes how level ups work. If you want to break away from the template you have to overwrite the hard-coded function with a plugin like ATT_Turan did.

The event-based solution I posted above works. The only downside is the aesthetic matter that your EXP can visually continue to go up until the end of the chapter. As soon as you start the new chapter, the two solutions presented look the same.
seeing as how the issue has been solved...

Closed

Original thread: https://forums.rpgmakerweb.com/threads/stop-experience-gain-at-max-level.178707/