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.

Actors : Append Skills

Actors : Append Skills
Version: 1.0
By: Kain Nobel

Introduction

This snippet was made with projects in mind that release a seperate demo for sequel chapters, which are subject to changes in a Class's skill library. In lamens terms, lets say you set it so [Hero] was supposed to learn [Skill] at [level #] in your next release, but the previous release this skill wasn't present in the Class's Skill Learnings library; there is a possibility the player has already leveled up past the point where he was supposed to learn that [skill] in the previous chapter.

The remedy; call $game_actors.append_skills from the first map in your demo, and each actor will learn skills they leveled too high to get in the next chapter!

Features

  • One simple call script to append skills in your next project.

Script

Code:
#===============================================================================

# ** Game_Actors

#===============================================================================

 

class Game_Actors

  #-----------------------------------------------------------------------------

  # * Append Skills

  #-----------------------------------------------------------------------------

  def append_skills

    @data.each {|actor|

    unless actor.nil?

      actor.append_skills

    end}

  end

end

 

#===============================================================================

# ** Game_Actor

#===============================================================================

 

class Game_Actor < Game_Battler

  #-----------------------------------------------------------------------------

  # * Append Skills

  #-----------------------------------------------------------------------------

  def append_skills

    old_level = @level

    @level = 0

    begin

      @level += 1

      for j in $data_classes[@class_id].learnings

        if j.level == @level

          learn_skill(j.skill_id)

        end

      end

    end until @level == old_level

  end

end

FAQ

It calls all actors to level up from level 1 back up to their current level, thus triggering the skills set by class to be learned again if they haven't already been.
If thats what you want to do, just paste this little snippet along with the above script...

Code:
#===============================================================================

# ** Scene_Load

#===============================================================================

 

class Scene_Load < Scene_File

  #-----------------------------------------------------------------------------

  # * Alias Listings

  #-----------------------------------------------------------------------------

  alias_method :appendskills_scnload_readsavedata, :read_save_data

  #-----------------------------------------------------------------------------

  # * Read Save Data

  #-----------------------------------------------------------------------------

  def read_save_data(file)

    appendskills_scnload_readsavedata(file)

    $game_actors.append_skills

  end

end

...and thats it!

Compatibility

Should be compatible with most anything under the sun, might even work for VX.

Terms and Conditions

Free to use at your own discression, commercial or non-commercial projects. You can credit me if you'd like ;)
 

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