Set = level, why not or easier way?

So I can't set someone's level = to someone else's level. That's a tad odd. Only increased by.

To get around this;
-Set Variable = Main character
-Variable - 1
-Change level of character by new current Variable.

So a level 11 character starts the event
-Variable = 11
-Variable - 1 = 10
- Increase recruited character's level by 10(Which started at 1).

Oh and a "Heal all" command so said character doesn't have current HP of level 1 Max HP.

This seems to work but is there an easier way to go about this?
Script calls? :/
Script calls? :/
Yeah, I don't know that there's a better way in this case.

Just quickly skimming the code, this will let you set a variable to the level of an actor, you could then use that to increase another actor's level.
JavaScript:
$gameVariables.setValue(1, $gameActors.actor(1).level)

There's probably a faster method though.

edit: for clarity the first "1" refers to the Variable Id, the second 1 is the actor id. You can change these however you need.

edit 2: Here's the faster method (set game actor 2 equal to Game Actor 1's level - 1)
Code:
$gameActors.actor(2).changeLevel($gameActors.actor(1).level - 1)
Yeah, I don't know that there's a better way in this case.

Just quickly skimming the code, this will let you set a variable to the level of an actor, you could then use that to increase another actor's level.
JavaScript:
$gameVariables.setValue(1, $gameActors.actor(1).level)

There's probably a faster method though.

edit: for clarity the first "1" refers to the Variable Id, the second 1 is the actor id. You can change these however you need.

edit 2: Here's the faster method (set game actor 2 equal to Game Actor 1's level - 1)
Code:
$gameActors.actor(2).changeLevel($gameActors.actor(1).level - 1)

That seems to do it though given that we seem to be actually setting/changing the characters levels rather than adding them, we don't even need the -1 for a script. Tested it and saw my character become level 3 vs a targeted Level 4 character.

Though you might want that at times. Hmm.
That seems to do it though given that we seem to be actually setting/changing the characters levels rather than adding them, we don't even need the -1 for a script. Tested it and saw my character become level 3 vs a targeted Level 4 character.

Though you might want that at times. Hmm.
Oh yeah, sorry, for some reason I thought you wanted to set the level to the main character's level - 1. But yeah. Get rid of it for equal.
Oh yeah, sorry, for some reason I thought you wanted to set the level to the main character's level - 1. But yeah. Get rid of it for equal.

I mean that might be useful at some stage but without a script I could only add or subtract levels, not set =.

So if I wanted to set someone's level to the Main character(10) it would add ten to the base level of 1 and make said character 11. Hence the -1 to equalize them.

Thanks for the help.

Original thread: https://forums.rpgmakerweb.com/threads/set-level-why-not-or-easier-way.126724/