Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Exp ?

Is there a way to adjust the exp so that you level up every time you get 100 exp?

The database only allows you to set some kind of progressive growth curve.
 
Insert a new script right above main. (I called it Custom_Exp_Curve)

Code:
#
# Custom_Exp_Curve (Brew)
#
class Game_Actor
  #--------------------------------------------------------------------------
  # * Calculate EXP
  #  modify method to linear curve @ 100 EXP per level
  #--------------------------------------------------------------------------
  def make_exp_list
    actor = $data_actors[@actor_id]
    @exp_list[1] = 0
    for i in 2..100
      if i > actor.final_level
        @exp_list[i] = 0
      else
        @exp_list[i] = @exp_list[i-1] + 100
      end
    end
  end
end

Be Well
 
Thanks Brew, works perfectly.

One minor tweak if you could. could you make it so that any exp gained after the 100 level incements is reached it just rounds down to the nearest 100?

if not that's okay, this works perfect for now.
 
That method only creates the EXP table (curve) that levels get calculated from.
We have to modify "exp=" to round off the increase when leveling up...

Replace your "Custom_Exp_Curve" class (script) with this...

Code:
#
# Custom_Exp_Curve (Brew)
#
class Game_Actor
  #--------------------------------------------------------------------------
  # * Calculate EXP
  #  modify method to linear curve @ 100 EXP per level
  #--------------------------------------------------------------------------  
  def make_exp_list
    actor = $data_actors[@actor_id]
    @exp_list[1] = 0
    for i in 2..100
      if i > actor.final_level
        @exp_list[i] = 0
      else
        @exp_list[i] = @exp_list[i-1] + 100
      end
    end
  end
  
  #--------------------------------------------------------------------------
  # * Set EXP
  #  modify method to round off extra exp when leveling up
  #--------------------------------------------------------------------------  
  def exp=(exp)
    @exp = [[exp, 9999999].min, 0].max
    # Level up
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      @level += 1
      if @exp < @exp_list[@level+1]
        @exp = @exp_list[@level]
      end
      # Learn skill
      for j in $data_classes[@class_id].learnings
        if j.level == @level
          learn_skill(j.skill_id)
        end
      end
    end
    # Level down
    while @exp < @exp_list[@level]
      @level -= 1
    end
    # Correction if exceeding current max HP and max SP
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end
end

Happy Gamemaking
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top