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.

[Script Request for XP/VX] Skill Points

I need a script that will give players a skill point every time they level up. There will be no going back in levels, or skill "tree", so no complicated stuff. But, I do need a way to check how many points they each have.

I just need something that says something like:
- [When {character} gains level, give 1 skill point] and
- [When {skill} is increased, decrease skill points by 1] and
- [If skill points=0, cancel increase skill]

Also, people will be joining at different times. Make it a way to give them the skill points they need. If I have to, I'll make them level 1 to start, then just give them levels as needed.

Can I make it so an item tells them how many skill points they have and let's them spend it?

While I'm at it, I need a way to make joining characters the same level as the main character.

Thanks for the scripts!
 
Code:
class Game_Actor

  attr_reader :skill_points

  alias_method :seph_skillpoints_gmactr_init, :initialize

  def initialze(*args)

    seph_skillpoints_gmactr_init(*args)

    @skill_points = 0

  end

  alias_method :seph_skillpoints_gmactr_exp=, :exp=

  def exp=(exp)

    last_level = @level

    self.seph_skillpoints_gmactr_exp=(exp)

    while last_level < @level

      @skill_points += 1

      last_level += 1

    end

  end

  alias_method :seph_skillpoints_gmactr_ls, :learn_skill

  def learn_skill(skill_id)

    has_learned = @skills.include?(skill_id)

    seph_skillpoints_gmactr_ls(skill_id)

    @skill_points -= 1 if @skill_points != nil && has_learned == false

  end

end

Ok, so not when your characters level, the variable skill points increases in Game_Actor. When they learn a skill, a point is taken away. To check how many skill points someone has, use:
Code:
$game_actors[actor_id].skill_points

Let me know if that works for you. :thumb:
 

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