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

Hello!
I'm making a little special game.
To summarize only the important things, the number of actors in the game is over 100.
However, some of these actors don't even reach level 20, and some go up to level 999.
Accordingly, as the game progresses, some characters are automatically discarded.
Of course, this was intended to some extent, but there were opinions that players who tested the game were too useless and took up party windows needlessly.
However, since it is not possible to delete these characters due to the requirements of the game development and switches, I would like to make an item that can increase the maximum level of the character as an additional element.
I used yanfly's core engine plugin to change the 'default' max level of some characters, but I can't quite find a way to change the max level while playing the game.


Can I get some help on this?

Should this article go to Javascript/Plugin Support?

I wrote it using a translator, so if there is something you do not understand, I will explain further.
You can change the max level of an actor with a script call.
JavaScript:
$gameActors.actor(id).maxLevel += x;
You can have the item call a common event and place this script inside the common event. To get the id of the actor that was the target of an item, refer to this thread: https://forums.rpgmakerweb.com/index.php?threads/get-actor-id-of-item-target.115174/

However, since it is not possible to delete these characters due to the requirements of the game development and switches, [...]

However this kind of sounds like a XY problem to me. Could you please elaborate on why you can't remove characters once they outlived their usefulness?
There is a problem with your script call, @eomereolsson. Default limit in database for max level for actors is 99, think what happens, when you breach that limit? How the game will know which values from database (classes tab) load, when you're above max limit? I'm pretty sure that @Dehsalp won't need that high value, but... The problem at some point (wrong edited event) will eventually occur. Also, @Dehsalp you will need to setup all parameters in database->classes up to 99 level, before applying script call given by @eomereolsson
This should not be a problem, as the OP is already using Yanfly's Core Engine to handle levels beyond the base engine's limit of 99. However I agree that anyone stumbling upon this thread and trying to copy that code should factor that in. Either by also handling levels beyond 99, or by ensuring the maxLevel can not become greater than 99.
Moved to: Javascript/Plugin Support
You can change the max level of an actor with a script call.
JavaScript:
$gameActors.actor(id).maxLevel += x;
You can have the item call a common event and place this script inside the common event. To get the id of the actor that was the target of an item, refer to this thread: https://forums.rpgmakerweb.com/index.php?threads/get-actor-id-of-item-target.115174/



However this kind of sounds like a XY problem to me. Could you please elaborate on why you can't remove characters once they outlived their usefulness?


Thanks for the kind reply!


Since I am using the yanfly core engine, I think that I can probably exceed level 999 even with scripts.
I will try it as soon as possible.

To explain why I can't remove some actors from the game.

1. Lots of interaction between some actors.
In the story, there are quite a few lines added when a certain actor is in the party and when he is not.
Other than that, some actors in particular use skills that are very weak but give very strong buffs to certain actors.

ex) A is only level 20, but has a buff skill that only applies to actor B. If I use it on another C or D, nothing happens.
ex2) C level is high and powerful, but D is only level 5. C has a very powerful attack skill, but to use it, actor D must be participating in the battle. If D is not in the party in battle, the skill cannot be used.

2. This is because the basis of the game I make is 'character game'.
The game is not completely original, it is a fan game.
Some like A and some like B.
So, i can't delete the character hastily.

Would this be the answer?
You can change the max level of an actor with a script call.
JavaScript:
$gameActors.actor(id).maxLevel += x;
You can have the item call a common event and place this script inside the common event. To get the id of the actor that was the target of an item, refer to this thread: https://forums.rpgmakerweb.com/index.php?threads/get-actor-id-of-item-target.115174/



However this kind of sounds like a XY problem to me. Could you please elaborate on why you can't remove characters once they outlived their usefulness?

1641229714114.png


I tried it and I get these errors

1641229582493.png
That's not the only problem with the script call.

maxLevel on an actor is a function which returns this.actor().maxLevel, which is a value derived from the "max level" setting in the database.

because maxLevel is a function and not a property, what you've effectively just done is taken the string representation of the function code and added a "5" onto the end of it, which stops it working as a function and is why you're seeing that error.

In order to modify this value in a way that will persist through game sessions, you'd have to add maxLevel as a property to the actor class.

YEP Core Engine doesn't change this fundamental functionality; the max level parameter/notetag just modifies the data object. You still can't add to and subtract from it like this.

You can see this for yourself fairly easily: if you set a notetag on an actor, say <maxlevel: 999>, save the game, then go back into the database and set it to <maxlevel: 4>, then load your save, the max level is 4 and not 999, because the value is still being taken from the raw data and not included in the save file.
This represents character 1
$gameActors.actor(1).changeLevel(9999, true)
That's not the only problem with the script call.

maxLevel on an actor is a function which returns this.actor().maxLevel, which is a value derived from the "max level" setting in the database.

because maxLevel is a function and not a property, what you've effectively just done is taken the string representation of the function code and added a "5" onto the end of it, which stops it working as a function and is why you're seeing that error.

In order to modify this value in a way that will persist through game sessions, you'd have to add maxLevel as a property to the actor class.

YEP Core Engine doesn't change this fundamental functionality; the max level parameter/notetag just modifies the data object. You still can't add to and subtract from it like this.

You can see this for yourself fairly easily: if you set a notetag on an actor, say <maxlevel: 999>, save the game, then go back into the database and set it to <maxlevel: 4>, then load your save, the max level is 4 and not 999, because the value is still being taken from the raw data and not included in the save file.
That means I can't change the max level of an actor this way...

As in the image, I used YEP core engine to change the MAX level in note, so how can I change the max level of an actor during the game?


1641230764274.png




This represents character 1
$gameActors.actor(1).changeLevel(9999, true)
oh thx but...

It seems to me that it's simply changing the actor's current level (of course I'm not aware of this because I'm shallow in my view).
Can I change the max level of an actor with this script?

Oh, and what I want is to raise the maximum level + 5, and not simply change the maximum level to a certain number.

Even if that script works, doesn't that change the max level of actor #1 to 9999?
That means I can't change the max level of an actor this way...

As in the image, I used YEP core engine to change the MAX level in note, so how can I change the max level of an actor during the game?


View attachment 211587




oh thx but...

It seems to me that it's simply changing the actor's current level (of course I'm not aware of this because I'm shallow in my view).
Can I change the max level of an actor with this script?

Oh, and what I want is to raise the maximum level + 5, and not simply change the maximum level to a certain number.

Even if that script works, doesn't that change the max level of actor #1 to 9999?
What I'm saying is that as it stands you can only do this temporarily. I'm not aware of any existing plugin that turns maxLevel into a property that is retained on save, so you'll have to either write one or get someone else to do so.

Edit: caethyril appears to have you covered in this post about the same thing: https://forums.rpgmakerweb.com/inde...allows-for-changing-max-level-in-game.108432/
That means I can't change the max level of an actor this way...
That means I can't change the max level of an actor this way...

As in the image, I used YEP core engine to change the MAX level in note, so how can I change the max level of an actor during the game?


View attachment 211587




oh thx but...

It seems to me that it's simply changing the actor's current level (of course I'm not aware of this because I'm shallow in my view).
Can I change the max level of an actor with this script?

Oh, and what I want is to raise the maximum level + 5, and not simply change the maximum level to a certain number.

Even if that script works, doesn't that change the max level of actor #1 to 9999?
It will definitely change to level 9999 if you set the max level to 9999 in Yanfly Core Engine.
What I'm saying is that as it stands you can only do this temporarily. I'm not aware of any existing plugin that turns maxLevel into a property that is retained on save, so you'll have to either write one or get someone else to do so.

Edit: caethyril appears to have you covered in this post about the same thing: https://forums.rpgmakerweb.com/inde...allows-for-changing-max-level-in-game.108432/

Ah... I understand.
This means that it is a problem that cannot be solved by simply changing the number.
It's really sad.


EDIT )
lol it's 2019
It's like me in another parallel world.
It's exactly the problem I'm looking for, so I've been looking for a solution to this problem for dozens of hours, and I haven't been able to find that article...
I don't know whether to express disappointment or joy.
Yes, I'm glad.

Let's try it right away.
Ah... I understand.
This means that it is a problem that cannot be solved by simply changing the number.
It's really sad.


EDIT )
lol it's 2012
It's like me in another parallel world.
It's exactly the problem I'm looking for, so I've been looking for a solution to this problem for dozens of hours, and I haven't been able to find that article...
I don't know whether to express disappointment or joy.
Yes, I'm glad.

Let's try it right away.
Having read the thread further, the very last post is a link to a MrTrivel plugin that does exactly what you were asking for.
I don't understand how much The maximum level setting is 999. If you set the parameters of Yanfly Core Engine. Running $game Actors.actor(1).change Level(999, true) will work. Then what do you want?
@Trihan Oops, good catch. I just took a quick look on how Yanfly's notetags worked, but didn't realize that the attribute was only part of the database object and not the actual in-game actor object. That's a thing that gets me again and again 😅
I don't understand how much The maximum level setting is 999. If you set the parameters of Yanfly Core Engine. Running $game Actors.actor(1).change Level(999, true) will work. Then what do you want?
1641232067084.png


Oh, I'm already using that feature.
What I'm hoping for isn't simply to lift the maximum level limit for actors.

i'm already using the MAX LEVEL of NOTE, and i will give an example for explanation.

The maximum level of actor A is 999.
Actor B has a maximum level of 148.

After that, I want to raise the maximum level of Actor B by 5 using a specific item.
If you use the item, A will still have a max level of 999, and B will have a max level of 153.
I would like to be able to upload more when using items in the future.

I don't know if the explanation is good.
Did you understand?




Having read the thread further, the very last post is a link to a MrTrivel plugin that does exactly what you were asking for.

Hmm... I read that too, but what I want is not to 'set the max level to a fixed value', I just want to raise the max level + 5.

for that plugin
The maximum level of actor A is 999,
Actor B has a maximum level of 148.

In this case, if I use MaxLevel ActorSet 30 1 as a plugin, the maximum level of A will be reduced to 30, right?

I'm even more careful because my game has over 100 actors and each actor has a different max level.
View attachment 211591

Oh, I'm already using that feature.
What I'm hoping for isn't simply to lift the maximum level limit for actors.

i'm already using the MAX LEVEL of NOTE, and i will give an example for explanation.

The maximum level of actor A is 999.
Actor B has a maximum level of 148.

After that, I want to raise the maximum level of Actor B by 5 using a specific item.
If you use the item, A will still have a max level of 999, and B will have a max level of 153.
I would like to be able to upload more when using items in the future.

I don't know if the explanation is good.
Did you understand?






Hmm... I read that too, but what I want is not to 'set the max level to a fixed value', I just want to raise the max level + 5.

for that plugin
The maximum level of actor A is 999,
Actor B has a maximum level of 148.

In this case, if I use MaxLevel ActorSet 30 1 as a plugin, the maximum level of A will be reduced to 30, right?

I'm even more careful because my game has over 100 actors and each actor has a different max level.
Use a calculation as the argument for the ActorSet command:

MaxLevel ActorSet $gameActors.actor(1).maxLevel()+5 1
Use a calculation as the argument for the ActorSet command:

MaxLevel ActorSet $gameActors.actor(1).maxLevel()+5 1

hmm... ok...

then...

MaxLevel ActorSet $gameActors.actor($gameParty._targetActorId).maxLevel()+5 $gameParty._targetActorId

Can I use it like this?
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.

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