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.

Is there a script that will let me replace skills as my character levels up?

Hmmm

Code:
class Game_Actor
  #--------------------------------------------------------------------------
  # * Update Skills
  #     syntax new_skill => old_skill
  #--------------------------------------------------------------------------
  Upgrade_Skills = {}
  #--------------------------------------------------------------------------
  # * Learn Skill
  #     skill_id : skill ID
  #--------------------------------------------------------------------------
  alias_method :trick_upgrade_actor_learn_skill, :learn_skill
  def learn_skill(skill_id)
    trick_upgrade_actor_learn_skill(skill_id)
    forget_skill(Update_Skills[skill_id]) if Upgrade_Skills.key?(skill_id)
  end
end

Ok add that in a new script above main

in the Upgrade Skills constant the key is the new skill and the value is the old skill (which gets forgotten) ex {2 => 1, 3 => 2}

scripted in two minutes (haha new record) that should work if it gives you any trouble tell me
 

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