Reading levels of the leader/party member

Status
Not open for further replies.

slickdeath97

Veteran
Veteran
Joined
Feb 26, 2019
Messages
442
Reaction score
9
First Language
english
Primarily Uses
RMVXA
Hey guys, could use some help with something. I am trying to make an event that adds a party member, but I want the party member to be set to around the same level as the leader. There are multiple options for the leader, but not all of them would be the same level, so how would I go at making a variable that reads the leaders level? Thanks for any help.
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
You can simply get all the levels you need using Control Variables and then use the one you need. Another option would be that of storing them into an array. However, what do you mean by "leaders"? This information is crucial here.
 

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
331
Reaction score
486
First Language
German
Primarily Uses
RMMV
#1 Make two variables.
Variable 1 is equal to the EXP of the leader
Variable 2 is equal to the EXP of the party member

#2 then you subtract Variable 2 from Variable 1 (Variable 1 - Variable 2)

#3 Then you increase the EXP of the party member by Variable 1.

#4 add the party member to the party.

NOTE: This only works properly if both actors have the same EXP curve.
 
Last edited:

slickdeath97

Veteran
Veteran
Joined
Feb 26, 2019
Messages
442
Reaction score
9
First Language
english
Primarily Uses
RMVXA
You can simply get all the levels you need using Control Variables and then use the one you need. Another option would be that of storing them into an array. However, what do you mean by "leaders"? This information is crucial here.
By leaders I mean the person that is first in the menu. They are known to be the leader of the party. The only problem is that the leader can be switched between other party members that are in the party. So I need to make sure that if the leader is switched to someone else the member that is being added is still around the same level as the rest of the party/party leader.
 

slickdeath97

Veteran
Veteran
Joined
Feb 26, 2019
Messages
442
Reaction score
9
First Language
english
Primarily Uses
RMVXA
#1 Make two variables.
Variable 1 is equal to the EXP of the leader
Variable 2 is equal to the EXP of the party member

#2 then you subtract Variable 2 from Variable 1 (Variable 1 - Variable 2)

#3 Then you increase the EXP of the party member by Variable 1.

#4 add the party member to the party.

NOTE: This only works properly if both actors have the same EXP curve.
The party members are not all going to have the same exp curve so I don't know how well this would work.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,425
Reaction score
7,710
First Language
German
Primarily Uses
RMMV
1) if every added member gets the same level/EXP and (as in a regular game) all party members get the same EXP, then it doesn't matter which existing actor is used to determine the level, because all party members will have the same level anyway.

ONLY if different actors get different numbers of EXP it would matter how many EXP the leader has. And if that is the case, then you have a game mechanic that can be exploited by the player and that will destroy your game balancing for later game stages.

So this is probably a case of you not thinking it through.

2) if you really have a game mechanic that let's you set different levels to different actors, then the solution is a double control variable.
Use the first control variable to get the actor ID of the leader of the party, and then use another control variable to get the EXP from that particular actor
But I strongly advice against that unless you really know what you're doing.
 

slickdeath97

Veteran
Veteran
Joined
Feb 26, 2019
Messages
442
Reaction score
9
First Language
english
Primarily Uses
RMVXA
1) if every added member gets the same level/EXP and (as in a regular game) all party members get the same EXP, then it doesn't matter which existing actor is used to determine the level, because all party members will have the same level anyway.

ONLY if different actors get different numbers of EXP it would matter how many EXP the leader has. And if that is the case, then you have a game mechanic that can be exploited by the player and that will destroy your game balancing for later game stages.

So this is probably a case of you not thinking it through.

2) if you really have a game mechanic that let's you set different levels to different actors, then the solution is a double control variable.
Use the first control variable to get the actor ID of the leader of the party, and then use another control variable to get the EXP from that particular actor
But I strongly advice against that unless you really know what you're doing.
It is true that all the actors get the same exp, but that is different from the classes that are used for them. How would I go at making variables for these scenarios?
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
I would go about this slightly differently.
You have three separate tasks; the first is to identify who is the leader, the second is to determine the level of the leader, the third is to ensure that the new party member is at the level of the leader.

This needs to be done with conditionals, and so is slightly tedious.
Conditional check, using the 'script' option, and this needs to be done for all possible leaders
Code:
$game_party.leader == $game_actors[1]
In the 'else' branch, another conditional, this time for actors[2] and so on for all actors.
Having got the basic structure, you now need to establish the level of the leader, so inside each individual part of the conditional, you need to call up the actor's level with a variable, use that variable to set the new party member's level - and then reduce that by one. Why? Because the new party member will have one level anyway, and if you don't they will come in at a higher level than the hero.

Here is a screen shot of such a check, though only illustrating what you do for actor one. Just repeat those commands for all possible actors.

1590991702906.png
 

slickdeath97

Veteran
Veteran
Joined
Feb 26, 2019
Messages
442
Reaction score
9
First Language
english
Primarily Uses
RMVXA
I would go about this slightly differently.
You have three separate tasks; the first is to identify who is the leader, the second is to determine the level of the leader, the third is to ensure that the new party member is at the level of the leader.

This needs to be done with conditionals, and so is slightly tedious.
Conditional check, using the 'script' option, and this needs to be done for all possible leaders
Code:
$game_party.leader == $game_actors[1]
In the 'else' branch, another conditional, this time for actors[2] and so on for all actors.
Having got the basic structure, you now need to establish the level of the leader, so inside each individual part of the conditional, you need to call up the actor's level with a variable, use that variable to set the new party member's level - and then reduce that by one. Why? Because the new party member will have one level anyway, and if you don't they will come in at a higher level than the hero.

Here is a screen shot of such a check, though only illustrating what you do for actor one. Just repeat those commands for all possible actors.

View attachment 146129
I will try this out. Thanks for the help.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,672
Reaction score
566
First Language
English
Primarily Uses
RMVXA
making a variable that reads the leaders level?
Make a variable equal to $game_party.battle_members[0].level
Subtract 1 from variable.
Add member to party
add variable to new members level.
 
  • Like
Reactions: Kes

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
A quick script call. I'm going to assume that the actor id 5 is going to be added.
Add this after adding the actor to the party.
Code:
leader_level = $game_party.leader.level - 1
$game_actors[5].change_level(leader_level, false)
 

slickdeath97

Veteran
Veteran
Joined
Feb 26, 2019
Messages
442
Reaction score
9
First Language
english
Primarily Uses
RMVXA
A quick script call. I'm going to assume that the actor id 5 is going to be added.
Add this after adding the actor to the party.
Code:
leader_level = $game_party.leader.level - 1
$game_actors[5].change_level(leader_level, false)
That worked wonders. Thanks for the help all of you.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,862
Reaction score
5,240
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,017
Messages
1,018,356
Members
137,802
Latest member
rencarbali
Top