じ☆ve冰风 发表于 2026-7-23 21:05:25

Level Cap (MV/MZ)

Level Cap 1.0
ATT_Turan​

Introduction
I've seen this come up repeatedly, so I decided to refine my original code snippet and make a more user-friendly plugin out of it.

This plugin gives you more control over the level cap in your game. Actors will not gain experience beyond that cap, which can be set globally or defined per actor.
At its simplest, the default plugin parameter is set to one of the game's variables - the level cap for all actors will be whatever you set the value of that variable to be at any given time during the game. Note that levels can't be lost by setting the variable lower, the actors simply won't gain any further experience from wherever they are.
That plugin parameter accepts code, so you can also make it any valid equation or JavaScript formula. In that case, you can use the variable user to refer to the actor gaining experience. The value of the cap variable is what will be used as the level cap.

Finally, there are notetags that can be placed onto any database object to calculate the level cap more individually. In the event there are notetags on more than one object, the priority is:
State > Weapon > Armor > Class > Actor

I have tested the basic functionality, please let me know if you encounter any errors. I will consider making compatibility patches if the other plugin is free to use (or one I own, such as a Yanfly product) and unobfuscated. Otherwise, other authors are free to modify this code to make it compatible with theirs so long as I am still credited.
View attachment 326935

Spoiler: NotetagsActor/Class/Weapon/Armor/State notetag
                Code:       
<Level Cap Eval>
code
cap = code
</Level Cap Eval>


JavaScript code in this notetag will be executed any time the actor gains experience. The cap variable will initially have whatever value is determined by the plugin parameter. You can perform mathematical operations on it or use any other code to change its value entirely. Its final value will be used as the actor's level cap. There is also a user variable to refer to the actor whose level cap is being determined.
Terms and Credits
Free for non-commercial and commercial use. Credit ATT_Turan.


本贴来自国际rpgmaker官方论坛作者:ATT_Turan处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/level-cap-mv-mz.179089/
页: [1]
查看完整版本: Level Cap (MV/MZ)