MV Area with Actor Level restriction??

Hi! I want to restrict a player keep leveling up on the map.

For example on Map 1, Max Lvl 10, if the Actor kill someone on this level being level 10 cant lvl up anymore till he goes to Map 2 or Area 2.

There is any plugin or script for this?

Thanks!
Try this - copy and paste into a text editor, save as a *.js file, include as a plugin:
Code:
Game_Actor.prototype.gainExp = function(exp) {
    var newExp = this.currentExp() + Math.round(exp * this.finalExpRate());
    if ($dataMap.meta.levelcap && this._level==$dataMap.meta.levelcap)
        newExp=Math.min(newExp, this.expForLevel(this._level+1)-1);
    this.changeExp(newExp, this.shouldDisplayLevelUp());
};

Then you'd put in your map notes the notetag <levelcap: x> and actors shouldn't be able level past x.
Try this - copy and paste into a text editor, save as a *.js file, include as a plugin:
Code:
Game_Actor.prototype.gainExp = function(exp) {
    var newExp = this.currentExp() + Math.round(exp * this.finalExpRate());
    if ($dataMap.meta.levelcap && this._level==$dataMap.meta.levelcap)
        newExp=Math.min(newExp, this.expForLevel(this._level+1)-1);
    this.changeExp(newExp, this.shouldDisplayLevelUp());
};

Then you'd put in your map notes the notetag <levelcap: x> and actors shouldn't be able level past x.

Nice! Thanks so much, let me try this!

I've moved this thread to Plugin Requests. Thank you.

even if the ATT_Turan snippet can work, and they go to area 2 and become
level 15 and go back to map 1, they are level 15 but not gaining exp?

unless you need to check if the level >= 10 for that purpose, and the
other >= 20 so even if they are level 10+ they wont get exp?

unless that snippet does that already ofcourse.

another way is to save the higher level (current) level is saved, and dropped
to level 10 capped if they return to the lower level area?

this is just an idea (even while I cannot use it) or know your mechanic or idea's 🙂
even if the ATT_Turan snippet can work, and they go to area 2 and become
level 15 and go back to map 1, they are level 15 but not gaining exp?

unless you need to check if the level >= 10 for that purpose, and the
other >= 20 so even if they are level 10+ they wont get exp?

unless that snippet does that already ofcourse.

another way is to save the higher level (current) level is saved, and dropped
to level 10 capped if they return to the lower level area?

this is just an idea (even while I cannot use it) or know your mechanic or idea's 🙂
Yeah the point is if you returns to Map 1, and u are lvl 15, u wont get any exp in Map 1, but u still lvl 15
Ah - I didn't think about backtracking. Change the portion of the third line from
Code:
this._level==
to
Code:
this._level>=
Ah - I didn't think about backtracking. Change the portion of the third line from
Code:
this._level==
to
Code:
this._level>=
Thanks you!!
Just to put it out there - if you have these level-delineated areas, you might be interested in this plugin I made.

It allows you to define when you are a higher level than your enemies and get out of battle by releasing them. That way you don't have to waste time/resources fighting them for no gain, and you don't have the risk of failing to escape.

Just to put it out there - if you have these level-delineated areas, you might be interested in this plugin I made.

It allows you to define when you are a higher level than your enemies and get out of battle by releasing them. That way you don't have to waste time/resources fighting them for no gain, and you don't have the risk of failing to escape.

Sounds nice, ill try out, thanks bro!
@ATT_Turan ,your code work like a charm, there is a chance to add a line that make when actor lvl up recover all hp and mp?
That doesn't really have anything to do with your original request - it would correctly go in a different part of the code.

If you do a Google, there are existing plugins to do that. There's one just for healing by Shaz, there's another more generic for running common events on level by HimeWorks.
@ATT_Turan ,your code work like a charm, there is a chance to add a line that make when actor lvl up recover all hp and mp?
I made one you can customize to let some actors get one or both of their bars refilled.

Original thread: https://forums.rpgmakerweb.com/threads/area-with-actor-level-restriction.159335/