Chaos Project

RPG Maker => Event Systems => Event System Troubleshooting => Topic started by: Siffers on February 04, 2012, 08:52:08 am

Title: [XP] Need help with leveling through events
Post by: Siffers on February 04, 2012, 08:52:08 am
I have a character that is meant to join the party later in the game, so I had it set to average his level with the rest of the party. The issue I'm having is after his level is changed, he didn't learn any of the skills he should have. How do I fix this?


I'm using a variable set with his level and a conditional branch to learn the skills, but I'd like an easier method if there is one.
Title: Re: [XP] Need help with leveling through events
Post by: ForeverZer0 on February 05, 2012, 02:16:24 am
This will set the level by the average level of the current active party, not including any in "reserve":
lvl = 0
$game_party.actors.each {|a|
lvl += a.level
}
lvl /= $game_party.actors.size
$game_actors[1].level = lvl



This will factor in reserve party members, but be careful that you don't have a bunch sitting at level 1, since it will greatly skew the average:
lvl = count = 0
(1..$data_actors.size).each {|i|
if $game_actors[i] != nil
lvl += $game_actors[i].level
count += 1
end
}
lvl /= count
$game_actors[1].level = lvl


Just put these in a script call.
For both methods, you need to replace the number in the brackets from the 1 to the ID of the actor you want to set the level of.
Title: Re: [XP] Need help with leveling through events
Post by: Blizzard on February 05, 2012, 05:46:52 am
F0, I suggest you set the average level using the average EXP. This would be a lot better.
Title: Re: [XP] Need help with leveling through events
Post by: Siffers on February 11, 2012, 10:59:34 am
Thanks for the help and sorry for the late reply, been a little under the weather  :^_^':