MV Can change actor's max level in playing game?

That should work, yeah. Going by the code of the plugin, providing JS code as the argument should be fine as long as it's convertible to a number.
Thank you very much.
I'll try it right away!
That should work, yeah. Going by the code of the plugin, providing JS code as the argument should be fine as long as it's convertible to a number.

Well... it doesn't work.
There is no error, but the maximum level is still the same.
(T.T)


1641233780574.png



edit)
MaxLevel ActorSet 15 145

I've tried changing actor 145's level to 15 with this plugin, but that also doesn't work.
Hmm, maybe that won't work then.

But! Thanks to the power of Knowing How Works, do this in a script call instead:

var actorId = $gameParty._targetActorId;
var newMax = $gameActors.actor(actorId).maxLevel() + 5;

$gameSystem.setActorMaxLevelRestriction(newMax, actorId);
Hmm, maybe that won't work then.

But! Thanks to the power of Knowing How **** Works, do this in a script call instead:

var actorId = $gameParty._targetActorId;
var newMax = $gameActors.actor(actorId).maxLevel() + 5;

$gameSystem.setActorMaxLevelRestriction(newMax, actorId);
1641234238988.png


oh like this?

well......
doesn't work...




1641234312770.png


Oh, for reference, I put that plug-in at the bottom of the list and turned it on.
View attachment 211599

oh like this?

well......
doesn't work...




View attachment 211600

Oh, for reference, I put that plug-in at the bottom of the list and turned it on.
If you put
$gameSystem._maxLevelRestrictActor

into the console, what comes up?
If you put
$gameSystem._maxLevelRestrictActor

into the console, what comes up?
you mean developer tools console right?

1641234889257.png



Yes, it looks like 14 when i look at it, but...

1641234977693.png



It doesn't change in-game...
What if you do

$gameActors.actor(14).maxLevel()

what comes up for that? (and yes, developer console)
What if you do

$gameActors.actor(14).maxLevel()

what comes up for that? (and yes, developer console)

1641235278977.png


It says 50.

Ah, the maximum level of actor 14 was not changed because the default was 50.
Sorry, I meant $gameActors.actor(145).maxLevel()
Sorry, I meant $gameActors.actor(145).maxLevel()
1641235537689.png



um...
Yes, nothing has changed...
Did you exit out of the menu and go back in?
Did you exit out of the menu and go back in?

Yes, to be precise, using an item triggers a common event and automatically exits the menu.
Ah.

* Priority:
* In case of multiple restrictions (default, global, actor, class) the lowest
* value one will be used.

The default is 9, so it doesn't pay attention to the 14. Hmm.

Oh I see what's going on. This was intended to be a *restriction* plugin, so it only allows you to *lower* the maximum, not raise it.

However, if you remove lines 154 and 159 from the plugin and insert

if (levelArray.length === 0) return _Game_Actor_maxlevel.call(this);

it should work for raising it too.

Alternatively, it'll work as-is if you set the <max level: x> to the highest it can possibly be at any point in the game and then use the Trivel plugin to set it to its lower initial value.
Ah.

* Priority:
* In case of multiple restrictions (default, global, actor, class) the lowest
* value one will be used.

The default is 9, so it doesn't pay attention to the 14. Hmm.

Oh I see what's going on. This was intended to be a *restriction* plugin, so it only allows you to *lower* the maximum, not raise it.

However, if you remove lines 154 and 159 from the plugin and insert

if (levelArray.length === 0) return _Game_Actor_maxlevel.call(this);

it should work for raising it too.

Alternatively, it'll work as-is if you set the <max level: x> to the highest it can possibly be at any point in the game and then use the Trivel plugin to set it to its lower initial value.


oh
I'm a little confused, so I'll check again.

1. Delete line 154.
2. Delete line 159.
3. if (levelArray.length === 0) return _Game_Actor_maxlevel.call(this); insert

If so, where should I insert it?

Insert both on lines 154 and 159?
Or only insert on line 159 using if ?
Sorry, I missed a bit when editing that to say that you should insert that between lines 162 and 163.
Sorry, I missed a bit when editing that to say that you should insert that between lines 162 and 163.

1641236916182.png



Ah, like this !

Oh, in the case of lowering the basic maximum level and lowering the limit... The timing of obtaining actors is all different, and setting them up one by one seems to take too much time, so I want to use it as a last resort.
View attachment 211607


Ah, like this !

Oh, in the case of lowering the basic maximum level and lowering the limit... The timing of obtaining actors is all different, and setting them up one by one seems to take too much time, so I want to use it as a last resort.
Yep, that should do it. That'll make it so that the default max level setting is only considered if there are no other limits in play.
Yep, that should do it. That'll make it so that the default max level setting is only considered if there are no other limits in play.
1641237068610.png

oh my god it work!!!!

It was a long way... a long journey.

Thank you so much!
If I lived in the same country, I think I would have served them even a meal!


1641237321032.png


Oh, one last thing.
I want to display the modified maximum level value in the actor description window.
Could it be written as text like \v[$gameActors.actor(145).maxLevel()] ?

Oh it's not must essential right now.
However, with this it is unlikely that later players will confuse the current max level of this character.




EDIT+)
I've already received enough of your help, so if you can't help right now, you don't need to do anything to help.
View attachment 211608
oh my god it work!!!!

It was a long way... a long journey.

Thank you so much!
If I lived in the same country, I think I would have served them even a meal!


View attachment 211609

Oh, one last thing.
I want to display the modified maximum level value in the actor description window.
Could it be written as text like \v[$gameActors.actor(145).maxLevel()] ?

Oh it's not must essential right now.
However, with this it is unlikely that later players will confuse the current max level of this character.




EDIT+)
I've already received enough of your help, so if you can't help right now, you don't need to do anything to help.
I don't think it works like that, but if you set aside a variable for each actor's max level you can do \v[id] and just set that variable's value to the new max level in the same code that changes the max.
I don't think it works like that, but if you set aside a variable for each actor's max level you can do \v[id] and just set that variable's value to the new max level in the same code that changes the max.

Oh, it seems like it would be hard to edit the variables one by one...
It seems to be solved by changing the description of the actor description window to say "default maximum level".
Thank you very much for your great help.

Original thread: https://forums.rpgmakerweb.com/threads/can-change-actors-max-level-in-playing-game.143538/