RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[resolved]Changing/Dual Class Exp Table?

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 82
We learn by living...
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.

Code: [Select]
    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

« Last Edit: January 04, 2011, 04:19:33 AM by shintashi »

**
Rep:
Level 84
Know where you've been, to find out where your goi
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.

Code: [Select]
  #--------------------------------------------------------------------------
  # * 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.

Code: [Select]
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

**
Rep:
Level 84
Know where you've been, to find out where your goi
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 :).

Code: [Select]
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

***
Rep:
Level 82
We learn by living...
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.