MV (Yanfly's Class change core) Keep levels when changing class with some actors and with others don't

Hello, everyone! My question is simple. Is there a way I can choose which actors will keep their current level when changing classes? Currently, Yanfly's class change core only allows one or the other through the puglin's parameters. Please, let me know if there's anything that can be done. Thanks for reading!!!

The link of the plugin in question:

Sure. Open the plugin in a text editor, go to line 637 and change it to read:
Code:
keepExp = $dataActors[this.actorId()].meta["keepExp"] || Yanfly.Param.CCCMaintainLv;

Then, on line 671,
Code:
if ($dataActors[this.actorId()].meta["keepExp"] || Yanfly.Param.CCCMaintainLv) return this.level;

Set the plugin parameter to false, and on any actors you want to keep the level give them the notetag <keepExp>

Let me know if you have any problems.
Sure. Open the plugin in a text editor, go to line 638 and change it to read:
Code:
keepExp = $dataActors(this.actorId()).meta[keepExp] || Yanfly.Param.CCCMaintainLv;

Then, on line 672,
Code:
if ($dataActors(this.actorId()).meta[keepExp] || Yanfly.Param.CCCMaintainLv) return this.level;

Set the plugin parameter to false, and on any actors you want to keep the level give them the notetag <keepExp>

Let me know if you have any problems.
imagen_2022-11-16_103749319.png

This appears whenever I try to change the lines. Maybe my text editor numbers them differently. Can you please tell me what the original lines said so I know which ones I should change? Thanks a lot for your answer, btw!
Replace $dataActors(x) with $dataActors[x].
Yeah, I had a typo in there. You're probably on the correct lines.

I've corrected my original post for reference.
personally though, this idea is much better than the orianl 1, keep exp or do not.
I wonder why it wasn't like that so the player could choose, nice job though =)
It works now (I guess), but for some reason, the menu command for changing classes doesn't appear in the main menu. Can you also help me with this, please?

I said that I guess that the changes work because I can't actually test if the levels are kept or not because I can't access the class change command.

Thanks for the answers.
That's bizarre, nothing I told you to add should have any effect on that. Um, check that your Yanfly plugins are in the correct order according to the Web site? I think there's usually a plugin parameter that says whether it shows in the menu, make sure that's enabled.
That's bizarre, nothing I told you to add should have any effect on that. Um, check that your Yanfly plugins are in the correct order according to the Web site? I think there's usually a plugin parameter that says whether it shows in the menu, make sure that's enabled.
I tested it in other project and this error pops up.
imagen_2022-11-17_211931615.png
imagen_2022-11-17_212019124.png
The lines I've changed in the plugin are nº 637 (you said 638, but this one I think makes sense because 638 in my text editor is "if (keepExp) {"):

637. keepExp = Yanfly.Param.CCCMaintainLv;


And nº 671 (you said 672, but since I thought that 638 was 637 for me, maybe 672 was 671 for me too):

671. if (Yanfly.Param.CCCMaintainLv) return this.level;


Dunno if these weren't the lines I was supposed to change or what, but the error keeps appearing. What do you think is the cause?

PS: I did everything you told me, including turning off the "maintain levels" plugin parameter and putting the "<keepExp>" notetag on the actors. Thanks for your answers!
My apologies for the line numbers mixup. I forgot that I modified my copy of the plugin.

I must've been super tired or something when I first wrote out that snippet for you...I made two errors.

The corrected code:
Line 637:
Code:
keepExp = $dataActors[this.actorId()].meta["keepExp"] || Yanfly.Param.CCCMaintainLv;

Line 671:
Code:
if ($dataActors[this.actorId()].meta["keepExp"] || Yanfly.Param.CCCMaintainLv) return this.level;
My apologies for the line numbers mixup. I forgot that I modified my copy of the plugin.

I must've been super tired or something when I first wrote out that snippet for you...I made two errors.

The corrected code:
Line 637:
Code:
keepExp = $dataActors[this.actorId()].meta["keepExp"] || Yanfly.Param.CCCMaintainLv;

Line 671:
Code:
if ($dataActors[this.actorId()].meta["keepExp"] || Yanfly.Param.CCCMaintainLv) return this.level;
Now it works perfectly fine. Thanks a lot for your help!!!

Original thread: https://forums.rpgmakerweb.com/threads/yanflys-class-change-core-keep-levels-when-changing-class-with-some-actors-and-with-others-dont.152642/