i've run into a strange problem. in my game, I have custom exp tables for each class, but once assigned, even when I successfully change character classes, the experience table remains the same. Here's the script i'm using for my exp tables.
def make_exp_list
actor = $data_actors[@actor_id]
case actor.class_id
when 1 #Artist, Normals
@exp_list = {
1 => 0,
2 => 1250,
3 => 2500,
...}
when 5 #Hunter/Ranger/Scout
@exp_list = {
1 => 0,
2 => 2250,
3 => 4500,
...}
else #fighter, Etc.
@exp_list = {
1 => 0,
2 => 2000,
3 => 4000,
...}
end #end case
end # end exp list
A quick look shows it is to be expected, as the class_id value is a constant of "1" say, if they start with class_id 1. Since the experince isnt class based, the way it handles a class change is removing all unusable equipment but doesnt refresh skill list or experince as it doesnt need to.
#--------------------------------------------------------------------------
# * Change Class ID
# class_id : New class ID
#--------------------------------------------------------------------------
def class_id=(class_id)
@class_id = class_id
for i in 0..4 # Remove unequippable items
change_equip(i, nil) unless equippable?(equips[i])
end
end
As you can see it doesnt update the skill list or experience list, since it only cares about new levels and skills not old.
To test this I printed the class_id out before the game started(at the menu) and after the class change and it remained constant at 1. Even recalling the game_Actor class it still has value 1.
p $data_actors[1].class_id on a script event for this, after he changed to a knight(class_id 5).
My solution which unfortunately I dont have time to code due to exams :S would be to set a variable(within the script) for each actor to the starting class_id and make the Game Actor class_id determine its value of this, then just make sure you update that variable when you change the class.
If another is found Id love to know myself but since its 2:45am here Id say thats enough thinking :P
I know I havnt been much help at solving your problem but by identifying why its acting strangely you could find a suitable solution.
theconqueror
Hey,
Rehad a looka t the code and have solved your issue: using the above logic(in previous post) all you have to do is insert this code above main :).
class Game_Actor < Game_Battler
def class_id=(class_id)
@class_id = class_id
$data_actors[1].class_id = @class_id
for i in 0..4 # Remove unequippable items
change_equip(i, nil) unless equippable?(equips[i])
end
make_exp_list
end
end
Btw hard coding like your doing will be a ball-ache and if you dont make sure you have 100 values for all levels in the array then you will get a "cannot convert nil into fixum" error.
All the best in future coding
theconqueror
While I got important parts of this resolved about 3 days ago in another thread, You are totally right about the level 100 issue. I ran into it while testing a "level up fairy" to see if characters would have different levels with the same exp totals if their charts were different. That worked fine until the exp totals went off the charts then crashed.