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.

More help for a noob

ffhero

Member

Is it possible to change variable caps beyond their preset limit? For example, making the character level cap go beyond level 99. And if so, where is it located in the script editor?
 

e

Sponsor

I don't think so, but I could be wrong. My guess is it's defined in the $data_actors variable, which is read only, as far as I know.

It is possible to hack it, though, not in a very elegant manner. If you open up the Script Editor, select the Game_Actor script and go to line 478, you'll see the following :

Code:
  #--------------------------------------------------------------------------
  # * Change Level
  #     level : new level
  #--------------------------------------------------------------------------
  def level=(level)
    # Check up and down limits
    level = [[level, $data_actors[@actor_id].final_level].min, 1].max
    # Change EXP
    self.exp = @exp_list[level]
  end

Replace it by :

Code:
  #--------------------------------------------------------------------------
  # * Change Level
  #     level : new level
  #--------------------------------------------------------------------------
  def level=(level)
    # Check up and down limits
    level = [level, 1].max # To ensure that you don't have negative levels, or level 0
    # Change EXP
    self.exp = @exp_list[level]
  end

You'd have a problem though; the exp_list presumably contains 99 variables. As such, your exp would go kinda off the chart, if you catch my drift. I suppose there is a work around to that too; I'll look into it.


EDIT : I've redone it.

Code:
#--------------------------------------------------------------------------
  # * Change Level
  #     level : new level
  #--------------------------------------------------------------------------
  def level=(level)
    # Check up and down limits
    level = [level, 1].max
    # Change EXP
    # If our level is above the max, add the max xp to our current xp
    # Note that using this renders the level cap useless
    if level > $data_actors[@actor_id].final_level
      self.exp += @exp_list[$data_actors[@actor_id].final_level]
    else
      self.exp = @exp_list[level]
    end
  end

Basically, once you hit level 100, your experience points will be incremented by the exp you were to have at level 99, and so forth. I think there's an experience cap too, but it's pretty irrelevant.
 

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